From 04537ed34d443d0610b77420d1dbef64bc05fbfa Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 22 Nov 2014 23:19:12 -0500 Subject: fix atan2 --- js/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/util.js b/js/util.js index 7bb1c78..1a1a0fe 100644 --- a/js/util.js +++ b/js/util.js @@ -30,7 +30,7 @@ function tan(n){ return Math.tan(n) } function acos(n){ return Math.cos(n) } function asin(n){ return Math.sin(n) } function atan(n){ return Math.atan(n) } -function atan2(n){ return Math.atan2(n) } +function atan2(a,b){ return Math.atan2(a,b) } function sec(n){ return 1/cos(n) } function csc(n){ return 1/sin(n) } function cot(n){ return 1/tan(n) } -- cgit v1.2.3-70-g09d2 From 0f1d81276a528bc35ec1b0662d984280745b2ae4 Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 26 Nov 2014 19:45:35 -0500 Subject: hiding tutorial --- shader-combo.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shader-combo.html b/shader-combo.html index 54f4329..d2147a5 100644 --- a/shader-combo.html +++ b/shader-combo.html @@ -30,7 +30,7 @@ a { color: #00f; } .ui-sortable-helper { cursor: -webkit-grabbing !important; } #commands { top:40px;right:20px; width:190px;height:calc(95% - 230px); } -#tutorial { top:40px;right:30px; width:290px;height:360px; display: block;} +#tutorial { top:40px;right:30px; width:290px;height:360px; display: none;} .iframe { position: absolute; box-shadow:5px 5px 10px rgba(0,0,0,0.3); background:rgba(255,255,255,0.8); display: none; cursor: -webkit-grab; } .iframe iframe {width: 100%;height:100%;margin:0;padding:0;border:0;} .iframe.dragging iframe { pointer-events: none; } -- cgit v1.2.3-70-g09d2 From 29b84b37752ee80eac025fe53dcdc8de2bc9ff73 Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 26 Nov 2014 23:08:21 -0500 Subject: jsonp support, possibly.. --- cgi-bin/proxy | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cgi-bin/proxy b/cgi-bin/proxy index 9c2ca3d..801e0f2 100755 --- a/cgi-bin/proxy +++ b/cgi-bin/proxy @@ -2,6 +2,7 @@ from os import environ as env import urllib.request +import json import sys def error(): @@ -9,18 +10,25 @@ def error(): print() print("HELLO!") -def proxy(url,ext): +def proxy(url,ext,callback): req = urllib.request.urlopen(url) print("Content-type: image/" + ext) print() sys.stdout.flush() - sys.stdout.buffer.write( req.read() ) + if callback: + sys.stdout.buffer.write( callback + "('" ) + sys.stdout.buffer.write( json.dump({ data: req.read() }) + sys.stdout.buffer.write( callback + "')" ) + else: + sys.stdout.buffer.write( req.read() ) -path = env['QUERY_STRING'] +qs = env['QUERY_STRING'].split('&callback=') +path = qs[0] +callback = qs[1] ext = path[-3:].lower() if path[0:4] == "http" and ext in ("gif","jpg","png","peg"): - proxy(path,ext) + proxy(path,ext,callback) else: error() -- cgit v1.2.3-70-g09d2 From 0c55852f1be83cc727b7c9c1560ccddd064f15ce Mon Sep 17 00:00:00 2001 From: Jules Date: Wed, 26 Nov 2014 23:44:46 -0500 Subject: make proxy a generic jsonp proxy --- cgi-bin/proxy | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/cgi-bin/proxy b/cgi-bin/proxy index 801e0f2..df208a0 100755 --- a/cgi-bin/proxy +++ b/cgi-bin/proxy @@ -2,6 +2,7 @@ from os import environ as env import urllib.request +import base64 import json import sys @@ -12,19 +13,24 @@ def error(): def proxy(url,ext,callback): req = urllib.request.urlopen(url) - print("Content-type: image/" + ext) - print() - sys.stdout.flush() - if callback: - sys.stdout.buffer.write( callback + "('" ) - sys.stdout.buffer.write( json.dump({ data: req.read() }) - sys.stdout.buffer.write( callback + "')" ) + if callback != "": + print("Content-type: text/plain") + print() + sys.stdout.flush() + sys.stdout.buffer.write( bytes( callback + "(btoa(" + json.dumps( "".join(map(chr, base64.b64encode( req.read() )))) + "))" , 'utf-8')) else: - sys.stdout.buffer.write( req.read() ) + print("Content-type: image/" + ext) + print() + sys.stdout.flush() + sys.stdout.buffer.write( req.read() ) qs = env['QUERY_STRING'].split('&callback=') +if len(qs) == 2: + callback = qs[1] +else: + callback = '' path = qs[0] -callback = qs[1] + ext = path[-3:].lower() if path[0:4] == "http" and ext in ("gif","jpg","png","peg"): -- cgit v1.2.3-70-g09d2 From 89258b8979943f56e73adc134fabf5e54cbd3a26 Mon Sep 17 00:00:00 2001 From: Jules Date: Wed, 26 Nov 2014 23:57:03 -0500 Subject: dont btoa --- cgi-bin/proxy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cgi-bin/proxy b/cgi-bin/proxy index df208a0..5e3539c 100755 --- a/cgi-bin/proxy +++ b/cgi-bin/proxy @@ -17,7 +17,7 @@ def proxy(url,ext,callback): print("Content-type: text/plain") print() sys.stdout.flush() - sys.stdout.buffer.write( bytes( callback + "(btoa(" + json.dumps( "".join(map(chr, base64.b64encode( req.read() )))) + "))" , 'utf-8')) + sys.stdout.buffer.write( bytes( callback + "(" + json.dumps( "".join(map(chr, base64.b64encode( req.read() )))) + ")" , 'utf-8')) else: print("Content-type: image/" + ext) print() -- cgit v1.2.3-70-g09d2 From c3919ec218c78d9a101fd772cbcec8318affa09e Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 1 Dec 2014 07:25:30 -0500 Subject: linkin to colorcode stuff --- index.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.html b/index.html index 5d51485..931d239 100644 --- a/index.html +++ b/index.html @@ -48,6 +48,10 @@ h1 { font-size: 26px; font-weight: normal } +

colorcodes

+ + +

etc..

-- cgit v1.2.3-70-g09d2 From a36d9d57760c1b65a611316fc41a549e7882d791 Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 3 Dec 2014 22:14:58 -0500 Subject: index --- index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 931d239..0ded485 100644 --- a/index.html +++ b/index.html @@ -51,13 +51,14 @@ h1 { font-size: 26px; font-weight: normal }

colorcodes

+

etc..

... - + -- cgit v1.2.3-70-g09d2 From bf3ba2a13ed3e97f1caabfcd04762a6a8ed5db8c Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 16 Dec 2014 04:13:12 -0500 Subject: easing functions --- js/util.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/js/util.js b/js/util.js index 911e44b..f76fc8e 100644 --- a/js/util.js +++ b/js/util.js @@ -114,3 +114,32 @@ function weave(a){ reverse(aa[1]).forEach(function(el){ b.push(el) }) return b } + +// easing functions +function circular (t) { return Math.sqrt( 1 - ( --t * t ) ) } +function quadratic (t) { return t * ( 2 - t ) } +function back (t) { + var b = 4; + return ( t = t - 1 ) * t * ( ( b + 1 ) * t + b ) + 1; +} +function bounce (t) { + if (t >= 1) return 1; + if ( ( t /= 1 ) < ( 1 / 2.75 ) ) { + return 7.5625 * t * t; + } else if ( t < ( 2 / 2.75 ) ) { + return 7.5625 * ( t -= ( 1.5 / 2.75 ) ) * t + 0.75; + } else if ( t < ( 2.5 / 2.75 ) ) { + return 7.5625 * ( t -= ( 2.25 / 2.75 ) ) * t + 0.9375; + } else { + return 7.5625 * ( t -= ( 2.625 / 2.75 ) ) * t + 0.984375; + } +} +function elastic (t) { + var f = 0.22, + e = 0.4; + + if ( t === 0 ) { return 0; } + if ( t == 1 ) { return 1; } + + return ( e * Math.pow( 2, - 10 * t ) * Math.sin( ( t - f / 4 ) * ( 2 * Math.PI ) / f ) + 1 ); +} -- cgit v1.2.3-70-g09d2 From 249d8265ef8ef28ff884574d314657c35e5dec81 Mon Sep 17 00:00:00 2001 From: Jules Date: Sun, 18 Jan 2015 03:51:36 -0500 Subject: link to xdcc --- index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.html b/index.html index 0ded485..94a11ce 100644 --- a/index.html +++ b/index.html @@ -52,6 +52,7 @@ h1 { font-size: 26px; font-weight: normal } +

etc..

-- cgit v1.2.3-70-g09d2