5 ms·
If you think that's cool, look at Daeken's Magister: http://demoseen.com/windowpane/magister.png.html http://demoseen.com/windowpane/magister.png.html A PNG th
by greyfade 14y ago
If you think that's cool, look at Daeken's Magister: http://demoseen.com/windowpane/magister.png.html http://demoseen.com/windowpane/magister.png.html
A PNG that's interpreted as HTML and loads itself as compressed JavaScript!
- denysonique 14y agoAnother one is Matraka: http://www.p01.org/releases/MATRAKA/matraka.png.html http://www.p01.org/releases/MATRAKA/matraka.png.html
- daeken 14y agoMatraka is seriously worth a watch. All 2d canvas, and it actually has music in a 1k. What's funny is that p01 is the reason I got into web demo development, and he's actually using the png technique I came up with. Makes me proud to be a hacker. Edit: It also won a much-deserved first place in the DemoJS 1k compo.
- StavrosK 14y agoWait, is it using the image data as code to evaluate? My mind is too blown to appreciate this. EDIT: Oh, okay. It's not a valid PNG. That would have been all sorts of incredible. Still great, though.
- tlack 14y agoI wrote up a little explanation of how it works here https://gist.github.com/3039247 https://gist.github.com/3039247
- StavrosK 14y agoVery interesting, thanks! By the way, the for loop seems to be irrelevant to the invocation, (1,eval) just returns eval. (1,console.log)("hi") looks like it should work, except it raises an error. (1,2)+3 returns 5, however, and (1,console.log) returns the log function.
- skrebbel 14y agoit's a performance thing. i forgot the details, but if you change the `(1,eval)` to `eval`, it's all much slower. something with the scope of the code that's being eval'ed, if i recall correctly.
- tlack 14y ago(1,eval)('2*2') evaluates in the global context, so it may be slower I would think. Here's a really long and insanely detailed post about this odd feature: http://perfectionkills.com/global-eval-what-are-the-options/ http://perfectionkills.com/global-eval-what-are-the-options/
- daeken 14y agoNote: Chrome or Firefox with WebGL required. I also wrote an article on how I got this down to 1kb, http://daeken.com/superpacking-js-demos http://daeken.com/superpacking-js-demos , and just released a new demo based on the same techniques (747 bytes): http://demoseen.com/windowpane/nufl0wer.png.html http://demoseen.com/windowpane/nufl0wer.png.html
- jack-r-abbit 14y agoHoly Fuck.... that looked really cool as it brought my whole system to a dead stop. Took forever to recover enough to close the tab. :/
- redthrowaway 14y agoReally? I see no slowdown whatsoever. What are you running?
- jack-r-abbit 14y agoIt didn't die this last time so I must have just had a perfect storm of activity right at that moment.
- ingenium 14y agoYeah it locks up Chrome for me, pressing Ctrl+w closed the tab after about 10 seconds. Chrome 20 on Ubuntu 12.04 x86_64. Core 2 Duo with Intel graphics.
- mediocregopher 14y agoIt did fine for me on Chrome 20, Arch 64bit. Also a dual core, but nVidia graphics. Maybe the intel graphics drivers are being weird?
- ophis 14y agoworks fine on Win7 32bit + opera 12
- 14y ago
- dmauro 14y agoTrying to right click and save page as in Chrome crashes OS 10.7.4 for me. Pretty cool stuff.
- alpb 14y agototally displays binary on iOS Safari.
- shawndrost 14y agoWATCH IT. This file hard-froze my machine (osx/chrome) and I now have to rebuild my dev environment.
- zalew 14y agofroze browser for a minute, alerted of unresponsive script and printed some binary