Hacker News new | ask | show | jobs
by diggan 339 days ago
My intuition was that most of the (transferred) 11MB would be images, but no! Of course it's JavaScript bundles: https://i.imgur.com/QoM0Mz5.png

I'm guessing most of that code is used for other things on the website/landing page (SPA without bundle splitting per page), and the same stuff is loaded for every page, since the code for building that would be trivial compared to the multiple large bundles like they're shipping right now.

Which kind of makes me think, what is the smallest amount of JS one could write to 100% replicate this page? Would <1KB be enough? Bonus points if it could be implemented with CSS only, under 1KB.

3 comments

But there are interactive chickens if you wait long enough.
CSS (since like CSS2, 1998) has interactivity too ;) Time to read up on the specifications oldie!
> But there are interactive chickens if you wait long enough

Wow, that phrase triggered a tune burried deep in my brain I hadn’t heard in 20 years.

Brains are weird

It reacts with the visibility state, so no JS seems impossible. [ADDED:] Besides from the obvious mouse interaction, [/ADDED] everything else should be implementable in CSS I believe.
How would you implement that scrolling background? Particularly the mouse interaction, where it scrolls with a dynamic speed ( depending on how far to the side the mouse it) and even has some smooth damping when you stop scrolling.

And what part uses the visibility state? The grayscale seems to be triggered by focus which I think would be doable with CSS

> How would you implement that scrolling background?

At a glance I'm not sure exactly how I'd implement it, but my guess is that it's possible with some workarounds and hacks, at the very least.

Here's an article showing some demos (at the bottom) on how you can make the mouse cursor affect CSS: https://css-tricks.com/how-to-map-mouse-position-in-css/

Ah, I forgot that (everything except for the interaction should be okay, though). For the visibility state however, checking for focus is insufficient because you can have elements focused without the document being visible.
Scrolling using actual scroll - instead of following the pointer and automatically scrolling - would make the page better anyway IMHO
Not sure about the interactive part, but I have build butterflies like this in pure CSS with css animations before. Definitely doable.
modern.vendor.{cache_id}.min.js => 37.11MB