DEV Community

Cover image for Animations without JS...or CSS...or IMAGES??!? šŸ˜² Pure HTML animation!

Animations without JS...or CSS...or IMAGES??!? šŸ˜² Pure HTML animation!

GrahamTheDev on April 16, 2021

I recently created a countdown timer that used no JS, CSS or HTML. Then I went one better and built a password generator in pure CSS (no JS!) But...
Collapse
 
grahamthedev profile image
GrahamTheDev

I don't know why I am so proud of myself for using a 15 year old meme....I think it is the sheer effort converting the video to ASCII text that did it and the hour remembering how to get past Mod Sec when I locked myself out of my server that did it.

@afif I am so sorry to do the no CSS thing to you again bud!

Collapse
 
0vortex profile image
TED Vortex (Teodor Eugen Duțulescu)

loving your clickbait, I'm sure they attract the best possible audiences

Collapse
 
grahamthedev profile image
GrahamTheDev • Edited

The title might have the clickbait style but it isn't clickbait if you tell the truth and deliver on your promise surely? šŸ˜‹šŸ˜‚

As for attracting the best audiences, you are here so I would say I most certainly do attract the best people šŸ˜‰ā¤

Collapse
 
0vortex profile image
TED Vortex (Teodor Eugen Duțulescu)

you could have just gotten the cue btw but this just proves to show you know EXACTLY what you are doing.

Thread Thread
 
grahamthedev profile image
GrahamTheDev

You should perhaps check out the other items in the series, there is only one where the title is a little bit misleading and that was due to character count and I expand upon that in the first paragraph (dev.to/inhuofficial/is-0kb-of-html...).

As for knowing what I was doing I cannot tell if you are being ironic or not in writing so I gave you the benefit of the doubt.

The only clickbait titles I have are the two recent ones on listicles, and I am sure if you like irony and silliness you would love them as they are pure sarcasm!

Collapse
 
0vortex profile image
TED Vortex (Teodor Eugen Duțulescu)

I was ironic, it's not HTML it's PHP ... hence the clickbait.

Thread Thread
 
grahamthedev profile image
GrahamTheDev • Edited

It is just a .php extension - check the outputted HTML it is indeed just a load of HTML, it would work equally well with a .html extension.

It uses <meta http-equiv="refresh" content="0;url={next frame}" /> meta tag to request the next frame (which is stored on an individual URL), then after a certain amount of frames it just requests the first frame again ([...]1.php).

Each frame is just HTML. If you open it on a PC you will see the URL changes rapidly. No PHP trickery I promise!

Collapse
 
adam_cyclones profile image
Adam Crockett šŸŒ€

SVG SMIL it's animation without CSS or JavaScript

Collapse
 
grahamthedev profile image
GrahamTheDev • Edited

SVG is an image format...so that would be animation without CSS or JS - in which case I could also have just used a GIF šŸ˜‹

The article was pure HTML animation!

Collapse
 
adam_cyclones profile image
Adam Crockett šŸŒ€

SVG is made of XML so is html so by the transit of properties šŸ¤” we are all winning here

Thread Thread
 
grahamthedev profile image
GrahamTheDev

That is XHTML if we are going to try and squeeze it in (which never quite took off). I could make the document HTML 4 and then get away with it, but HTML != XML due to the fact you can declare a void element like this <br> or <hr> - that would break XML as it isn't self-closed!

SVG is also a separate spec to HTML so I don't think I could get away with it without it being clickbait!

However using SVG SMIL is going to be another part of this series of silly experiments with "clickbait" titles that turn out to not be clickbait! šŸ˜‰.

Thread Thread
 
adam_cyclones profile image
Adam Crockett šŸŒ€

On the subject of clickbait titles.

Do X in Y time

X things you wouldn't Y

That's the magic right there šŸ¤£

Thread Thread
 
grahamthedev profile image
GrahamTheDev • Edited

I am practicing my clickbait titles - see if you like any of these (these are actual articles I am working on, just made the titles pure clickbait for you! šŸ¤£)

  • I downloaded every article on dev.to [246000 articles!] - here is what I learned (I actually did download every article - 9.3GB without images!)
  • Sorry guys, the results are in and SIZE DOES MATTER. (byte efficiency article)
  • A website without a single line of HTML? (part of this series!)
  • GDPR and cookie consent are making things LESS private (the new Google spying they are trialing)
  • 10 useful HTML elements your probably don't know (with a bonus one of course!)
  • The secret to a happy website is good <HEAD> (preloading etc.)

A couple of them might be a little too far šŸ¤£šŸ¤£

Collapse
 
ingosteinke profile image
Ingo Steinke, web developer

Hi Graham, I clicked on your link before reading the spoiler, saw the artwork and started to understand ... and had to laugh out loud! Nice surprise! no wonder it does not work on dev.to though. Have a nice weekend!

Collapse
 
grahamthedev profile image
GrahamTheDev

Haha thanks Ingo, I hope you have a great weekend too!

Collapse
 
rplantiko profile image
RĆ¼diger Plantiko

I like to be rickrolled this way! šŸ˜‰

btw: for developers, the words "ASCII" or "plain text" will never sound backward or retarded - as they do for the hipsters - but they will always feel like "the real thing".

Collapse
 
grahamthedev profile image
GrahamTheDev

As long as it brought a smile to your face then it did itā€™s job! šŸ˜„

 
grahamthedev profile image
GrahamTheDev

It is one of those projects where you ā€œdo it badlyā€ and then see how many clever algorithms etc a real codec uses and learn loads....added it for about 3 posts from now as I think it would be fun!

Thanks for the idea šŸ˜„

Collapse
 
thalitadev profile image
Thalita G.

Your posts lately have been having me like...

inhu

(jk I love you)

Collapse
 
grahamthedev profile image
GrahamTheDev

That picture is awesome!

Glad my posts are inspiring strong feelings...they always say there is a fine line between love and hate šŸ¤£šŸ¤£šŸ¤£šŸ¤£ lets hope I stay on the right side of that line šŸ˜œ

Collapse
 
grahamthedev profile image
GrahamTheDev

I couldn't check it last night - it is 2.5kb per frame when gzipped for a 200 by 60 "resolution" image.

So it looks like you are right, I won't be able to roll this out as the future of video bandwidth saving ideas!

However you have given me an idea for a fun experiment for trying to write an "ASCII codec"....but that might be beyond my skills šŸ¤£

Collapse
 
grahamthedev profile image
GrahamTheDev

Haha, with gzipping I would imagine the bandwidth usage is quite low šŸ˜œšŸ¤£šŸ¤£

Collapse
 
12944qwerty profile image
12944qwerty

How long did it take to you to make every single frame? And how did you get enough patience? Just... wow!!!

Collapse
 
grahamthedev profile image
GrahamTheDev • Edited

I automated it - you can split a gif easily online into frames. Then I just used canvas to turn the frame grey and apply letters depending on the lightness / darkness of a square.

The only manual part was copying the text into a page as I couldnā€™t think of a way to automate that quicker than just copy and pasting.

Collapse
 
12944qwerty profile image
12944qwerty

Did you apply each letter by hand? Or did you make a program to detect that...

Thread Thread
 
grahamthedev profile image
GrahamTheDev

Oh god know - the program had 8 characters to choose from that represented different darknesses for pixels. So a # is darker than a ( for example. It then just spit out a 200 by 60 string that I could copy and paste into a <pre> tag so it was evenly spaced

Collapse
 
myleftshoe profile image
myleftshoe

Sure to be the next standard for web video! For some reason it reminds me of another 80s "icon" Samamtha Fox in the Commodore 64 game Samantha Fox Strip Poker. At least yours has motion.

Collapse
 
grahamthedev profile image
GrahamTheDev

Well I can understand how you could associate the two - Rick Astley is just that sexy that he is bound to remind you of Samantha Fox šŸ¤£šŸ¤£šŸ¤£šŸ¤£

And I totally agree - if all video was like this on the web I am sure the world would be a better place šŸ˜‹

Collapse
 
theriusblackers profile image
Arturo Gamboa

Wow! it's surprising, funny, and extremely good. I didn't really understand it at first, then I saw how it worked and I started to laugh internally hehe ... obviously it won't run in dev.to XD

Collapse
 
grahamthedev profile image
GrahamTheDev

If it made you smile then job done! Itā€™s not immediately obvious as it is abusing the hell out of my server so nobody would normally do this to themselves šŸ¤£šŸ¤£šŸ¤£

Collapse
 
afif profile image
Temani Afif

After 10 years of research we finally found the ancestor of Youtube. You should publish this as a scientific paper šŸ˜œ

Collapse
 
grahamthedev profile image
GrahamTheDev

Haha! Brilliant, made me chuckle! Have a great weekend!

Collapse
 
sywill profile image
William long II

Could load the animations in an iframe and add audio tag to get audio to play and still be pure html. I would think.

Collapse
 
grahamthedev profile image
GrahamTheDev • Edited

I did think this, in the brief test I did though it appeared the iframe did not like so many redirects, I might have a fiddle at some point and see if it was just a symptom of mod sec or something!

I suppose the issue is I then technically have 2 copyrighted works on my website šŸ˜œ

Collapse
 
12944qwerty profile image
12944qwerty

I knew exactly what was about to happen before I clicked the link.... just the way you had put it there made it like that.

Collapse
 
incrementis profile image
Akin C.

Hello InHuOfficial,

Thank you for your article!
Your Rick Roll was successful on me and I love a good joke.
It made me smile :)

Collapse
 
grahamthedev profile image
GrahamTheDev

Hehe glad I ā€œgot youā€ and it made you smile! Mission accomplished šŸ˜œ

Collapse
 
theowlsden profile image
Shaquil Maria

Getting rick-rolled by ASCII text... I'm down for it!šŸ˜‚ Let the crazy continue! Happy weekend.

Collapse
 
grahamthedev profile image
GrahamTheDev

I hope you have a great weekend too! šŸ˜„

Collapse
 
grahamthedev profile image
GrahamTheDev

Hehe, hopefully the beautiful ASCII art makes up for the disappointment of getting Rick rolled šŸ˜œ