Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:ns1="http://sozi.baierouge.fr" xmlns:xlink="http://www.w3.org/1999/xlink" width="210mm"
- height="297mm"
- xml:space="preserve" xmlns:z="http://debeissat.nicolas.free.fr/svg3d/svg3d.rng">
- <!--Include this library and remember to update the svg3d_parsing.js file-->
- <script type="text/ecmascript" xlink:href="svg3d/svg3d.js"></script>
- <script type="text/ecmascript" xlink:href="svg3d/svg3d_parsing.js"></script>
- <script type="text/ecmascript" xlink:href="svg3d/dom_utils.js"></script>
- <g id="anim_container"
- z:xOrigin="0"
- z:yOrigin="0"
- z:zRatio="1000"
- z:sortAlgo="none"
- z:rotationTime="60"
- onload="init(this);">
- <path
- d="M 460.2203,600.93365 248.25964,263.59573 C 248.63437,272.77915 249.10289,281.86852 249.66521,290.86388 250.03994,298.54799 250.32105,306.70032 250.50856,315.32088 250.88328,323.75461 251.07069,331.251 251.07079,337.81007 L 251.07079,600.93365 203.28125,600.93365 203.28125,204.84271 265.68876,204.84271 479.89835,544.42955 C 479.33579,535.24653 478.77356,526.06345 478.21166,516.88029 477.83651,509.00916 477.4617,500.48202 477.0872,491.29883 476.71206,481.92845 476.52465,473.02649 476.52497,464.59291 L 476.52497,204.84271 524.87674,204.84271 524.87674,600.93365 460.2203,600.93365"
- id="path_n"
- >
- <z:translation x="364.0790100097656" y="402.88818359375"/>
- <z:rotation id="rot" incRotY="0.5"/>
- <z:translation x="-364.0790100097656" y="-402.88818359375"/>
- </path>
- </g>
- <script
- xlink:href="http://code.createjs.com/easeljs-0.7.0.min.js"
- id="easeljs" />
- <script
- xlink:href="http://code.createjs.com/tweenjs-0.5.0.min.js"
- id="tweenjs" />
- <script id="rotate">
- var v = document.getElementById("rot"); //Get z:rotation tag element
- var numberSpins = 3.5; //Set number of spins
- //Setting object with variables to tween.
- //deg will be the current angle value, finalDeg the final value (both in degrees)
- degrees = {deg: 0, finalDeg: numberSpins*360};
- createjs.Tween.get( degrees, { loop: false } ) //apply tweening of degrees object
- .wait(1800)
- .to( { deg: degrees.finalDeg }, 3000, createjs.Ease.quadInOut ) //Here we set the variable to tween within the object (deg), the final value (finalDeg, the duration and the easing function
- .call(function(){createjs.Ticker.removeEventListener('tick',update)}); //Once we finish spinning, remove listener
- //Then set the update function to be called for each tick
- var update = function(){
- var rad = degrees.deg*Math.PI/180; //Transform the current angle to radians
- v.setAttribute("rotY",rad); //Setting the rotation attribute to be read by transform()
- transform(); //Apply rotation with the values we've set on z:rotation tag element
- }
- createjs.Ticker.setFPS( 60 ); //Just creates a ticker. See TweenJs Documentation
- createjs.Ticker.addEventListener( 'tick', update ); //For each tick execute the update function
- </script>
- </svg>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement