cb information 23 glöps
- general:
- level: user
- personal:
- first name: Charles
- last name: Boccato
- demo JavaScript The BIGintro by Punkfloyd [web] & !!M & Zuul [web]
- very pleasant demo!
- rulezadded on the 2012-07-01 15:57:05
- 1k JavaScript MATRAKA by Ribbon [web] & ate bit [web]
- JS 1k prods increasingly look like true complete demos nowadays
- rulezadded on the 2012-07-01 15:18:19
- demotool Windows JsExe by adinpsz [web]
- New version available! Main changes from v1.0.1 to v1.0.2 :
* Multirow PNG support. No limit on input file size anymore.
* Improved PNG optimization chain based on AdvanceCOMP, DeflOpt and a better use of PNGOUT/OptiPNG. PNG color format choice has been removed.
* UI slightly improved.
Once completed I’ll release the code of JsExe, hope people will do an OSX version.
Diije> This tool is demo-oriented and is unsuitable for websites. It produces files which are not compatible with IE or older browsers, do not meet web standards, and are too slow (decompression takes more time than network transmission). For common websites, you should use regular methods such as Closure Compiler and server-side compression. That’s why JsExe is a console application and I didn’t make a point of converting it to an online service. - isokadded on the 2012-06-17 19:27:13
- 512b JavaScript Micro Nova by Ribbon [web]
- You're right but the above script works with latests versions of FF & Chrome, and I'm not sure full cross-browser compatibility is a problem in the demoscene. Nobody complains when IE9 isn't supported :) Also we cannot be sure that the regexp hash will work with next versions of WebGL.
But OK, let's assume that we need uniqueness and cross browser compatibility :)
There is the x[6]+x[1] hash which makes collisions but without using non-unique function names we still have a gain of 4 bytes.
A better one : x[1]+x[7]+x[x.length-1]. No collide and it saves 15 bytes in Micro Nova.
I'm sure we can still find better hashes. - isokadded on the 2012-06-09 12:25:25
- 512b JavaScript Micro Nova by Ribbon [web]
- p01> That's funny, I was just looking into your demo !
As you might know already I think you can improve your function name optimizer. More specifically I searched a better pattern for function name replacing. Extracting two characters from the function name instead using a regexp seem to give better results. By using the following initializer I reduced your demo size from 512 bytes to 473 bytes !
Code:for(x in g=d.getContext('experimental-webgl')) g[x[0]+x[6]]=g[x];
Here is a fully functional version of your script :
Code:<canvas id=d width=999 height=470><script>for(x in g=d.getContext('experimental-webgl'))g[x[t=0]+x[6]]=g[x];with(g){for(p=cP(q=' p;void main(){');s=cS(t+35632);ce(s),aS(p,s))sS(s,t++?'attribute vec4'+q+'gl_Position=p;}':'uniform lowp float'+q+'lowp vec4 l=3.-gl_FragCoord/99.;gl_FragColor=cos(l*tan(l-p)+l/l.y*l.x);}');setInterval('g.dr(4,g.uniform1f(g.gf(p,"p"),t+=44),3)',vA(eV(bf(k=34962,cB())),2,5126,lo(p),ug(p),bD(k,new Float32Array([1,1,1,-3,-3,1]),k+82)))}</script>
- isokadded on the 2012-06-09 10:51:02
- 512b JavaScript Micro Nova by Ribbon [web]
- Well done p01! (once again)
ps: with about 200b for header+bootstrap,
sure PNG trick leaves little room to code :) - rulezadded on the 2012-05-30 09:28:24
- 4k JavaScript Cyboman 5 by The Planet Of Leather Moomins [web]
- Nice visuals, I like it!
You might find it interesting that I tested JsExe with your demo file, and it reduces its size from 4087 bytes to 3694 bytes (see http://pouet.net/topic.php?which=8770) - rulezadded on the 2012-05-23 13:34:26
- demotool Windows JsExe by adinpsz [web]
- JsExe is a demo-oriented JavaScript compressor. It takes as input a standalone JavaScript source file and produces an HTML source file which executes a JavaScript with the same behaviour as the input one. JsExe aims to produce the smallest HTML file, using the best combination of compression tricks, such as embedding JS code in a PNG image. In the default mode, here what it does more specifically :
- It takes an JS file as input parameter.
- If it helps, the JS file is optimized using an improved version of Google Closure Compiler (with no line break, better float formatting, etc).
- File byte order is reversed or not (depending on whether it improves final compression rate or not).
- It embeds the resulting file in a PNG image, choosing the best PNG format (RGB or gray).
- Then it uses the most efficient PNG optimizer tool (PNGOUT or another one).
- Then output PNG is stripped of CRC and IEND block.
- Finally the loader is appended to the output file. In the loader, V is the name of canvas element and C is the name of its 2D context. By reusing this variables in your JS code, you have an access to an existing canvas element and its 2D context and do not have to create new ones (it saves a few bytes).
For each step of the compression chain, you can force a choice by using the corresponding command line parameter. Please execute JsExe.exe for more details.
Some improvements still need to be made, for example multirow PNG support or customizable variable names. But feel free to give me any feedbacks : cb@adinpsz.org
Greetings to :
* Gasman, Daekin, p01 for their bright ideas !
* Wullon as usual,
* Google, Ken Silverman, Glenn Randers-Pehrson, Cosmin Truta for their tools. - isokadded on the 2012-05-23 13:18:23
account created on the 2012-01-29 17:53:54