? ZERO CSS and just 1 HTML element to build a fully interactive SPA???!!?? ? Abusing the internet once more! [Extreme SSR!]

I am back at it again, abusing the internet and this one should really blow you away.

This time I really do think I have outdone myself.

I present to you:

A 3 page SPA with an interactive poll and a contact form, with no CSS and one DOM element…


This content originally appeared on DEV Community and was authored by InHuOfficial

I am back at it again, abusing the internet and this one should really blow you away.

"hold onto your butts" from Jurassic Park 1

This time I really do think I have outdone myself.

I present to you:

A 3 page SPA with an interactive poll and a contact form, with no CSS and one DOM element - just a single image! (go on, inspect the page!)

I call it "Extreme Server Side Rendering (SSR)" ?

PLEASE NOTE: - if using a mobile you cannot use the contact form, I couldn't find a way of opening the keyboard without an <input> I am afraid! Try it on PC instead!

FINAL THING: Due to the round-trip time to the server the page feels "laggy", if you are on a 3G connection it might be unusable so wait until you are on a better connection before trying it!

> > > > Try the single image SPA here! (best viewed on PC) < < < <

What can I do in the SPA?

There are some fun bits for you to try:

It kind of works with a keyboard

Well, you can Tab to elements to highlight them. You can even activate them with "Enter".

Just don't expect a smooth experience (and I have only tested it in Chrome so it may not work in other browsers!)

The home page is responsive

Yup, if you try it on your mobile the home page actually has two different versions, a mobile one and a desktop one.

On mobile you can even open and close the menu!

I sadly didn't have time to make the other two pages responsive (this silly project took ages already!).

The poll actually works!

Cast your vote on the SPA as to what you think of my silly experiments!

The current results are as follows:

This has to be the stupidest thing I have ever seen - I love it!
45%

Quite silly, being rick rolled by ASCII text was sillier though!
18%

This is silly? I thought this was what server side rendering was!
36%

The contact form "works"

It is one of if not the worst experiences you will ever have on the web, but it works!

In fact you can see the messages people have posted via the SPA in the final section!

What is actually going on here?

Oh loads!

Essentially every interaction with the page is being tracked with JavaScript and cookies.

I am then sending that to a script on my server that renders an image based on mouse position, current focused item, keys pressed and more. I then send the constructed image back so you can view it!

Needless to say I now have a much greater appreciation for browser developers as there are so many little things that I just take for granted!

To give you an idea of how difficult this is, from the X and Y coordinates of the mouse I calculate if an item is hovered. To do that I need the X, Y, width and Height of each item on the page. I also need to know what state to turn that button to.

Now if you click, I have to check if the click is within the bounds of a button and what action should be performed!

Multiply that by 3 pages worth of buttons and inputs and a few other features and there is an awful lot I had to plumb together!

Final words before the comments

As with all of my silly experiments, there is no real point to this, just a bit of fun for you on a Friday!

Have a fantastic weekend!

User comments submitted via the contact page (may be disabled if people cannot behave ?)

Here are a few comments that people have added via the single image SPA!

InHuOfficial - 17:11 21/05/2021
I look forward to seeing the messages you all post! Don't forget that you have to wait one minute before refreshing this page to see your comment!

asdfsadf - 17:40 21/05/2021
asdfasdfasdfasdfsaf

testt - 17:41 21/05/2021
est

For the Algo!

If you enjoyed this article, give it a ❤? and don't forget:

Leave a comment for the algorithm! (even if it is just to say how silly I am ?!)


This content originally appeared on DEV Community and was authored by InHuOfficial


Print Share Comment Cite Upload Translate Updates
APA

InHuOfficial | Sciencx (2021-05-21T16:28:02+00:00) ? ZERO CSS and just 1 HTML element to build a fully interactive SPA???!!?? ? Abusing the internet once more! [Extreme SSR!]. Retrieved from https://www.scien.cx/2021/05/21/%f0%9f%98%b2-zero-css-and-just-1-html-element-to-build-a-fully-interactive-spa-%f0%9f%98%b1-abusing-the-internet-once-more-extreme-ssr/

MLA
" » ? ZERO CSS and just 1 HTML element to build a fully interactive SPA???!!?? ? Abusing the internet once more! [Extreme SSR!]." InHuOfficial | Sciencx - Friday May 21, 2021, https://www.scien.cx/2021/05/21/%f0%9f%98%b2-zero-css-and-just-1-html-element-to-build-a-fully-interactive-spa-%f0%9f%98%b1-abusing-the-internet-once-more-extreme-ssr/
HARVARD
InHuOfficial | Sciencx Friday May 21, 2021 » ? ZERO CSS and just 1 HTML element to build a fully interactive SPA???!!?? ? Abusing the internet once more! [Extreme SSR!]., viewed ,<https://www.scien.cx/2021/05/21/%f0%9f%98%b2-zero-css-and-just-1-html-element-to-build-a-fully-interactive-spa-%f0%9f%98%b1-abusing-the-internet-once-more-extreme-ssr/>
VANCOUVER
InHuOfficial | Sciencx - » ? ZERO CSS and just 1 HTML element to build a fully interactive SPA???!!?? ? Abusing the internet once more! [Extreme SSR!]. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/05/21/%f0%9f%98%b2-zero-css-and-just-1-html-element-to-build-a-fully-interactive-spa-%f0%9f%98%b1-abusing-the-internet-once-more-extreme-ssr/
CHICAGO
" » ? ZERO CSS and just 1 HTML element to build a fully interactive SPA???!!?? ? Abusing the internet once more! [Extreme SSR!]." InHuOfficial | Sciencx - Accessed . https://www.scien.cx/2021/05/21/%f0%9f%98%b2-zero-css-and-just-1-html-element-to-build-a-fully-interactive-spa-%f0%9f%98%b1-abusing-the-internet-once-more-extreme-ssr/
IEEE
" » ? ZERO CSS and just 1 HTML element to build a fully interactive SPA???!!?? ? Abusing the internet once more! [Extreme SSR!]." InHuOfficial | Sciencx [Online]. Available: https://www.scien.cx/2021/05/21/%f0%9f%98%b2-zero-css-and-just-1-html-element-to-build-a-fully-interactive-spa-%f0%9f%98%b1-abusing-the-internet-once-more-extreme-ssr/. [Accessed: ]
rf:citation
» ? ZERO CSS and just 1 HTML element to build a fully interactive SPA???!!?? ? Abusing the internet once more! [Extreme SSR!] | InHuOfficial | Sciencx | https://www.scien.cx/2021/05/21/%f0%9f%98%b2-zero-css-and-just-1-html-element-to-build-a-fully-interactive-spa-%f0%9f%98%b1-abusing-the-internet-once-more-extreme-ssr/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.