8 ms·
Show HN: Boing
- tdeck 11mo agoI'm slightly ashamed of how many times I boinged this. Great work!
- satvikpendem 11mo agoVery fun and nostalgic. The head of the boinger doesn't seem to exactly follow the cursor/finger however, at least on mobile, it always arcs.
- gregsadetsky 11mo agoAre you seeing the small dotted lines when pulling very far? It's meant to show the applied tension
- satvikpendem 11mo agoI see it now, I was using the Dark Reader extension which covered it up, looks good now.
- prodigycorp 11mo agoi love this. it reminds me of simpler times when we’d have iphone apps/games that would explore a single mechanic and implement it really well.
- ethmarks 11mo agoI noticed that the boing sound gets deeper and lower with smaller-magnitude boings. Is the boing audio generated procedurally/realistically in response to the physics of the boing, or is just playing a premade boing sound effect that's dynamically pitch shifted?
- junon 11mo agoThe original is pretty low, it appears to be sped up. Check the network panel.
- catapart 11mo agofantasitic
- junon 11mo agoLove this. Had to cheat, naturally. setInterval(()=>{const canvas=document.getElementById('canvas');const startX=266;const startY=198;const rect=canvas.getBoundingClientRect();const startClientX=rect.left+startX;const startClientY=rect.top+startY;let endClientX,endClientY,distance;do{endClientX=Math.random()*window.innerWidth;endClientY=Math.random()*window.innerHeight;const dx=endClientX-startClientX;const dy=endClientY-startClientY;distance=Math.sqrt(dx*dx+dy*dy)}while(distance<25);const dispatchMouseEvent=(type,target,clientX,clientY)=>{const event=new MouseEvent(type,{view:window,bubbles:true,cancelable:true,clientX:clientX,clientY:clientY,screenX:clientX+window.screenX,screenY:clientY+window.screenY,buttons:type==='mouseup'?0:1,button:0});target.dispatchEvent(event)};dispatchMouseEvent('mousedown',canvas,startClientX,startClientY);setTimeout(()=>{dispatchMouseEvent('mousemove',window,endClientX,endClientY);setTimeout(()=>{dispatchMouseEvent('mouseup',window,endClientX,endClientY)},1);},1);},1);
- jesse__ 11mo agotake my upvote. That's hilarious
- ngkw 11mo agoI love this.
- BowBun 11mo agoBoingBoingBoingBoingBoing
- blensor 11mo agoI don't think you need to move the mouse, you just need to click slightly offcenter while still bein inside the ball.
- junon 11mo agoI was looking at the source and it appeared there was special handling on the mousemove event. I also had to introduce timeouts, otherwise it wouldn't work (not entirely sure why). So was being safer since I didn't want this to become a time sink :D
- 11mo ago
- cr125rider 11mo agoOh random Flash apps, how I miss you
- victorbuilds 11mo agoRecreated a kids version on Codorex: https://codorex.com/shared/Ko4qJfnIKEjxDwqN2NAGueqWxYJFiz1F https://codorex.com/shared/Ko4qJfnIKEjxDwqN2NAGueqWxYJFiz1F
- supareya 11mo ago[dead]
- modeless 11mo agoI would love to see an accurately simulated version of this, à la https://www.engine-sim.parts/ https://www.engine-sim.parts/
- karanveer 11mo agoso satisfying.
- ____tom____ 11mo agoThere seems to be a minor bug. When I switch tabs and come back, sometimes the spring is moving. Some times a small amount, and other times it appears to be streched to the max, and extending off the top and bottom of the screen, until it calms down. Safari, Mac.
- mg 11mo agoI just wanted to write about a similar observation when using it in FireFox on Linux: When wiggle the spring, keep the mouse inside the white area until it is at rest, press CTRL+u to see the source code, move the mouse to close the source code tab and close it - for some magical reason the spring is moving again for a little bit.
- gregsadetsky 11mo agoYes, good sleuthing, that was one of the last remaining things I wanted to fix before launching. Just fixed, should be live soon.
- qwertytyyuu 11mo agoAs a phone user, I hate you, I hate how good this is. That counter is just mocking me.
- bitcrshr 11mo agoI needed this. Thank you.
- johnwheeler 11mo agoMost excellent.
- TheAceOfHearts 11mo agoAny consideration on sharing the unminified code? I was a bit curious to read through the code and it seems like such a shame to keep it obfuscated. From a quick perusal, it seems like the bulk of the code comes from howler.js (a sound library), and the core functionality is conveniently implemented below the mobile template.
- sixtyj 11mo agoOnline unminifier doesn’t work? E.g. https://www.unminify2.com/ https://www.unminify2.com/
- coffeecoders 11mo ago[flagged]
- lionkor 11mo agoIf they wanted an AI answer, surely they would have asked AI
- gregsadetsky 11mo agoOf course! https://github.com/gregsadetsky/boing https://github.com/gregsadetsky/boing
- mmabbq 11mo agoTurns out I was curious too, so I tried to de-minify it myself. Now I get to see how close I was. https://pastebin.com/FKyz20LG https://pastebin.com/FKyz20LG
- jesse__ 11mo agoboingboingboing
- thenthenthen 11mo agoCan we add accelerometer support? :D
- gregsadetsky 11mo agoon iOS at least, that requires an additional permission, and it would take some work to get the feeling right on both iOS and Android but I agree - I have some other mono-site-ideas like these in mind, and I think that the accelerator could be very fun. thanks for the suggestion!
- Quizzical4230 11mo agoLove this! It's highly addictive. (No guilt)
- dfex 11mo agoFinally! Time to recreate the classic: https://www.youtube.com/shorts/pTgJaJYHIAs https://www.youtube.com/shorts/pTgJaJYHIAs
- mavamaarten 11mo agoHeh. I expected it to be this one https://youtube.com/shorts/ocvBI_vtJwA https://youtube.com/shorts/ocvBI_vtJwA
- mhall 11mo agoOr this https://youtu.be/lQ6jZgMaZk4 https://youtu.be/lQ6jZgMaZk4
- 29athrowaway 11mo agoI noticed that the sound changes depending on how you interact with it. Neat
- rezmason 11mo agoThere goes my evening.
- abhinavsns 11mo agoThere seems to be a bug. If I catch it mid boing, the sound doesn't stop.
- gregsadetsky 11mo agovery good observation! just fixed and pushed
- sam-cop-vimes 11mo agoI wasn't hearing the sound initially so I thought it wasn't working in Firefox. Put the sound all the way up and boinged again. Made me jump out of my seat. Hilarious :-)
- HelloUsername 11mo agoI have no sound on ff ios, volume 100%
- gregsadetsky 11mo agoMake sure to unmute your device - either using the physical mute rocker on older iPhones, or by disabling Silent Mode (tap the bell in the Control Center)
- HelloUsername 11mo agoThat already was the case; no sound
- gregsadetsky 11mo agoJust downloaded Firefox on iOS and tested it and sound works here - can you check this other site please: https://learningsynths.ableton.com/ https://learningsynths.ableton.com/ ? There will also be no sound there if your phone is in Silence mode. However if Learning Synths works but not mine, then something else is happening. Thanks!
- HelloUsername 11mo ago"Your browser does not support this site. Please try using a recent version of Chrome, Firefox, Safari, Edge, or Opera." Probably because I have Lockdown mode enabled, and/or NextDNS
- gregsadetsky 11mo ago
- cons0le 11mo agoFinally something I actually want to pay for!! Give us a premium tier with exclusive boingers plz
- structuredPizza 11mo agoA16z is already working on the ipo
- gnarlouse 11mo agoIs this physics based audio?
- zer0tonin 11mo agoI don't think so
- gregsadetsky 11mo agoIt's not, unfortunately. I'd love to find a synthesized version of a boing sound. Perhaps some folks with modular experience could chime in?
- gnarlouse 11mo agoMy best offering is the engine sim which may or may not have a lib. https://github.com/ange-yaghi/engine-sim https://github.com/ange-yaghi/engine-sim If nothing else, it’s a brilliant, novel oddity.
- deleted 11mo ago[deleted]
- aetherspawn 11mo agoThe sound is not physics based, the boing sound keeps going if you grab the head, likewise sometimes the sound ends before the vibration finishes.
- gregsadetsky 11mo agoWell spotted! I'd love a synthesized version - if anyone has pointers.
- pierrec 11mo agoHaving done a fair amount of audio physical modeling, I'll just say a synthesized version that's both fast and realistic would be possible but difficult. The difficulty is at least "it would make an impressive presentation at DAFx [1]", though I might be underestimating it, and it's more "you could make it your master's thesis at CCRMA [2]" Ideal springs are a common, simple element in this field, but this kind of spring is very much not that. You're probably better off improving the sample-based version by fading out the audio when necessary and using different samples based on the way it's triggered. If you have "ultra-dry" samples (maybe taken with a contact mic), you can add a convolution effect with a well-chosen impulse response, this will allow you to sharply cut off or adjust the audio and still have a natural-sounding tail. [1] https://www.dafx.de/ https://www.dafx.de/ [2] https://ccrma.stanford.edu/ https://ccrma.stanford.edu/
- gregsadetsky 11mo agoI'm extremely grateful for this. My most deeply held secret is that I wish I could do this for a living - digitally modeling weird/beautiful objects/instruments and work on that forever haha. (And maybe make pedals out of them, I don't know) If you don't mind humoring me (I'm quite the novice in this field), if I automated the recording of "all" possible positions for a spring (say I had a motor positioned in a way that would let me pull the spring in any polar direction), would that make modeling potentially easier? There might be a "train an AI, here's 1000 recordings" angle, but I'm not necessarily interested in/asking about that. Just strictly for modeling, would it help the R&D phase to have a lot of high sample rate recordings? Thanks a lot! P.S. Also, if you have a good intro to DSP class/book, I'd love to hear it. I know about a few, but a recc is always appreciated
- OuterVale 11mo agoThis is the natural thing to make with this tool: https://youtube.com/watch?v=5VGLPP70Xtw https://youtube.com/watch?v=5VGLPP70Xtw
- ramnik10 11mo agoI liked it, would love to code it
- coffeecoders 11mo agoFunny thing: this feels "realistic" because it’s not perfect physics. A perfectly simulated Hooke's law spring actually looks fake and too stiff. But if you let the animation wobble a bit more and slow down the damping, our brain reads it as weight and squishiness. It’s basically controlled sloppiness.
- iamflimflam1 11mo agoSame is true in a lot of old platformer games. Real physics feels horrible.
- faeyanpiraat 11mo agoYeah, I really like the low gravity during my dreams
- dataflow 11mo ago> this feels "realistic" because it’s not perfect physics. A perfectly simulated Hooke's law spring Confused. Perfect physics means perfectly simulating reality, not perfectly simulating an unreal idealized formula. Are you saying Hooke's law doesn't feel realistic or are you saying a simulator for a realistic spring doesn't feel realistic?
- luanmuniz 11mo agoIn reality, nothing is perfect. Materials are never 100% one material. Rustness is imperfection, the weight and material of the ball, and the place it's attached are also consideration points, how firmly it is attached, and with which material. A "perfect" simulation of the spring itself would have to consider all these variables, and they almost never do.
- zamadatix 11mo agoAnd even if you somehow included "everything" with the "perfect" equations, you'll end up with a lot of stuff which does not have a good closed form solution anyways and good luck getting that running (e.g. the dynamics around the air resistance/sound generation) via approximations both accurate enough that it looks better than "faking it" and fast enough that it's actually usable interactively. This leads to what GP was saying: many just cut things off at "Hooke's law simulates a spring, so I'll use that, but the rest is a bit too much to fit so I won't do it" but "Hooke's law simulates a spring but adding a bit of not-physics based fluff approximates all the rest" actually gives far superior results even though it doesn't only use perfect physics equations as the former did.
- doppelgunner 11mo ago[dead]
- nopurpose 11mo agoHow many before you stopped? I am at 37.
- arbol 11mo ago230
- ku1ik 11mo ago103. Was curious if there’s any prize for hitting 100 :)
- arbol 11mo agoSame, I thought it might be like cookie clicker
- ProllyInfamous 11mo ago>prize for hitting 100 :) https://www.decisionproblem.com/paperclips/ https://www.decisionproblem.com/paperclips/ You can hate me and/or close the window at any point, friend...
- texuf 11mo agoTIL I don't know how to “unmute” my device anymore. My new-ish iPhone doesn't have a physical switch on the side and I can’t find it in the settings in the pulldown menu.
- gregsadetsky 11mo agoOh good point sorry. If you open the Control Center (drag down from the top left, typically), there should be a bell icon..? That, or Settings -> Sounds & Haptics -> Silent Mode ?
- gmac 11mo agoI just got an iPhone 17, and presumably because it inherited its Control Centre configuration from the 13 it replaces (which had a physical switch) the silent mode toggle was not present. Tap and hold in an empty space to edit the controls and add it in.
- texuf 11mo agoThat was it! Theres a little Add a Control prompt at the bottom after the long press and I found the bell. Thank you. Huge oversight from the dev team, dang.
- akho 11mo agowhen haptics
- gregsadetsky 11mo agoI would love to, but iOS support doesn't seem possible - there's a trick [0] to make a hacky haptic vibration in javascript, but it doesn't work with the kinds of events here of drag&release. And (lame excuse, but) I don't have an Android phone to test the haptics to make sure they're semi realistic. This might have to wait for the native app versions ha. [0] https://progressier.com/pwa-capabilities/vibration-api https://progressier.com/pwa-capabilities/vibration-api
- jonplackett 11mo agoOh it needs a total boings by everyone counter!
- dmje 11mo agoTotal boing heatmap!
- gregsadetsky 11mo agoI considered it for a minute, but then I remembered https://xkcd.com/1138/ https://xkcd.com/1138/ .. ha. but let me know if you have other thoughts about this
- dmje 11mo agoha :-)
- apgwoz 11mo agoHeatmap based on coordinates of the start of the boing!
- gregsadetsky 11mo agoahhhhhhhhhhhhhhhhhhh wow I'm dumb. working on it EDIT: done! deploying. wow ok that was a really good idea.
- dmje 11mo agoamazing <3
- gregsadetsky 11mo agoalright, I implemented a world boing counter :-) thanks for the great idea
- doubleorseven 11mo ago
- brcmthrowaway 11mo agoAI?
- gregsadetsky 11mo agoYes! I've been toying with this project idea for a few ~months, trying out most of the models out there. The physics and the look of the spring would come out quite crazy looking, so I put it on the back burner. This is not an ad, there's no affiliate link... but the physics & drawing code were one shot by the recently released Gemini 3 Pro. It was pretty incredible to see. Additional tweaks & boing counter server by Claude Code.
- deleted 11mo ago[deleted]
- deleted 11mo ago[deleted]
- brcmthrowaway 11mo agoSad
- gregsadetsky 11mo agoSorry to disappoint you!
- egeres 11mo agoAmazing to see software like this without sign-in requirements or paid subscriptions!
- codeulike 11mo agoIt doesnt boing rotationally, only in a straight line. Like the spring isn't really there. If I bend it right round to one side so the spring is curved I expect it to bounce round to the other side.
- gregsadetsky 11mo agoyou are right - just improved this and I think it looks a lot better (deploying now) thanks!
- codeulike 11mo agoThe dream of agile exemplified
- mythz 11mo agoThis takes me back a few years when the first of my Uni friends had a baby, they spoiled him with so many toys that their lounge room was like an obstacle field where you had to be careful where to step, but despite all his toys the baby spent all his time while I was there playing with the door spring. There's something therapeutic about door springs, that you just have to stop and play with it.
- brcmthrowaway 11mo agoJesus christ, who has a baby during university
- defrost 11mo ago* I recall when the first of my primary school friends had a baby ... some years after we all left primary school. * I recall when Cheryl had her first baby while at University. I also recall when she had her second. ~ https://en.wikipedia.org/wiki/Cheryl_Praeger https://en.wikipedia.org/wiki/Cheryl_Praeger Maybe work on making more insightful and considered comments: https://news.ycombinator.com/threads?id=brcmthrowaway https://news.ycombinator.com/threads?id=brcmthrowaway
- naich 11mo agoI had to stop at 100 or I would have been there all day.
- reactordev 11mo agoThat’s got to be one of the most satisfying things ever. The real device was a darling invention and this is a faithful recreation of the experience of being in time out in the 80s.
- alex440440 11mo agoIf you were Elon you would claim it's an early alpha of a world simulator that in a year will be able to perfectly predict weather and stock market.
- e1gen-v 11mo agoIf you manage to push it all the way down directly in the middle it boings forever
- xpe 11mo agoAnyone want to commission an AI to make a sequel called Boing or Krill where you have to choose between boinging the spring or playing a game of snake (drawn as a line of krill)?
- analogears 11mo agoThis reminds me why simple single-purpose web toys used to be so satisfying. No account, no onboarding, no "upgrade to pro" - just a thing that does one thing well. The world counter is a nice touch without being gamified into oblivion..
- uriee 11mo agoMan, slow MO + plot the vibration freq on the axis.
- gregsadetsky 11mo agoadded slomo mode! it's great, thank you!
- fHr 11mo agoabsolute peak, love it
- gnarlouse 11mo ago@gregasadetsky: you should make it social… you know, like, just because. Like I want to be able to send my sister my latest “Boing,” and see what she thinks of my technique.
- gregsadetsky 11mo agohow would that work haha. "send last boing"? and it's a permalink.... and it repeats the boing??? I'm... considering it! :-)
- gnarlouse 11mo agoThink of it like the Bro App from “Silicon Valley”, just with the charm of a doorstop. ;D
- foobarbecue 11mo agoIt's broken! Now when I boing it, it goes totally wild instead of behaving as expected. Did somebody hack it?
- gregsadetsky 11mo agothere are very specific starting points that do go wild - but it should mostly not show you those (and I should add some protection for it) try reloading again?
- foobarbecue 11mo agoAll points are going crazy...
- foobarbecue 11mo agohttps://github.com/gregsadetsky/boing/issues/1 https://github.com/gregsadetsky/boing/issues/1
- gregsadetsky 11mo agofixed!
- Ylpertnodi 11mo agoCould you include a dark mode? Great fun.
- gregsadetsky 11mo agojust did! thank you
- ianberdin 11mo agoChallenge accepted: https://boing.playcode.io https://boing.playcode.io. three.js, audio generating.
- ianberdin 11mo agoSource code: https://playcode.io/boing https://playcode.io/boing
- mrlonglong 11mo agoGoing to give this to a cat to play with, see if he enjoys it
- cassettelabs 11mo agoI was hypnotized for 10 minutes. This is amazing. The .technology tld is hilarious. Reminds me of technologia memes
- badmonster 11mo ago[flagged]
- oyaa52 11mo agoThis is so comforting I love it!!!