frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Springs and bounces in native CSS

https://www.joshwcomeau.com/animation/linear-timing-function/
93•feross•2d ago

Comments

SweetSoftPillow•2h ago
I've encountered a strange bug (using Chrome for Android). When I have this CSS demo page open and scroll about halfway down, the volume of my background audio (e.g., a Twitch App stream) drops by about 50%. Closing the tab immediately restores the audio to its normal volume. I can reproduce this issue consistently. Does anyone have any idea what might be causing this behavior?

Edit: it seems it's caused by autoplay of Easing Wizard's video.

xnavra50•2h ago
Btw: the design of the webpage with all the animations and beautifully crafted info-boxes is top-notch.
rossant•2h ago
Agreed. And wow, try to turn dark/light theme on and off (hint: speakers on).
rosslh•2h ago
Yet another banger from Josh Comeau. Dude does not miss!
spankalee•1h ago
I wish CSS had two related things

- A function similar to linear() that supports control points so we can make multi-point Bezier paths.

- calc() support as an easing function so you could combine sin(), etc., and do oscillation with damping.

- A spring() function that remembers the current velocity for when parameters change.

magicalhippo•1h ago
I'm not a web guy. Why would you want that in CSS when you have Javascript?
paulhebert•1h ago
JS tends to be slower to load, parse and run than CSS.

Additionally, animations are often tightly linked to your page styles which are set in CSS. It’s easier to reason about them if they’re all in the same file and language instead of split across CSS and JS.

mminer237•1h ago
Off the top of my head:

* It's easier to write without pulling in dependencies.

* Being simpler syntax means smaller page sizes.

* In theory, CSS animations can be faster.

* You don't have to worry about attaching listeners to dynamic content.

* Styling with JS violates Separation of Concerns.

* `prefers-reduced-motion` is only available in CSS, so JS has to run a CSS query anyway.

Sesse__•44m ago
CSS animations run in the compositor thread, so they are isolated from jank due to concurrently running JS.
tkiolp4•1h ago
Nice website. I got the newsletter popup, but it was cute, not annoying like they usually are.
dmitrygr•1h ago
> There is an open proposal(opens in new tab) to add a spring() timing function to CSS. Unlike linear(), this would actually be a true spring physics implementation! It wouldn’t have any of the limitations we’ve discussed here.

Uh huh... How long till a proper implementation of CSS requires a proper emulator of relativistic physics and quantum effects? Have we learned nothing from modern browsers already becoming de-facto poorly-specced and poorer-yet implemented JS-based operating systems / malware delivery vehicles?

afavour•26m ago
It’s a timing function.
slig•1h ago
I'm doing his latest course on whimsical animations. So. Freaking. Good.
madethemcry•1h ago
That gives me a quite literal flashback.

Back in the Macromedia Flash 5 days (25 years ago!), Robert Penner popularized the easing concept. I can't imagine the void we had before that. I clearly remember me starring at the formulas in ActionScript 1.0 (see [1]) without any chance of understanding them - but usage was clear, easy and fun!

Those formulas basically generated the required tweening numbers mathematical (comparable to the Bezier approach mentioned in the article). That's a much different concept to the linear interpolation described in the linked blog article where you pass in a static list of numbers. The more complex your curve the more numbers you need. That's when the author links to the external tool "Linear() Easing Generator" by Jake Archibald and Adam Argyle. It was a fresh and nice reading even though animations are less a topic for me then it was back with Flash.

Here an example of an easing function from the linked source file. The tween executing function would pass in time (t) and other parameters I can't name to calculate the resulting value continuously.

  Math.easeInOutBack = function (t, b, c, d, s) {
      if (s == undefined) s = 1.70158; 
      if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
      return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
  };
If you want to dig deeper, visit roberpenner's easing overview [2] with some resources. Surprisingly all of those links are still working.

[1] https://robertpenner.com/easing/penner_easing_as1.txt [2] https://robertpenner.com/easing/

jasonjmcghee•42m ago
I really wanted to change the easing curves. They are interactive, but not modifiable. If you're reading this @joshwcomeau - i would play with the curves if you made them modifiable lol
nine_k•39m ago
There is a modifiable curve after many fixed-shape examples. It's not easy to come up with something that feels realistic though!
_greim_•15m ago
Since the goal is to create an illusion of real physics, I wonder when they'll just cut to the chase and start using actual physics engines.

Reason I mention it is neither this nor bezier curves deal with the target changing mid-animation very well. CSS just starts over from the current position, which breaks the illusion. A physics engine would maintain the illusion, and could be simpler to specify:

    transition: physics(system=gravity, force=10, bounce=on, dampening=3)
    transition: physics(system=spring, force=5, bounce=off, dampening=5)

Affinity Studio now free

https://www.affinity.studio/get-affinity
668•dagmx•7h ago•511 comments

The ear does not do a Fourier transform

https://www.dissonances.blog/p/the-ear-does-not-do-a-fourier-transform
301•izhak•6h ago•102 comments

Why We're Never Using Wise Again – A Cautionary Tale from a Business Burned

https://shaun.nz/why-were-never-using-wise-again-a-cautionary-tale-from-a-business-burned/
29•jemmyw•33m ago•17 comments

Phone numbers for use in TV shows, films and creative works

https://www.acma.gov.au/phone-numbers-use-tv-shows-films-and-creative-works
28•nomilk•1h ago•13 comments

If a pilot ejects, what is the autopilot programmed to do? (2018)

https://aviation.stackexchange.com/questions/52862/if-a-pilot-ejects-what-is-the-autopilot-progra...
36•avestura•1h ago•36 comments

TruthWave – A platform for corporate whistleblowers

https://www.truthwave.com
82•mannuch•4h ago•32 comments

Springs and bounces in native CSS

https://www.joshwcomeau.com/animation/linear-timing-function/
93•feross•2d ago•17 comments

NPM flooded with malicious packages downloaded more than 86k times

https://arstechnica.com/security/2025/10/npm-flooded-with-malicious-packages-downloaded-more-than...
111•jnord•22h ago•56 comments

987654321 / 123456789

https://www.johndcook.com/blog/2025/10/26/987654321/
470•ColinWright•4d ago•80 comments

Minecraft HDL, an HDL for Redstone

https://github.com/itsfrank/MinecraftHDL
87•sleepingreset•4h ago•11 comments

Denmark reportedly withdraws Chat Control proposal following controversy

https://therecord.media/demark-reportedly-withdraws-chat-control-proposal
74•layer8•1h ago•5 comments

Lenses in Julia

https://juliaobjects.github.io/Accessors.jl/stable/lenses/
41•samuel2•4d ago•1 comments

Free software scares normal people

https://danieldelaney.net/normal/
399•cryptophreak•8h ago•272 comments

Show HN: I made a heatmap diff viewer for code reviews

https://0github.com
153•lawrencechen•8h ago•46 comments

Launch HN: Propolis (YC X25) – Browser agents that QA your web app autonomously

https://app.propolis.tech/#/launch
85•mpapazian•6h ago•24 comments

Show HN: Run a GitHub Actions step in a gVisor sandbox

https://github.com/geomys/sandboxed-step
41•FiloSottile•6d ago•0 comments

Learn Multiplatform Z80 Assembly Programming with Vampires

https://www.chibiakumas.com/z80/
49•surprisetalk•4d ago•4 comments

Israel demanded Google and Amazon use secret 'wink' to sidestep legal orders

https://www.theguardian.com/us-news/2025/oct/29/google-amazon-israel-contract-secret-code
552•skilled•1d ago•220 comments

Show HN: Meals You Love – AI-powered meal planning and grocery shopping

https://mealsyoulove.com
34•tylertreat•3d ago•20 comments

The Psychology of Portnoy: On the Making of Philip Roth's Groundbreaking Novel

https://lithub.com/the-psychology-of-portnoy-on-the-making-of-philip-roths-groundbreaking-novel/
5•lermontov•1w ago•0 comments

Show HN: ekoAcademic – Convert ArXiv papers to interactive podcasts

https://www.wadamczyk.io/projects/ekoacademic/index.html
27•wadamczyk•2h ago•6 comments

Zig's New Async I/O

https://andrewkelley.me/post/zig-new-async-io-text-version.html
216•todsacerdoti•1d ago•63 comments

Independently verifying Go's reproducible builds

https://www.agwa.name/blog/post/verifying_go_reproducible_builds
87•speckx•1d ago•3 comments

Jujutsu at Google [video]

https://www.youtube.com/watch?v=v9Ob5yPpC0A
111•Lanedo•10h ago•108 comments

Show HN: Ellipticc Drive – open-source cloud drive with E2E and PQ encryption

https://ellipticc.com
4•iliasabs•3h ago•2 comments

ZOZO's Contact Solver for physics-based simulations

https://github.com/st-tech/ppf-contact-solver
63•vintagedave•7h ago•32 comments

Show HN: In a single HTML file, an app to encourage my children to invest

https://roberdam.com/en/dinversiones.html
181•roberdam•12h ago•335 comments

I have released a 69.0MB version of Windows 7 x86

https://twitter.com/XenoPanther/status/1983477707968291075
137•rvnx•5h ago•65 comments

US declines to join more than 70 countries in signing UN cybercrime treaty

https://therecord.media/us-declines-signing-cybercrime-treaty?
295•pcaharrier•8h ago•184 comments

PlanetScale Offering $5 Databases

https://planetscale.com/blog/5-dollar-planetscale
100•ryanvogel•7h ago•43 comments