Skip to content

Instantly share code, notes, and snippets.

@enjalot
Created November 24, 2012 03:12
Show Gist options
  • Save enjalot/4138216 to your computer and use it in GitHub Desktop.
Save enjalot/4138216 to your computer and use it in GitHub Desktop.
Another Inlet
{"description":"Another Inlet","endpoint":"","display":"svg","public":true,"require":[],"tab":"edit","display_percent":0.7,"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}
var svg = d3.select("svg");
var fontsize = 61
var font_selections = ["Inder",
"Titillium Web",
"Open Sans Condensed",
"Montserrat Subrayada"]
for (i in d3.range(4)){
svg.append("text")
.attr({x: 38, y: 155+(50*i)})
.text("aerhoaihaer")
.style("font-family", font_selections[i])
.style("font-size", fontsize);
}
var arc = d3.svg.arc()
.innerRadius(157)
.outerRadius(20)
.startAngle(0)
.endAngle(105 * (Math.PI/180));
svg.append("path")
.attr("d", arc)
.attr("transform", "translate(100,500) rotate(-10)");
var fontsize2 = 10;
svg.append("text")
.attr({x: 135, y: 508})
.attr("id", "mytext")
.text("monkies")
.attr("fill", "#aeaeae")
.style("font-family", font_selections[i])
.style("font-size", fontsize2)
.attr("transform", function() { return "translate(" + arc.centroid + ")"; });
WebFontConfig = {
google: { families: [ 'Inder::latin', 'Titillium+Web::latin', 'Open+Sans+Condensed:300:latin', 'Montserrat+Subrayada::latin' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment