EMIIA.AI (NEURALMAN)
收藏资源简介:
<!DOCTYPE html><br> <!--<br> NOTES:<br> 1. All tokens are represented by '$' sign in the template.<br> 2. You can write your code only wherever mentioned.<br> 3. All occurrences of existing tokens will be replaced by their appropriate values.<br> 4. Blank lines will be removed automatically.<br> 5. Remove unnecessary comments before creating your template.<br> --><br> <html><br> <head><br> <meta charset="UTF-8"><br> <meta name="authoring-tool" content="Adobe_Animate_CC"><br> <title>man1</title><br> <!-- write your code here --><br> <script src="https://code.createjs.com/createjs-2015.11.26.min.js"></script><br> <script src="https://emiia.github.io/svg/man3.js"></script><br> <script><br> var canvas, stage, exportRoot, anim_container, dom_overlay_container, fnStartAnimation;<br> function init() {<br> canvas = document.getElementById("canvas");<br> anim_container = document.getElementById("animation_container");<br> dom_overlay_container = document.getElementById("dom_overlay_container");<br> var comp=AdobeAn.getComposition("CE752CCBB48F054A8D32F2E6A8EB7A08");<br> var lib=comp.getLibrary();<br> handleComplete({},comp);<br> }<br> function handleComplete(evt,comp) {<br> //This function is always called, irrespective of the content. You can use the variable "stage" after it is created in token create_stage.<br> var lib=comp.getLibrary();<br> var ss=comp.getSpriteSheet();<br> exportRoot = new lib.man1();<br> stage = new lib.Stage(canvas);<br> //Registers the "tick" event listener.<br> fnStartAnimation = function() {<br> stage.addChild(exportRoot);<br> createjs.Ticker.setFPS(lib.properties.fps);<br> createjs.Ticker.addEventListener("tick", stage);<br> }<br> //Code to support hidpi screens and responsive scaling.<br> function makeResponsive(isResp, respDim, isScale, scaleType) {<br> var lastW, lastH, lastS=1;<br> window.addEventListener('resize', resizeCanvas);<br> resizeCanvas();<br> function resizeCanvas() {<br> var w = lib.properties.width, h = lib.properties.height;<br> var iw = window.innerWidth, ih=window.innerHeight;<br> var pRatio = window.devicePixelRatio || 1, xRatio=iw/w, yRatio=ih/h, sRatio=0.5;<br> if(isResp) {<br> if((respDim=='width'&&lastW==iw) || (respDim=='height'&&lastH==ih)) {<br> sRatio = lastS;<br> }<br> else if(!isScale) {<br> if(iw<w || ih<h)<br> sRatio = Math.min(xRatio, yRatio);<br> }<br> else if(scaleType==1) {<br> sRatio = Math.min(xRatio, yRatio);<br> }<br> else if(scaleType==2) {<br> sRatio = Math.max(xRatio, yRatio);<br> }<br> }<br> canvas.width = w*pRatio*sRatio;<br> canvas.height = h*pRatio*sRatio;<br> canvas.style.width = dom_overlay_container.style.width = anim_container.style.width = w*sRatio+'px';<br> canvas.style.height = anim_container.style.height = dom_overlay_container.style.height = h*sRatio+'px';<br> stage.scaleX = pRatio*sRatio;<br> stage.scaleY = pRatio*sRatio;<br> lastW = iw; lastH = ih; lastS = sRatio;<br> stage.tickOnUpdate = false;<br> stage.update();<br> stage.tickOnUpdate = true;<br> }<br> }<br> makeResponsive(false,'both',false,1);<br> AdobeAn.compositionLoaded(lib.properties.id);<br> fnStartAnimation();<br> }<br> </script><br> <!-- write your code here --><br> </head><br> <body onload="init();" style="margin:0px;"><br> <div id="animation_container" style="background-color:rgba(); width: px; position: relative; margin: auto; align: center; height:0px"><br> <canvas id="canvas" width="" height="" style="position: absolute; display: block; background-color:rgba();"></canvas><br> <div id="dom_overlay_container" style="pointer-events:none; overflow:hidden; width:0px; height:0px; position: absolute; left: 0px; top: 0px; display: block;"><br> </div><br> </div><br> </body><br> </html>



