[ Launch: boating scene 02 ] 5790298 by ptvans
[ Launch: boating scene 02 ] 5790225 by enjalot
[ Launch: sin waves ] 5790206 by ptvans
See Previous Inlet [ Gist ]
-
-
Save ptvans/5790298 to your computer and use it in GitHub Desktop.
boating scene 02
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"editor_editor":{"coffee":false,"vim":false,"emacs":false,"width":600,"height":300,"hide":false},"description":"boating scene 02","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"inlet.svg":{"default":true,"vim":false,"emacs":false,"fontSize":12},"scene.svg":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":true,"loop":true,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var svg2 = d3.select("svg"); | |
//loop types pingpong or period | |
tributary.loop_type = "period"; | |
tributary.duration = 1070; | |
var bounceY = 10; | |
var glasses = -4; | |
tributary.run = function(g,t) { | |
svg2.select("#splash") | |
.attr("opacity", t) | |
svg2.select("#dad") | |
.attr("transform", "translate(" + [0, t * -bounceY] + ")") | |
svg2.select("#beard") | |
.attr("transform", "translate(" + [0, t * -bounceY/2] + ")") | |
svg2.select("#glasses") | |
.attr("transform", "rotate(" + [t * glasses, 659, 296] + ") translate(" + [0, t * -bounceY] + ") ") | |
svg2.select("#wave3") | |
.attr("transform", "translate(" + [0, t * -2 * -bounceY] + ")") | |
svg2.select("#boat") | |
.attr("transform", "translate(" + [0, t * -bounceY] + ")") | |
svg2.select("#antenna") | |
.attr("transform", "rotate(" + [-t * 4, 245, 539] + ")") | |
svg2.select("#boat-accents") | |
.attr("transform", "translate(" + [0, t * -bounceY/2] + ")") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment