Live data from Hacker News

Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

p01.org

71–80 of 131 posts

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#71

The real version of this, which is actually 1021 bytes, is here: http://www.p01.org/MONOSPACE/monospace.htm . It uses the very clever trick of compressing the JavaScript code as the pixels of a PNG image (which uses Deflate internally), then including the page itself in an tag and decompressing the JS code from the resulting pixels. Unfortunately , the developer made a bit of a mistake when uploading this file: it ap…

Ah, I wondered why I was getting junk when I clicked that link, thank you for uploading (still falls over for me when I accidentally opened it using FF, but no harm done)

Hi, my bad. I forgot to set the Transfert Type to binary on my new laptop :p

Hope you enjoy MONOSPACE anyhow. I am pretty happy with how it turned out. I believe I managed to nudge a little the state of art of what type of camera work is possible in 1kb demos.

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#72
It's amusing to me that I saw this about 5 minutes after I received a pop up notice from Adobe advising me to uninstall Flash as it'll be EoL'd in a few months.

I appreciate they're entirely different beasts, but the Monospace demo here definitely IS creative.

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#73
post #67

Earlier quoted context omitted.

I sympathize with developers dealing with browser bugs, but a majority of "Chrome recommended" banners are not. For many cases they are used as a cheap excuse not to care about or even deter non-Chrome browsers at all, even when they do work mostly or completely fine. Demos, in comparison, tend to have much narrower requirements due to various constraints (many D3D demos only worked with specific graphic cards at lea…

I agree but the last time the pitchforks went out on HN regarding this was for a game, so not very different from demos. The issue I'm personally dealing with is for a game revolving around a feature that's only working properly in Chrome (see sibling comment for link to bugzilla). I've tried solutions for mitigating it but since I'm just one guy I've basically given up for now and have resorted to a warning for Fire…

I guess that was shapez.io [1]? The situation around WebRender is pretty unfortunate, as AFAIK it is blocked by the compatibility issue in macOS. I have played it in Windows Firefox just fine though.

Anyway, I think it's more about the wording: it's very fine that the developer hasn't tested much in other browsers (not every developer has resources to do so, sure), but saying a certain browser is required or recommended implies that the issue is something to do with that browser (which might or might not be the case). Shapez.io also doesn't support macOS in its standalone build, but the statement on that was more amicable and honest; I wish the developer did the same for non-Chrome browsers as well.

> In all honesty I don't see how it's different from only releasing a game on Xbox and not PlayStation.

Consoles generally have much different requirements (hardware, vendor integration etc.) than PC games. For me it's more like Steam vs. Epic Store which I found pretty frustrating as a gamer.

[1] https://news.ycombinator.com/item?id=24678720

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#76

Earlier quoted context omitted.

I'm not the author but I've done this before [1], so here's what I can quickly make up (EDIT: updated using informations gathered from p01's comment below): // c is a canvas created outside d = [ // 2 times audio frequencies used, I think 2280, 1280, 1520, c.width = 1920, // d[4] is not used, not sure why this stmt was stuffed into d // required to hide the PNG bootstrap; the bare minimum would be `0'`, probably this…

Thanks for the expansion and comments! On your project, I noticed the comments were about 5 times longer than the source code :) - so that makes sense how to work with it.

Hi there.

I do not use any minifier. I minify the code by hand, and typically prototype ideas and performance tests in normal non-minified code. Once the main idea and approach are settled, I minify the code by hand and keep an eye on the heatmap of the DEFLATE stream to match the 1024 bytes limit.

MONOSPACE took ~4months on an off to create, tallying ~60h of work. You know 2020 + trying to balance work & family, and remain sane these days.

As I said on my site, the Audio and Visuals feed each other to make the background noise based on each dot, and the camera shake based on the Audio. That way I keep the Audio & Visuals are perfectly in synch, for free ;)

For the X & Y camera shake, I use the values 0 and 64 from the Audio buffer. The 64 is because this is the maximum number of characters rendered by the Text writer which happens in the loop updating the Audio buffer. Using something lower than the 64th value would make the last characters of the Text shake in a different way than the rest.

-- P01, author of MONOSPACE,

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#78

This is similar (but much much better) to a demo I was making for JS1K a bunch of years back: http://mrspeaker.github.io/js1k16/ My "big idea" was to use the speech synthesis API (I still liked how I used it)... but I thought it was funny, because it felt like cheating to say "1K" when it relied on so many megabytes of APIs!

Does it count as megabytes when it's bog standard API ?

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#79

OK, this is really weird, but I closed the browser tab with the demo ca. 1 minute ago and can still hear the music. I'm on FF/Big Sur.

(someone should investigate this)

Indeed. Ultrasonic tracking ftw...

Re: Monospace: A JavaScript demo in 1021 bytes, winner of the demo competition

#80

This is similar (but much much better) to a demo I was making for JS1K a bunch of years back: http://mrspeaker.github.io/js1k16/ My "big idea" was to use the speech synthesis API (I still liked how I used it)... but I thought it was funny, because it felt like cheating to say "1K" when it relied on so many megabytes of APIs!

The speech synthesis sounds like it is panicking. Quite funny.
Post reply on HN