73 comments

[ 0.19 ms ] story [ 1376 ms ] thread
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.
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.
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?
The webbrowser that render it.
The manufacturer of the LCD that displayed it.
Thomas Edison for inventing togglable lights.
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...

    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.
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)
(comment deleted)
THIS IS REALLY TRIGGERING. BE WARNED

EPILEPSY WARNING

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
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.
Can everyone leave the light on for just a second, please?

This is pretty fun haha

"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.
Everyone shut up a minute I'm trying to flicker some Morse code.
SAVE YOUR EYES, a bit:

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

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.
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.
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.
(comment deleted)
Techno music is missing in the background
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)
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.
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.
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 love this.

This is a fantastic use of websockets

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.

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.
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.