Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A Silly Usecase for WebSockets (strobe warning) (jakobmaier.at)
139 points by quintussss on Feb 24, 2022 | hide | past | favorite | 67 comments


PSA: Viewing strobing images has caused temporary (lasting hours) backlight issues on my 2021 Macbook Pro, in the past. Somehow, it causes the backlight to continue flickering for some time afterwards, even when looking at static images. It is barely perceptible, but quite noticeable at the edges of the screen - enough to be annoying.

I have no idea if this is a hardware issue with my specific unit, or a more widespread thing.


Are you sure it's your backlight and not your eyes? (Something like this: https://en.wikipedia.org/wiki/Motion_aftereffect)


One way to be sure is to film it and analyze the pixels before and after a strobe test.


I did this (well, I don't have any "before" footage, but I can assure you there was no flicker).

Video here: https://twitter.com/David3141593/status/1456399950976278532


I caught the flickering on camera (see my other reply). Furthermore setting the display to 60fps (as opposed to 120Hz "ProMotion" VRR) made the flickering go away, and it would come back when I switched back to 120Hz.


That still might be to your eyes. The relevant effects are:

1. effects from your eyes (from looking at the strobing image)

2. PWM brightness controls causing your recordings to look like they strobe

The site in the OP wasn't working, so I tried a demo site instead: https://www.da.vidbuchanan.co.uk/strobegate.html. I looked at the strobing image, closed the tab, and sure enough my monitor (IPS, 60hz) was showing some signs of flickering. It disappeared after a few minutes. However, I performed a second test where I opened the site and didn't look at it with my eyes. The strobe after effect did not show up. Even though I didn't look at the monitor, I verified afterwards that a strobe was shown by a phone video recording. I also did a slo-mo video recording of my monitor without any visible strobe effect, and there was visible strobing in the recording, probably from the shitty PWM. You should follow a similar procedure to rule out whether it's something with your eyes or not.


I've seen this on my phone's 120hz display too (S21 Ultra) and haven't yet determined the cause, but maybe it is related to strobing content. Will have to remember that the next time I notice it.


EPILEPSY WARNING. Extreme strobe upon opening OP link.

  while (true) { websocket.send(JSON.stringify({ action: 'plus' })); }
Really messed with my vision and crashed chrome. Fun experiment!


no crash with:

setInterval(() => { websocket.send(JSON.stringify({ action: 'plus' })); }, 0)


  setInterval( () => { if(state.textContent == 'on') {
    websocket.send(JSON.stringify({ action: 'plus' })); } }, 50)


Cool project. You may want to include an epilepsy warning to this. I don't suffer from it, but it definitely messed with my vision a bit.


Yes absolutely, this was not an issue when it was just me and some friends using it.


Threw together a couple PNG files. They look good against a 50% gray background. Perhaps a lighter gray for light_on, a darker gray light_off. Not as hard on the eyes.

https://imgur.com/m2uznrc

https://imgur.com/wSphM0b


I much prefer the original eye-watering version. The friendly colors stray from the spirit of an annoying prank.


I made this to learn more about websockets and because a friend thought it would be funny for some reason. Let me know what you think.


For some reason it is.


I appreciate the strobe warning! Not gonna open it so I have no idea what it is but congrats on whatever it is. Anyway have an up vote for the strobe warning


Here's a (static, that don't flash) screenshot: https://up.l3m.in/file/1645698692.png

edit: and here's a (very slow, 2s transition) gif of what it renders to: https://up.l3m.in/file/1645698812-slow-strobe.gif


Thanks!


Curiosity is such a wonderful trait.


It is a page with a schematic depiction of a floor lamp. "Click anywhere to turn the light on/off" is written below. When you click, the light turns on or off depending on the previous state, and background color changes accordingly between dark and light. The on/off state is the same for all visitors of the page, so, since this is on the front page of HN, it flickers quickly. Hence the strobe warning.


It's a webpage with a simple picture of a lamp and the text "40 people in the room, click anywhere to turn the light on/off". The page background alters between dark gray and white depending on whether the light is off and on. It's essentially a collective online light flickering exercise and it's about as strobe as you imagine that would be.


Though if you have a browser in dark mode it might only flicker between dark gray and slightly less dark gray.


"Blockchain will help mitigate the strobe issue" /s


It will only flicker once every 10 minutes, and the toggler will be the one winning the auction with the highest transaction fee.


Really nice!

Is reduced motion a good use case for this?

https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pref...


Everyone shut up a minute I'm trying to flicker some Morse code.


Seems to have been killed, there's just question marks everywhere there should be a dynamic value, and I can't interact with anything (Chrome for Android).

> ? in the room, click anywhere to turn the light ?

> click counter: ?


It's still running, with currently 393 Users and a total of 250000 Clicks. The organic User average seems to be around 50, so i think someone is trying to stress test the System.


How about having an off switch on one side and an on switch on the other, then we can fight it out by seeing how many goes for each?

Or, make in a flappy bird game? One up and one down button.


That's a good idea. Or you could have a grid of squares, with each person getting their own color when they click each one. Any of these ideas would work much better if you could prevent scripting of course.


SAVE YOUR EYES, a bit:

body.style.transition = `background-color 0.9s ease 0.1s`


Great suggestion, thank you.


Also, we live in a messed up world that one person can do something so stupid and get a thousand people to look at it.


We've lived in that world for at least a couple of decades, if limiting to “any one person”. Heck, a thousand is a rookie number: look at all the crap on youtube/tictok getting millions of views.

If you stretch the definition to “any one person with some money” we've been in that world a lot longer.


That's a great thing. That's one of the least messed up things about the world.


There's nothing stupid about this. It's fun.


The two are not mutually exclusive.


True, but I still don't think it's stupid. You could argue that it's pointless, but I'd still tend to disagree.


There is a company that is selling a LED Lamp that blinks at 40 Hz. They claim it can mitigate Alzheimer's.

This line of devices has become known as 'Gamma Flashers', lots of knockoffs today. From Gamma brain wave state.

There is some, small amount, of science to back this up.

So who is going to be the first person to put up a 40 Hz flashing website? With appropriate warnings about Photosensitive Epilepsy before showing the page.

https://pubmed.ncbi.nlm.nih.gov/30155285/

https://www.verywellhealth.com/photosensitive-epilepsy-sympt...


Didn't the Dutch ISP Xs4all have this in past where you could remote control the lamps of a Christmas tree in their office? That's a long time ago, before WebSockets or IoT existed. And the server, while being absolutely hammered, kept up.


Strobe warning in case someone might be susceptible to it. You got a chuckle out of me.


Hypothetically if someone suffers a seizure... who is responsible? The platform provider or users who switched the light on and off?


How about the individual who assumed the risk of visiting a strobing web page?


those who made the web stadards capable of doing _anything_ with the user's computing environment, let it be any useless/arbitrary, and those who forced this arbitrary code execution platform to be the same as the information browsing / catalogue system / document viewer platform what the web originally meant to be.

today users can not manage their bank account, enlist to classes, read newspapers online without the real fear of mining bitcoin for someone involuntarely, DDoS-ing goverment sites by hidden pixels, presenting unsolicited unrelated content to his audience on a presentation, and now, having sight damage...


The webbrowser that render it.


The manufacturer of the LCD that displayed it.


Thomas Edison for inventing togglable lights.


Might need more words on the page. Mine came up and it was a lamp and telling me to click with question marks.

No indication of how or why this has anything to do with websockets. :(

The lamp looks nice though.


    lamp:51 Uncaught DOMException: An attempt was made to use an object that is not, or is no longer, usable
FF97 on Ubuntu

ETA: I see it working now


Still broken. I think it's because it's overloaded and the websocket fails to connect, I'm getting a 504 Gateway Time-out.


Techno music is missing in the background


THIS IS REALLY TRIGGERING. BE WARNED

EPILEPSY WARNING


Not me in the console: `setInterval(() => {document.body.click()}, 20)`


Keeping peace on planet Earth is like keeping this lamp ON all the time — bumpy road, one click at the time.


I want to make a version of this that controls my neighbors smart light bulbs.


Can everyone leave the light on for just a second, please?

This is pretty fun haha


Reminds me of 'Someone keeps stealing my letters'


EPILEPSY WARNING


setInterval(function(){ document.getElementsByClassName("bdy")[0].click();}, 10 )


I love this.

This is a fantastic use of websockets


OP share source? I’m curious!


Source is viewable in the HTML:

view-source:https://www.jakobmaier.at/projects/lamp/


Perhaps we shouldn't post something that will cause harm to some people?


lol cool


[flagged]


You've been breaking the site guidelines repeatedly lately. We ban accounts that do that. If you'd please review https://news.ycombinator.com/newsguidelines.html and stick to the rules when posting here, we'd appreciate it. We've already had to ask you about this before.


How was "strobe warning" not enough warning for you? Just chill.




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

Search: