Skip to content

Instantly share code, notes, and snippets.

@roundrobin
Created February 16, 2013 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roundrobin/4964955 to your computer and use it in GitHub Desktop.
Save roundrobin/4964955 to your computer and use it in GitHub Desktop.
Tributary inlet
{"description":"Tributary inlet","endpoint":"","display":"div","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":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,"thumbnail":"http://i.imgur.com/wh3MoIK.png"}
var b = g;
console.log(g)
var opacity = 0.9;
var font_size = 40;
var padding = 22;
var left = 120;
var top = 120;
b.append('div')
.text('about')
.style({
background: '#19A9AF',
color: '#ffffff',
display: 'inline-block',
'padding': (padding)+'px',
'-webkit-transform': 'rotateY('+(-4)+'deg)rotateX('+(-3)+'deg)',
'position':'absolute',
'font-family':'Futura',
'font-size': (font_size)+'px',
'left': (left+20)+'px',
'top': (top+20)+'px',
'opacity' : opacity,
'width' : '225px',
});
b.append('div')
.text('projects')
.style({
background: '#2B797C',
color: '#ffffff',
display: 'inline-block',
'padding': (padding)+'px',
'-webkit-transform': 'rotateY('+(-4)+'deg)rotateX('+(-3)+'deg)',
'position':'absolute',
'font-family':'Futura',
'font-size': (font_size)+'px',
'left': (left+10)+'px',
'top': (top+10)+'px',
'opacity' : opacity,
'width' : '225px',
});
b.append('div')
.text('Portfolio')
.style({
background: '#364D4E',
color: '#ffffff',
display: 'inline-block',
'padding': (padding)+'px',
'-webkit-transform': 'rotateY('+(-4)+'deg)rotateX('+(-3)+'deg)',
'position':'absolute',
'font-family':'Futura',
'font-size': (font_size)+'px',
'left': (left)+'px',
'top': (top)+'px',
'opacity' : opacity,
'width' : '225px',
});
var svg = b.append('svg')
.style({
background: 'none',
color: 'none',
display: 'inline-block',
'padding': (10)+'px',
'width' : '125px',
'height' : '125px',
'position':'absolute',
'font-family':'Futura',
'font-size': (10)+'px',
'left': (96)+'px',
'top': (top + 13)+'px',
'opacity' : 1
});
var circle = svg.append("circle")
.attr({
r: 14,
cx: 14,
cy: 14,
fill: "#FFFFFF",
'fill-opacity': 1
});
var tooglestart = 1;
function inf_loop(elem){
var r = 13;
if(tooglestart == -1){
r = 16;
}
circle.transition()
.duration(1500)
.ease('sin')
.attr("r",r)
.each("end", function() {
tooglestart = -1*tooglestart;
inf_loop(d3.select(this));
});
}
circle.call(inf_loop);
var r = 14;
var circle2 = svg.append("circle")
.attr({
r: r,
cx: r,
cy: r,
fill: "#B65631",
'fill-opacity': 1
})
var tooglestart2 = 1;
function inf_loop2(elem){
var r = 10;
if(tooglestart2 == -1){
r = 12;
}
circle2.transition()
.duration(1500)
.ease('cos')
.attr("r",r)
.each("end", function() {
console.log('r',r)
tooglestart2 = -1*tooglestart2;
inf_loop2(d3.select(this));
});
}
circle2.call(inf_loop2);
var f =2;
svg.append('text')
.text("+")
.attr({
fill: "#FFFFFF",
x : r- 5,
y: r+7,
"font-size": 19,
"font-family": "Arial",
"text-anchor": "start",
'font-weight' : 'bold'
});
b.append('div')
.text(' Lorem ipsum dolor sit amet, consectetur adipisicing elit.')
.style({
background: '#91A2A3',
color: '#ffffff',
display: 'inline-block',
'width' : 467+'px',
'height' : 80+'px',
'padding': (padding)+'px',
'position':'absolute',
'font-family':'Baskerville',
'font-size': (14)+'px',
'line-height': (1.4)+'em',
'left': (left+10)+'px',
'top': (top+280)+'px',
'opacity' : opacity
});
b.append('div')
.text(' Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.')
.style({
background: '#364D4E',
color: '#ffffff',
display: 'inline-block',
'width' : 467+'px',
'height' : 181+'px',
'padding': (padding)+'px',
'position':'absolute',
'font-family':'Baskerville',
'font-size': (14)+'px',
'line-height': (1.4)+'em',
'left': (left)+'px',
'top': (top+106)+'px',
'opacity' : opacity
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment