Changeset - 7c14520fba29
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 12 years ago 2013-06-16 18:43:15
drewp@bigasterisk.com
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
2 files changed with 20 insertions and 6 deletions:
0 comments (0 inline, 0 general)
light9/subserver/chases.coffee
Show inline comments
 
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()
 

	
 
# this sort of works to stop clicks in <input> from following the
 
# submaster hyperlink, but it may make certain clicks act wrong
light9/subserver/chases.jade
Show inline comments
 
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")
 

	
 
    #status
 
      
 
    script(src="jquery-1.7.2.min.js")
0 comments (0 inline, 0 general)