Browse Source

重命名源码

master
song 4 years ago
parent
commit
591f2c88e0
  1. 2
      gulpfile.js
  2. 98
      public/source-code.html
  3. 8
      public/source-code.js

2
gulpfile.js

@ -20,7 +20,7 @@ const script = function () {
const copy = function () { const copy = function () {
src('./public/index.html').pipe(dest('dist/')); src('./public/index.html').pipe(dest('dist/'));
src('./public/bird.js').pipe(dest('dist/')); src('./public/source-code.js').pipe(dest('dist/'));
src('./public/images/*').pipe(dest('dist/images')); src('./public/images/*').pipe(dest('dist/images'));
src('./public/libs/**/*').pipe(dest('dist/libs')); src('./public/libs/**/*').pipe(dest('dist/libs'));
src('./public/sounds/*').pipe(dest('dist/sounds')); src('./public/sounds/*').pipe(dest('dist/sounds'));

98
public/bird.html → public/source-code.html

@ -1,18 +1,18 @@
<!DOCTYPE html> <!DOCTYPE html>
<!-- <!--
NOTES: NOTES:
1. All tokens are represented by '$' sign in the template. 1. All tokens are represented by '$' sign in the template.
2. You can write your code only wherever mentioned. 2. You can write your code only wherever mentioned.
3. All occurrences of existing tokens will be replaced by their appropriate values. 3. All occurrences of existing tokens will be replaced by their appropriate values.
4. Blank lines will be removed automatically. 4. Blank lines will be removed automatically.
5. Remove unnecessary comments before creating your template. 5. Remove unnecessary comments before creating your template.
--> -->
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="authoring-tool" content="Adobe_Animate_CC"> <meta name="authoring-tool" content="Adobe_Animate_CC">
<title>bird</title> <title>source-code</title>
<!-- write your code here --> <!-- write your code here -->
<style> <style>
#animation_container, #_preload_div_ { #animation_container, #_preload_div_ {
position:absolute; position:absolute;
@ -20,29 +20,29 @@
left:0;right:0; left:0;right:0;
top:0;bottom:0; top:0;bottom:0;
} }
</style> </style>
<script src="libs/1.0.0/createjs.min.js"></script> <script src="libs/1.0.0/createjs.min.js"></script>
<script src="bird.js"></script> <script src="source-code.js"></script>
<script> <script>
var canvas, stage, exportRoot, anim_container, dom_overlay_container, fnStartAnimation; var canvas, stage, exportRoot, anim_container, dom_overlay_container, fnStartAnimation;
function init() { function init() {
canvas = document.getElementById("canvas"); canvas = document.getElementById("canvas");
anim_container = document.getElementById("animation_container"); anim_container = document.getElementById("animation_container");
dom_overlay_container = document.getElementById("dom_overlay_container"); dom_overlay_container = document.getElementById("dom_overlay_container");
var comp=AdobeAn.getComposition("ACA4432A71D0634E82B0166D11C7DDFE"); var comp=AdobeAn.getComposition("ACA4432A71D0634E82B0166D11C7DDFE");
var lib=comp.getLibrary(); var lib=comp.getLibrary();
var loader = new createjs.LoadQueue(false); var loader = new createjs.LoadQueue(false);
loader.addEventListener("fileload", function(evt){handleFileLoad(evt,comp)}); loader.addEventListener("fileload", function(evt){handleFileLoad(evt,comp)});
loader.addEventListener("complete", function(evt){handleComplete(evt,comp)}); loader.addEventListener("complete", function(evt){handleComplete(evt,comp)});
var lib=comp.getLibrary(); var lib=comp.getLibrary();
loader.loadManifest(lib.properties.manifest); loader.loadManifest(lib.properties.manifest);
} }
function handleFileLoad(evt, comp) { function handleFileLoad(evt, comp) {
var images=comp.getImages(); var images=comp.getImages();
if (evt && (evt.item.type == "image")) { images[evt.item.id] = evt.result; } if (evt && (evt.item.type == "image")) { images[evt.item.id] = evt.result; }
} }
function handleComplete(evt,comp) { function handleComplete(evt,comp) {
//This function is always called, irrespective of the content. You can use the variable "stage" after it is created in token create_stage. //This function is always called, irrespective of the content. You can use the variable "stage" after it is created in token create_stage.
var lib=comp.getLibrary(); var lib=comp.getLibrary();
var ss=comp.getSpriteSheet(); var ss=comp.getSpriteSheet();
var queue = evt.target; var queue = evt.target;
@ -54,27 +54,27 @@ function handleComplete(evt,comp) {
preloaderDiv.style.display = 'none'; preloaderDiv.style.display = 'none';
canvas.style.display = 'block'; canvas.style.display = 'block';
exportRoot = new lib.鸟妈妈回家_HTML5Canvas(); exportRoot = new lib.鸟妈妈回家_HTML5Canvas();
stage = new lib.Stage(canvas); stage = new lib.Stage(canvas);
//Registers the "tick" event listener. //Registers the "tick" event listener.
fnStartAnimation = function() { fnStartAnimation = function() {
stage.addChild(exportRoot); stage.addChild(exportRoot);
createjs.Ticker.framerate = lib.properties.fps; createjs.Ticker.framerate = lib.properties.fps;
createjs.Ticker.addEventListener("tick", stage); createjs.Ticker.addEventListener("tick", stage);
} }
//Code to support hidpi screens and responsive scaling. //Code to support hidpi screens and responsive scaling.
AdobeAn.makeResponsive(true,'both',true,1,[canvas,preloaderDiv,anim_container,dom_overlay_container]); AdobeAn.makeResponsive(true,'both',true,1,[canvas,preloaderDiv,anim_container,dom_overlay_container]);
AdobeAn.compositionLoaded(lib.properties.id); AdobeAn.compositionLoaded(lib.properties.id);
fnStartAnimation(); fnStartAnimation();
} }
</script> </script>
<!-- write your code here --> <!-- write your code here -->
</head> </head>
<body onload="init();" style="margin:0px;"> <body onload="init();" style="margin:0px;">
<div id="animation_container" style="background-color:rgba(255, 255, 255, 1.00); width:1280px; height:720px"> <div id="animation_container" style="background-color:rgba(255, 255, 255, 1.00); width:1280px; height:720px">
<canvas id="canvas" width="1280" height="720" style="position: absolute; display: none; background-color:rgba(255, 255, 255, 1.00);"></canvas> <canvas id="canvas" width="1280" height="720" style="position: absolute; display: none; background-color:rgba(255, 255, 255, 1.00);"></canvas>
<div id="dom_overlay_container" style="pointer-events:none; overflow:hidden; width:1280px; height:720px; position: absolute; left: 0px; top: 0px; display: none;"> <div id="dom_overlay_container" style="pointer-events:none; overflow:hidden; width:1280px; height:720px; position: absolute; left: 0px; top: 0px; display: none;">
</div> </div>
</div> </div>
<div id='_preload_div_' style='position:absolute; top:0; left:0; display: inline-block; height:720px; width: 1280px; text-align: center;'> <span style='display: inline-block; height: 100%; vertical-align: middle;'></span> <img src=images/_preloader.gif style='vertical-align: middle; max-height: 100%'/></div> <div id='_preload_div_' style='position:absolute; top:0; left:0; display: inline-block; height:720px; width: 1280px; text-align: center;'> <span style='display: inline-block; height: 100%; vertical-align: middle;'></span> <img src=images/_preloader.gif style='vertical-align: middle; max-height: 100%'/></div>
</body> </body>
</html> </html>

8
public/bird.js → public/source-code.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save