Skip to content

Instantly share code, notes, and snippets.

@Y4suyuki
Last active February 5, 2016 11:15
Show Gist options
  • Save Y4suyuki/86141ea2bc44326565c6 to your computer and use it in GitHub Desktop.
Save Y4suyuki/86141ea2bc44326565c6 to your computer and use it in GitHub Desktop.
Logo
{"description":"Logo","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},"inlet.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/Z4ghHZY.png","fullscreen":false,"ajax-caching":true}
text {
font-size: 30px;
font-family: Helvetica
}
circle {
fill: none;
stroke-width: 3px;
}
var svg = d3.select("svg")
logo = svg.append('g')
.attr('class', 'logo')
.attr('transform', 'translate(' + 50 + ',' + 50 + ') rotate(' + 0 + ')')
logo.append("text")
.text("A")
.attr({
x: 0,
y: 0,
fill: "#3BA360"
})
.attr('transform', 'translate(' + -10 + ',' + 6 + ')')
.transition()
.attr('transform', 'translate(' + -10 + ',' + -4 + ')')
.duration(1000)
.each('end', function(){
add_text(logo, last, 10, -4)
})
logo.append("text")
.text("Y")
.attr({
x: 0,
y: 0,
fill: "#3BA360"
})
.attr('transform', 'translate(' + -10 + ',' + 14 + ')')
.transition()
.attr('transform', 'translate(' + -10 + ',' + 24 + ')')
.duration(1000)
.each('end', function() {
add_text(logo, first, 10, 24);
})
var last = 'geishi';
var first = '4suyuki';
function add_text(logo, txt, x, y) {
return logo.append('text')
.text(txt)
.attr({
x: x,
y: y,
fill: "#3BA360"
})
}
/*
logo.append("circle")
.attr({
cx: 0,
cy: 0,
r: 20,
stroke: "#3BA360"
})
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment