An animation that doesn't use any CSS...
An animation that doesn't use any JavaScript....
It is all done with pure HTML!
Warning: If you experience epilepsy, motion sensitivity (vestibular disorders) or are using a screen reader, you probably shouldn't click the link....yet again this is a silly experiment that should never be used in the real world and unfortunately is not accessible!)
Click here to experience it in all of it's glory! (sorry I can't make it work on dev.to!)
Spoilers lie below so make sure you click the link and see it in action before scrolling down!
.
.
.
.
.
.
.
Spoilers in
.
.
.
.
.
.
3
.
.
.
.
.
.
2
.
.
.
.
.
.
1
.
.
.
.
.
.
Spoilers!
Rick Roll in ASCII text
Yes I did just Rick Roll you with ASCII text!
I title the piece "Rick ASCII-ly" (groan) ๐คฃ
So what is going on?
There are 44 pages each with a different "frame" of our ASCII video.
Each frame is then set to automatically load the next page using <meta http-equiv="refresh" content="0; URL = {next page URL}">
The last page then points to the first page to create an infinite loop!
1.php -> 2.php -> [...] -> 44.php -> 1.php and the loop continues.
By setting the delay to 0 on the meta refresh, and with a fast enough connection (or when all the images are cached locally), it actually performs reasonably well (in fact it is a little bit too quick!)....it is just a shame I can't play audio as well in pure HTML!
How did you create the frames?
I used an online tool (Edit: sadly it no longer exists since writing this article, but I am sure there are others) to convert a GIF to each frame of ASCII art.
Then I just copied the ASCII text into a <pre> element for each of the pages and set the redirect to the next frame programmatically.
Note that although the file extension is .php this would still work with .html files. There is no server side magic going on here, I just had the files as PHP during testing so I could run some checks and never changed it.
FireFox
If you viewed it in Chrome originally you should also view it in FireFox, they seem to try and interpret the symbols with syntax highlighting (as they are displayed within a <pre> tag) so you get some (strange) colour for free!
Compatibility
This works all the way back to Netscape Navigator 1.1 - it is the most compatible animation format in the world! - I wonder if "caniuse" will add it to their database? ๐๐คฃ
Why?
Does it have any practical uses? no.
Did it get me locked out of my server as it triggered Mod Sec with too many requests? Absolutely!
Is it a bit of fun on a Friday? Yes
So happy weekend people, you got rick rolled with ASCII text so I win the internet for today ๐คฃ!
Leave a comment if you hate me for this!
Oh and don't be afraid of sharing it on social media - I want to see if my server can cope with thousands of requests a second ๐ - a free stress test woohoo!