Skip to content

Instantly share code, notes, and snippets.

@zeffii
Created January 17, 2014 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeffii/8471953 to your computer and use it in GitHub Desktop.
Save zeffii/8471953 to your computer and use it in GitHub Desktop.
cf_iannix_anim4

[ Launch: cf_iannix_anim4 ] 8471953 by zeffii
[ Launch: cf_iannix_anim3 ] 8465013 by zeffii
[ Launch: cf_iannix_anim2 ] 8464962 by zeffii
[ Launch: cf_iannix_anim ] 8454089 by zeffii
[ Launch: cf_iannix_anim ] 8446918 by zeffii
[ Launch: coffee_wavespec ] 8443425 by zeffii
[ Launch: coffee_templatefux ] 8385449 by zeffii
[ Launch: boomstick_motion_wcolor_coffee ] 6399870 by zeffii
[ Launch: boomstick_motion_wcolor_coffee ] 6382272 by zeffii
[ Launch: boomstick_motion_wcolor_coffee ] 6382237 by zeffii
[ Launch: boomstick_motion_wcolor_coffee ] 6379220 by zeffii
[ Launch: boomstick_motion_wcolor ] 6376715 by zeffii
[ Launch: boomstick_motion2 ] 6365156 by zeffii
[ Launch: boomstick_motion ] 6364686 by zeffii
[ Launch: boomstick ] 6364584 by zeffii
[ Launch: zeffii default ] 6364028 by zeffii
[ Launch: zeffii default ] 5033869 by zeffii

{"description":"cf_iannix_anim4","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"style.css":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"data2.csv":{"default":true,"vim":false,"emacs":false,"fontSize":12},"util.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"injet.coffee":{"default":true,"vim":false,"emacs":false,"fontSize":12},"inlet.coffee":{"default":true,"vim":false,"emacs":false,"fontSize":12},"utils.coffee":{"default":true,"vim":false,"emacs":false,"fontSize":12},"details.ssv":{"default":true,"vim":false,"emacs":false,"fontSize":12},"details.txt":{"default":true,"vim":false,"emacs":false,"fontSize":12},"details.tsv":{"default":true,"vim":false,"emacs":false,"fontSize":12},"spec.tsv":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":true,"loop":true,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/nbdtI5o.gif"}
# config
tributary.loop_type = "pingpong"
tributary.duration = 18000
arm_radius = tributary.anim(-160,-63)
num_arms = 44
data = d3.range(num_arms)
line_length = tributary.anim(73,108)
bass_pos = tributary.anim(0,720)
# helper functions
get_pos = (i) ->
rpos = i/num_arms * 2*Math.PI
[Math.cos(rpos)*arm_radius, -Math.sin(rpos)*arm_radius]
get_rot = (i, bass_pos) ->
crot = i / num_arms
crot * 360 * 3.6 + bass_pos
# d3 stuff
svg = d3.select("svg")
svg.append("rect").attr({width:"100%", height:"100%", fill: '#E2E2E2'})
style_one =
fill: '#C5C5C5',
stroke: '#686868'
'stroke-width': 1
group1 = svg.append('g')
.classed('group1', true)
.attr
transform: 'translate(' + [394, 342] + ')'
lines = group1.selectAll("line")
.classed("freqbar", true)
.data(data).enter()
lines.append("line")
.attr
x1: 0
y1: 0
x2: line_length
y2: 0
transform: (d,i) ->
bass_pos = bass_pos + 250.3012
"translate(" + get_pos(i) + ")" +
"rotate(" + get_rot(i, bass_pos) + ")"
.style
stroke: '#CC1313'
'stroke-width': -0.209
.cm-s-elegant.CodeMirror { background: #1e2426; color: #696969; }
.cm-s-elegant div.CodeMirror-selected {background: #064968 !important;} /* 33322B*/
.cm-s-elegant span.cm-variable { color:#22EFFF; }
.cm-s-elegant span.cm-variable-2 { color: #FFCCB4; }
.cm-s-elegant span.cm-variable-3 { color: white; }
.cm-s-elegant span.cm-string { color: Chartreuse; }
.cm-s-elegant span.cm-string-2 {color: Chartreuse;}
.cm-s-elegant span.cm-def {color: #FFCCB4; opacity: 1.0}
.cm-s-elegant span.cm-bracket { color: #EBEFE7; }
.cm-s-elegant pre { color:#FFF; }
.cm-s-elegant span.cm-qualifier { color:#C0C0C0; }
.cm-s-elegant span.cm-comment { color: #AFB4B4;}
.cm-s-elegant span.cm-property {color: #FDA676;}
.cm-s-elegant span.cm-number { color: #FF92EE;}
.cm-s-elegant span.cm-keyword { color: #FFFF18; }
.cm-s-elegant .CodeMirror-cursor { border-left: 1px solid white !important; }
.cm-s-elegant .CodeMirror-gutters {background: #505050;}
.cm-s-elegant .CodeMirror-linenumber {color: #D3D3D3;}
#panel{
width: 550px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment