Guidelines and patterns for creating high-end, visually stunning web-based games with modern UI/UX.
This skill provides a comprehensive framework for developing high-quality, visually appealing web games using Vanilla JavaScript, HTML5 Canvas, and modern CSS.
requestAnimationFrame for smooth frame rates and optimize canvas drawing.Always define a coherent color system:
:root {
--primary-color: #00ff88; /* Neon Green */
--secondary-color: #ff0055; /* Hot Pink */
--bg-dark: #0a0a0c; /* Deepest Blue/Black */
--card-bg: rgba(255, 255, 255, 0.05);
/* ... */
}
Always implement a resize listener to handle different display resolutions:
function resizeCanvas() {
const container = canvas.parentElement;
canvas.width = container.clientWidth;
canvas.height = container.clientHeight;
}
Maintain a clear separation between Update and Draw logic:
function gameLoop() {
updateState();
renderFrame();
requestAnimationFrame(gameLoop);
}
Always include a .github/workflows/static.yml for zero-touch deployment to GitHub Pages. Remember to instruct the user to set the source to "GitHub Actions" in repository settings.