Skip to content

Instantly share code, notes, and snippets.

@ptvans
Created August 13, 2014 17:15
Show Gist options
  • Save ptvans/4248ed076b623413386c to your computer and use it in GitHub Desktop.
Save ptvans/4248ed076b623413386c to your computer and use it in GitHub Desktop.
circle-stroke

[ Launch: circle-stroke ] 4248ed076b623413386c by ptvans
[ Launch: circle-stroke ] acdd9a7cc8cc06212d66 by ptvans
[ Launch: circle-stroke (tiny blobshapes) ] 5ed8ae0f1dc48c54e091 by poezn
[ Launch: circle-stroke ] 3d22bc502536651d39e5 by poezn
[ Launch: circle-stroke ] 180acd7175f2f5cb65d7 by ptvans
[ Launch: circle-stroke ] 692fe2d4a8af898c1c65 by ptvans
[ Launch: circle-stroke ] a6df5c97bbbcbb8e1685 by ptvans
[ Launch: circle-stroke ] ef1e761134829c8a7d7a by ptvans
[ Launch: test ] 4653053 by enjalot
[ Launch: test ] 4652017 by enjalot
[ Launch: test ] 4582399 by enjalot

{"description":"circle-stroke","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},"style.css":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"play":false,"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,"tab":"edit","display_percent":0.7,"thumbnail":"http://i.imgur.com/Fh6zC3A.gif","fullscreen":false,"ajax-caching":true}
var svg = d3.select("svg")
var numPerRow = 23;
var qScale = d3.scale.quantile()
.domain([0, 1])
.range(["-03", "-02", "-01"])
var scaleSize = d3.scale.sqrt()
.domain([0, 1])
.range([0, 10])
svg.selectAll("circle.circle-01")
.data(_.map(d3.range(633), function(d) { return Math.random() }))
.enter().append("circle")
.attr({
r: function(d, i) { return scaleSize(d) },
cx: function(d, i) {
return 20 + (i % numPerRow) * 25
},
cy: function(d, i) {
return 20 + Math.floor(i / numPerRow) * 25
},
"class": function(d) { return "circle" + qScale(d) }
});
/*color*/
circle {
-webkit-animation: colorshift ease-in-out infinite alternate; /* Chrome, Safari, Opera */
}
/* Chrome, Safari, Opera */
@-webkit-keyframes colorshift {
from {
fill-opacity: 1;
stroke-dasharray: 3;
stroke-dashoffset: 10;
transform: rotate(0deg);;}
to {
fill-opacity: 1.0;
stroke-dasharray: 3;
stroke-dashoffset: 16;
transform: rotate(360deg);}
}
circle {
stroke-width: 1.5;
stroke: #b368c9;
stroke-dasharray: 3;
}
.circle-01 {
fill: rgba(284,10,29,0.5);
-webkit-animation-delay: 300ms;
-webkit-animation-duration: 3000ms;
}
.circle-02 {
fill: rgba(173,10,145,0.5);
-webkit-animation-delay: 400ms;
-webkit-animation-duration: 3000ms;
}
.circle-03 {
fill: rgba(69,10,159,0.5);
-webkit-animation-delay: 500ms;
-webkit-animation-duration: 3000ms;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment