Optimizing JavaScript packages for tree shaking

Geoffrey Dhuyvetters from madewithlove on how authors of (open source) JavaScript packages can optimize their builds for tree shaking: How do we create a package that exposes both CommonJS & ES modules while making sure we don’t break cross-platform support? Publishing 2 separate packages is an option (e.g. lodash/lodash-es). But there is a nicer, more …

Making Future Interfaces: ES Modules

Once again a highly entertaining video by Heydon Pickering. This time he’s tackling ES Modules: how and where (e.g. in which browsers) can you use them? 💁‍♂️ Even if you already know how to ship ES2015 JavaScript to browsers the video still is worth your time, as it’s very fun to watch!

Not your typical map: “Where is all the poop on the moon?”

Ever wondered what the astronauts that landed on the moon did with their waste? Well, they ditched them on the moon itself. It’s been nearly 50 years since the Apollo 11 moon landing. Neil Armstrong’s iconic footprint is still there, undisturbed; there’s no atmosphere, no wind on the moon to blow it away. But the …

Fading out siblings on hover in CSS

Nice one by Trys Mudford: Hover states traditionally run on the element being hovered on (makes sense, right?). But we can also listen for the hover event on the parent element. That’s the crux of this ‘trick’, we fade out all children when the parent is hovered, and attach another hover handler the child, fading …

Tiny Mirror – Mirror your Webcam into the Favicon

Fun little experiment that mirrors your webcam into your favicon. Tiny Mirror → 🔥 The aforementioned favico.js (from 2013!) also comes with a “Webcam video to icon” option. Next to mirroring the webcam into your favicon it also supports badges, videos, etc. 🍰 Looking to display (pie)charts in your favicon? Piecon can do that for …

Direction Aware Hover Effect

A thing I commonly see nowadays are animated lines underneath menus and links: Show Pen One issue with that though: when hovering over an item the animation does not start from the place where you hover, but from a fixed point (here: bottom-center). Try hovering an item from one of its edges and you’ll see: …

Unsafe SQL functions in Laravel

Recently the folks from Spatie released a security update for their laravel-query-builder package. Turns out it was vulnerable to SQL Injection. At the core of the vulnerability is the fact that Laravel offers a shorthand for querying only certain fields of JSON data, but that these do not get escaped when converted to a json_extract …

HTML slides without frameworks, just CSS

Creating a slidedeck with CSS is not really that difficult. Stack all slides on top of each other, and then make good use of the :target pseudo-class selector: We adjust the z-index for the active slide to be higher than all the other inactive slides with our trusty :target selector. section { height: 100vh; width: …