Skip to content

Instantly share code, notes, and snippets.

@fitsum
Last active April 26, 2024 05:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitsum/9bcf604222efe94f29a5e77b00036af2 to your computer and use it in GitHub Desktop.
Save fitsum/9bcf604222efe94f29a5e77b00036af2 to your computer and use it in GitHub Desktop.
dumb console animation
var angle = null,
step = 20,
rate = 90;
draw = () => {
if (!angle) {
angle = 0;
}
console.clear();
console.log("%c ", "background: linear-gradient(" + (angle + 180) + "deg ,rgba(0,0,255,0.5) 0%,transparent 100%), linear-gradient(" + (angle + 90) + "deg ,rgba(0,255,0,0.5) 0%,transparent 100%), linear-gradient(" + angle + "deg,rgba(255,0,0,0.5) 0%,transparent 100%);font-size: 71px; color: blue;")
angle += step;
}
setInterval(draw, rate);
//use requestAnimationFrame
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment