Skip to content

Instantly share code, notes, and snippets.

@roundrobin
Created August 13, 2012 06:01
Show Gist options
  • Save roundrobin/3337285 to your computer and use it in GitHub Desktop.
Save roundrobin/3337285 to your computer and use it in GitHub Desktop.
just another inlet to tributary
{"editor_editor":{"coffee":false,"vim":false,"emacs":false,"width":891,"height":528,"hide":true}}
d3.select('#display').style('background','black')
var p1 = [100,100];
var p2 = [200,200];
var p3 = [0,200];
var tX = 100;
var tY = 100;
var off = 2.76;
var col = d3.rgb("#276BAA");
var group = g.append('g')
for(var i=0; i < 48; i++){
group.append('path')
.attr("stroke",col.toString())
.attr("stroke-width",3.76)
.attr("fill",'none')
.attr('transform','translate(300,'+(100+(i*2))+')')
.attr("d","M"+(p1[0])+","+(p1[1]-(i*off))+" L"+(p2[0]+(i*off))+","+(p2[1])+" L"+(p3[0]-(i*off))+","+(p3[1])+"Z")
// .attr('transform','translate('+(tX+(i*2))+','+(tY + (i*5))+')')
// .attr("d","M"+p1[0]+","+(p1[1]*Math.cos(i/(-14)))+" L"+(p2[0]*Math.log(i))+","+p2[1]+" L"+(p3[0]*Math.sqrt(i*2))+","+(p3[1])+"Z")
col = col.brighter(0.1);
}
var col = d3.rgb("#AA9027");
g.selectAll('path').each(function(e,i){
var x = d3.select(this);
console.log(x,e,i);
x.transition().duration(3000).attr('stroke',col.toString())
.attr('transform','rotate('+(20*(i/25))+','+(Math.sin(i/42)*80)+','+(i*22)+')')
col = col.brighter(0.1);
});
group.attr('transform','translate(100,50)')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment