frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Tw-fade: pure CSS scroll-driven edge masking

https://pete.design/tw-fade
30•petekp•3d ago

Comments

petekp•3d ago
hey all, just released a plugin to scratch an itch. i'd been lazily adding linear gradients on the edges of scrollviews and animating them with JS based on scroll position. turns out you can do a lot better with pure CSS now by leveraging masking + the new CSS scroll animations API.

works in pretty much all browers excepting firefox which doesn't have CSS scroll animations yet, but the nightly version does, so it should be generally available soon.

demo site: https://pete.design/tw-fade

github: https://github.com/petekp/tw-fade

npmjs: https://www.npmjs.com/package/tw-fade

if you use it i'd love to hear how it goes and if you have any feedback.

jstanley•1h ago
FYI scrolling this page is slow as balls on my computer. Firefox on Ubuntu.

I don't know if this page is a demonstration of your plugin, I'm guessing yes but I can't see any masking going on, it seems to scroll just like a normal page but much more laggy.

EDIT: Oh I see in your comment now, it doesn't work in Firefox. My mistake.

rtrigoso•1h ago
This has a frame drop issue on Chrome Version 149.0.7827.156. It isn't close to smooth on my browser.
RyanOD•20m ago
I was wondering the same thing and I'm in Chrome. The "Horizontal" and "Vertical" sections don't seem to do anything, but maybe I'm just not understanding what I should be looking for?
NooneAtAll3•1h ago
arrow keys don't work, pgdown doesn't work
k33n•1h ago
pgdown works for me (firefox on linux)

arrow keys also seem to work fine but you have to click-to-focus first.

c-hendricks•13m ago
I don't think that would be an issue of this CSS, that's just normal `overflow: auto` behaviour.
Hugsbox•57m ago
This is extremely laggy on my computer. It may not be a top-end gaming supercomputer but it's no slouch either.
sheept•17m ago
It might be related to the liquid glass imitation in the color scheme picker
ptak•40m ago
Neat! I'd much rather just copy-paste the CSS from the site though, would never install something like this as a package.
maxjustus•19m ago
I also love the pure CSS parallax effect of the "tw-fade" title shadow using multiple spans with different styles that fade in and out based on scroll position. Very clever!
chrismorgan•14m ago
The fade affects scroll bars, which is quite unpleasant (and arguably catastrophic if you have two-dimensional scrolling). The traditional background-image technique avoided this by sitting inside the scroll area. I don’t think you can achieve that with mask, without an additional element. But I think it might be worth that extra element.

Zig's new bitCast semantics and LLVM back end improvements

https://ziglang.org/devlog/2026/#2026-06-25
112•kouosi•3h ago•29 comments

IBM debuts sub-1 nanometer chip technology

https://newsroom.ibm.com/2026-06-25-ibm-debuts-worlds-first-sub-1-nanometer-chip-technology
35•porridgeraisin•2h ago•14 comments

A Herculaneum scroll has been read for the first time

https://scrollprize.org/firstscroll
49•verditelabs•1h ago•11 comments

You can't unit test for taste

https://dev.karltryggvason.com/you-cant-unit-test-for-taste/
179•kalli•1d ago•68 comments

Show HN: I made Google Trends for Hacker News by indexing 18 years of comments

https://hackernewstrends.com
402•ytkimirti•3h ago•115 comments

Apple raises prices of MacBooks, iPads

https://www.reuters.com/world/asia-pacific/apple-raises-prices-macbooks-ipads-memory-costs-skyroc...
256•virgildotcodes•4h ago•465 comments

Besimple AI (YC P25) Is Hiring

https://www.ycombinator.com/companies/besimple-ai/jobs/yWfhhOR-strategic-projects-lead-audio-data
1•yzhong94•35m ago

Half-Life 2 in a Browser

https://hl2.slqnt.dev/
546•panza•11h ago•225 comments

Tw-fade: pure CSS scroll-driven edge masking

https://pete.design/tw-fade
30•petekp•3d ago•12 comments

Windows 10 quietly gets one more year of support and updates

https://www.neowin.net/news/windows-10-quietly-gets-one-more-year-of-support-and-updates/
55•bundie•1h ago•31 comments

Anthropic says Alibaba illicitly extracted Claude AI model capabilities

https://www.reuters.com/world/china/anthropic-says-alibaba-illicitly-extracted-claude-ai-model-ca...
700•htrp•21h ago•1135 comments

OS9Map

https://yllan.org/software/OS9Map/
28•LaSombra•2h ago•1 comments

Physicists Track and Trap the Elusive Neutrino

https://www.quantamagazine.org/how-physicists-track-and-trap-the-elusive-neutrino-20260624/
15•ibobev•2h ago•1 comments

Show HN: Turn native language audio into flashcards and shadowing practice

https://lingochunk.com/try
48•alder•6h ago•24 comments

The disappearance of Japan's animators

https://economist.com/interactive/1843/2026/06/19/the-strange-disappearance-of-japans-animators
58•andsoitis•4d ago•54 comments

Deno 2.9

https://deno.com/blog/v2.9
79•enz•1h ago•26 comments

LastPass notifies users of yet another data breach

https://9to5mac.com/2026/06/23/lastpass-notifies-users-of-yet-another-data-breach/
351•mooreds•7h ago•155 comments

Political bias in AI: Where the AI models stand

https://trakkr.ai/bias
26•mektrik•4h ago•74 comments

Ford AI hiccups push carmaker to rehire ‘gray beard’ inspectors

https://www.bloomberg.com/news/articles/2026-06-25/ford-has-been-rehiring-quality-inspectors-afte...
515•alanwreath•2h ago•256 comments

SoftBank 2026 AGM [pdf]

https://group.softbank/media/Project/sbg/sbg/pdf/ir/investors/shareholders/2026/shareholders-meet...
40•dmmalam•4h ago•10 comments

Show HN: MiniPCs.zip – Charting the Pareto frontier of Mini PCs

https://minipcs.zip
56•yathern•4d ago•25 comments

Cloudflare launched self-managed OAuth for all

https://blog.cloudflare.com/oauth-for-all/
306•terryds•15h ago•134 comments

Blogging can just be stating the obvious

https://blog.jim-nielsen.com/2026/blogging-stating-the-obvious/
391•Curiositry•17h ago•119 comments

Puzzling Success of Overparameterization: Lottery Tickets or Escape Dimensions?

https://infoscience.epfl.ch/entities/publication/9a49779b-f9f8-448d-b3d1-737c78455309
40•rbanffy•1d ago•8 comments

Medical students are using popular research tool to pump out misleading studies

https://www.science.org/content/article/medical-students-are-using-popular-research-tool-pump-out...
139•rndsignals•15h ago•77 comments

Bohemia Interactive: Cold War Assault Remastered Source Code on GitHub

https://github.com/BohemiaInteractive/CWR
171•dewey•2d ago•42 comments

Updated Xbox Console Prices

https://news.xbox.com/en-us/2026/06/25/xbox-console-price-update/
11•0xedb•36m ago•2 comments

European Commission lines up Amazon and Microsoft for cloud gatekeeper status

https://www.theregister.com/legal/2026/06/25/european-commission-lines-up-amazon-and-microsoft-fo...
13•Bender•1h ago•0 comments

Show HN: Secs-man, a secrets manager you can (not) rely on

https://github.com/Fran314/secrets-manager-rs
23•Fran314•5h ago•14 comments

Lianda and the Long March

https://blog.georeactor.com/books-06-26b
8•mapmeld•1d ago•0 comments