summaryrefslogtreecommitdiff
path: root/game.html.coffee
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2014-09-28 10:37:19 (GMT)
committerMichele Bini <michele.bini@gmail.com>2014-09-28 10:37:19 (GMT)
commit4d0d08112f023a5779178399bb589988c2bcb939 (patch)
treed07426bbce5cd9b929f13d6ccac4c3246ef0f360 /game.html.coffee
parentff9e0b87c97454fcf685b50c033add5806bd12e2 (diff)
Mix work
Diffstat (limited to 'game.html.coffee')
-rw-r--r--game.html.coffee22
1 files changed, 13 insertions, 9 deletions
diff --git a/game.html.coffee b/game.html.coffee
index bfb197b..548d797 100644
--- a/game.html.coffee
+++ b/game.html.coffee
@@ -16,16 +16,19 @@
htmlcup[x] = htmlcup.compileTag x for x in [ "svg", "rect", "g", "ellipse", "polygon", "line", "image", "defs", "linearGradient", "stop", "use" ]
-title = "V the Vaquita"
+title = "Vilma the Vaquita"
fs = require 'fs'
-datauri = (t, x)-> "data:#{x};base64,#{new Buffer(x).toString("base64")}"
+datauri = (t, x)-> "data:#{t};base64,#{new Buffer(fs.readFileSync(x)).toString("base64")}"
+datauripng = (x)-> datauri "image/png", x
+datauriicon = (x)-> datauri "image/x-icon", x
-icon = "vaquita.ico"
-icon = datauri("image/x-icon", fs.readFileSync(icon))
-pixyvaquita = "pixyvaquita.png"
-pixyvaquita = "data:image/png;base64," + (new Buffer(fs.readFileSync(pixyvaquita))).toString("base64")
+icon = datauriicon "vaquita.ico"
+pixyvaquita = datauripng "pixyvaquita_v2.png"
+frames =
+ _: pixyvaquita
+ twistleft: datauripng "pixyvaquita_v2_twistleft.png"
useSvg = true
@@ -164,13 +167,14 @@ genPage = ->
@stop offset:"50%", style:"stop-color:rgb(0,80,240);stop-opacity:1"
@stop offset:"75%", style:"stop-color:rgb(0,0,180);stop-opacity:1"
@stop offset:"100%", style:"stop-color:rgb(0,0,0);stop-opacity:1"
- @g id:"vaquita", ->
+ for k,v of frames
+ @g id:k, ->
@g transform:"translate(-18,-15)", ->
- @image width:"50", height:"30", "xlink:href":pixyvaquita
+ @image width:"50", height:"30", "xlink:href":v
@rect x:"0", y:"0", width:"960", height:"720", fill:"url(#grad1)"
@g transform:"scale(2)", ->
@g id:"sea", transform:"translate(240,180)", ->
- @use "xlink:href":"#vaquita"
+ @use "xlink:href":"#_"
else
@canvas width:"960", height:"720", ->
@div -> @a class:"support-vaquitas", target:"_blank", href:"index.html", "Learn about Vaquitas"