Hacker News new | past | comments | ask | show | jobs | submit login
Proposal: An HTML Element for Spoilers (seirdy.one)
6 points by todsacerdoti on Nov 12, 2023 | hide | past | favorite | 2 comments



It's a shame this didn't get more traction. I've not thought a lot about using spoilers for images, so my comment is for text only...

My ideal version of the spoiler tag would allow the text to be toggled on/off. Sometimes you want to take a quick peek at a multi-line spoiler and toggle off when you think you've read enough.

TVTropes.org implements this very well on their pages. Just click on any folder to see it in action:

https://tvtropes.org/pmwiki/pmwiki.php/Franchise/MarvelCinem...

The following implementation is also nice. It covers the spoiler section with a nice bright text warning and feels like the kind of attributes a spoiler tag should have (ie; BG/FG color, maybe FX like fade in, etc). Click on [View Demo] to see it in action:

https://css-tricks.com/fade-in-spoiler-revealer/

It does lack the ability to toggle (on/off). I've been using this method on the few occasions I've needed a spoiler tag.


Below is a better link at TV Tropes that displays the spoiler tag right away (just scroll down just a little bit).

I started trying to find the spoiler tag being used in the link I previously provided and they were not easy to find. Quite frustrating...

https://tvtropes.org/pmwiki/pmwiki.php/AntiHero/MarvelCinema...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: