Last active
April 26, 2024 05:25
-
-
Save fitsum/9bcf604222efe94f29a5e77b00036af2 to your computer and use it in GitHub Desktop.
dumb console animation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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