CSS Pixel Art + Generator
Crisp pixel art with no images: a pure-CSS beating heart, plus a tiny JS helper that turns a text grid into box-shadow sprites.
⚑ Report this
Crisp pixel art with no images: a pure-CSS beating heart, plus a tiny JS helper that turns a text grid into box-shadow sprites.
The download has a working demo (index.html) plus the files to copy. The key file is shown below with a Copy button.
// CSS Pixel Art · Cube Burst Studios · CC0
// Turns a text grid into pixel art made of one element's box-shadows (crisp at any size, no images).
// pixelArt(element, ["..RR..", ".RRRR."], { R: "#ef4c7a" }, 8)
export function pixelArt(el, rows, palette, size = 8) {
const shadows = [];
rows.forEach((row, y) => [...row].forEach((ch, x) => {
if (palette[ch]) shadows.push(`${(x + 1) * size}px ${(y + 1) * size}px 0 ${palette[ch]}`);
}));
Object.assign(el.style, { width: `${size}px`, height: `${size}px`, boxShadow: shadows.join(","),
marginRight: `${rows[0].length * size}px`, marginBottom: `${rows.length * size}px` });
el.setAttribute("role", "img");
return el;
}MORE
WEB DEV
View all ↗Dark Mode Toggle (No Flash)
An accessible theme switch that follows the system setting, remembers the visitor's choice and never flashes white on load.
Game Landing Page Template
A complete one-page site for your game: sticky nav, hero with Play button, trailer slot, features, FAQ and a call-to-action band.
Memphis Pattern Backgrounds
Eight pure-CSS repeating patterns (stripes, dots, grid, zigzag, waves, checker, triangles, confetti). Recolour with two variables.
Infinite Marquee (Accessible)
A seamless scrolling ticker that pauses on hover/focus and stops for reduced-motion users. Works with text, chips or logos.