Skip to content

Instantly share code, notes, and snippets.

@bollig
Created August 18, 2013 04:09
Show Gist options
  • Save bollig/6259853 to your computer and use it in GitHub Desktop.
Save bollig/6259853 to your computer and use it in GitHub Desktop.
warning.
{"description":"warning.","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"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}},"fullscreen":false,"play":true,"loop":false,"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/IYv8YFD.png"}
var svg = d3.select("svg");
var stroke = 28;
var maxstroke = 200;
var diff = stroke;
svg.append("rect")
.style({
fill: "#CC3838",
stroke: "#000000"
})
tributary.run = function(g,t) {
stroke = (0.5 + 0.25*Math.sin(1*t) + 0.50*Math.cos(2*t)+-0.5*Math.exp(-Math.cos(Math.random(0,50)*t)))/2 * maxstroke
var x = 230 - stroke/2;
var y = 183 - stroke/2;
var width = 300 + stroke;
svg.select("rect")
.attr({
x: x,
y: y,
width: width,
height: width,
"stroke-width": stroke
})
}
/*
svg.append("rect")
.attr({
x: x + diff/2,
y: y - 40 + diff/2,
width: width,
height: 20,
fill: "#fff"
})
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment