A Pen by Chris Gannon on CodePen.
Created
April 23, 2019 17:15
-
-
Save netmin-net/632ee9c14f5735e944a72b453edcbc37 to your computer and use it in GitHub Desktop.
Amoeba Loader
This file contains hidden or 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
<div id="animationWindow"> | |
</div> |
This file contains hidden or 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 select = function(s) { | |
return document.querySelector(s); | |
}, | |
selectAll = function(s) { | |
return document.querySelectorAll(s); | |
}, | |
animationWindow = select('#animationWindow'), | |
animData = { | |
wrapper: animationWindow, | |
animType: 'svg', | |
loop: true, | |
prerender: true, | |
autoplay: true, | |
path: 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/35984/heart_creature.json', | |
rendererSettings: { | |
//context: canvasContext, // the canvas context | |
//scaleMode: 'noScale', | |
//clearCanvas: false, | |
//progressiveLoad: false, // Boolean, only svg renderer, loads dom elements when needed. Might speed up initialization for large number of elements. | |
//hideOnTransparent: true //Boolean, only svg renderer, hides elements when opacity reaches 0 (defaults to true) | |
} | |
}, anim; | |
anim = bodymovin.loadAnimation(animData); | |
anim.addEventListener('DOMLoaded', onDOMLoaded); | |
anim.setSpeed(1); | |
function onDOMLoaded(e){ | |
anim.addEventListener('complete', function(){}); | |
} | |
//ScrubBodymovinTimeline(anim) |
This file contains hidden or 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
<script src="https://cdnjs.cloudflare.com/ajax/libs/bodymovin/4.10.1/bodymovin.min.js"></script> | |
<script src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/35984/ScrubBodymovinTimeline.min.js"></script> |
This file contains hidden or 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
body { | |
background-color: #4FBC92; | |
overflow: hidden; | |
text-align: center; | |
} | |
body, | |
html { | |
height: 100%; | |
width: 100%; | |
margin: 0; | |
padding: 0; | |
} | |
#animationWindow { | |
width: 100%; | |
height: 100%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment