Mercurial > code > home > repos > light9
changeset 990:7c14520fba29
add some non-chase effects for dragging in. all drag curves are now called <sub>_env to avoid conflicts in the expr namespace
Ignore-this: 51eda766db229a14612edd0cf6e7ed4b
author | drewp@bigasterisk.com |
---|---|
date | Sun, 16 Jun 2013 18:43:15 +0000 |
parents | d91015a384fb |
children | fae6de480b0c |
files | light9/subserver/chases.coffee light9/subserver/chases.jade |
diffstat | 2 files changed, 20 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/light9/subserver/chases.coffee Sun Jun 16 18:42:41 2013 +0000 +++ b/light9/subserver/chases.coffee Sun Jun 16 18:43:15 2013 +0000 @@ -1,17 +1,26 @@ class Model constructor: -> @chases = ko.observable([]) + @moreExprs = [ + {label: "rainbow", expr: "hsv(t*1,1,1)"}, + {label: "pulserainbow", expr: "hsv(t*1,1,1)*nsin(t*2)"}, + {label: "stacrainbow", expr: "hsv(t*1,1,1)*(nsin(t*2)>.7)"}, + {label: "alternatergb", expr: "hsv(t*1,1,1, light='left')*nsin(t*3) + hsv(t*1,1,1,light='right')*(1-nsin(t*3))"}, + {label: "frontchase", expr: "chase(t, names=frontchase, ontime=.3, offset=-.11)"}, + {label: "bumpyhues", expr: "hsv(t*.5,.4,1)*notch(t*.01)"}, + ] subtermLink: (label, expr) => "http://chase?"+$.param({ subtermName: label - subtermExpr: expr - curve: label + subtermExpr: label + '_env(t) * ' + expr + curve: label + '_env' }) subtermExprs: (chase) => [ - 'LABEL(t) * chase(t, names=LABEL, ontime=0.5, offset=0.2)'.replace(/LABEL/g, chase.label) + 'chase(t, names=LABEL, ontime=0.5, offset=0.2)'.replace(/LABEL/g, chase.label) ] + model = new Model()
--- a/light9/subserver/chases.jade Sun Jun 16 18:42:41 2013 +0000 +++ b/light9/subserver/chases.jade Sun Jun 16 18:43:15 2013 +0000 @@ -1,16 +1,21 @@ doctype html html head - title chases + title effects link(rel='stylesheet', href='style.css') body - h1 Chases + h1 Effects + div(data-bind="foreach: moreExprs") + div.resource.chase + span(data-bind="text: label") + | + a.resource(data-bind="attr: {href: $root.subtermLink(label, expr)}, text: expr") + div(data-bind="foreach: chases") div.resource.chase | Chase a(data-bind="attr: {href: uri}, text: label") - h2 Subterms ul(data-bind="foreach: $parent.subtermExprs($data)") li: a.resource(data-bind="attr: {href: $root.subtermLink($parent.label, $data)}, text: $data")