-
Notifications
You must be signed in to change notification settings - Fork 0
/
lynch 02.html
142 lines (142 loc) · 5.33 KB
/
lynch 02.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!DOCTYPE html>
<!--
NOTES:
1. All tokens are represented by '$' sign in the template.
2. You can write your code only wherever mentioned.
3. All occurrences of existing tokens will be replaced by their appropriate values.
4. Blank lines will be removed automatically.
5. Remove unnecessary comments before creating your template.
-->
<html>
<head>
<meta charset="UTF-8">
<meta name="authoring-tool" content="Adobe_Animate_CC">
<title>lynch 02</title>
<!-- write your code here -->
<style>
#animation_container {
position:absolute;
margin:auto;
left:0;right:0;
top:0;bottom:0;
}
</style>
<script src="https://code.createjs.com/1.0.0/createjs.min.js"></script>
<script>
function LoadGFonts(families, comp) {
var lib=comp.getLibrary();
var googleObject = {type: "Google", loadedFonts: 0, totalFonts: families.length, callOnLoad: lib.gfontAvailable};
for(var i =0; i < families.length; i++)
isFontAvailable(gFontsFamilies[i], googleObject);
}
function isFontAvailable(font, obj) {
var timeOut = 5000;
var delay = 200;
var interval = 0;
var timeElapsed = 0;
function checkFont() {
var node = document.createElement("span");
node.innerHTML = "giItT1WQy@!-/#";
node.style.position = "absolute";
node.style.left = "-1000px";
node.style.top = "-1000px";
node.style.fontSize = "300px";
node.style.fontFamily = "sans-serif";
node.style.fontVariant = "normal";
node.style.fontStyle = "normal";
node.style.fontWeight = "normal";
node.style.letterSpacing = "0";
document.body.appendChild(node);
var width = node.offsetWidth;
node.style.fontFamily = font+","+node.style.fontFamily;
var returnVal = false;
if((node && node.offsetWidth != width) || timeElapsed >=timeOut) {
obj.loadedFonts++;
if(interval)
clearInterval(interval);
obj.callOnLoad(font, obj.totalFonts);
returnVal = true;
}
if(node) {
node.parentNode.removeChild(node);
node = null;
}
timeElapsed += delay;
return returnVal;
}
if(!checkFont()) {
interval = setInterval(checkFont, delay);
}
}
</script>
<script>
var gFontsFamilies = ["Alfa Slab One","Raleway"];
</script>
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Alfa+Slab+One:regular&subset=latin">
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Raleway:regular&subset=latin">
<script src="lynch 02.js?1663802476207"></script>
<script>
var canvas, stage, exportRoot, anim_container, dom_overlay_container, fnStartAnimation;
function init() {
canvas = document.getElementById("canvas");
anim_container = document.getElementById("animation_container");
dom_overlay_container = document.getElementById("dom_overlay_container");
var comp=AdobeAn.getComposition("6CF5E040F16840128050EBA71FF14D2B");
var lib=comp.getLibrary();
try {
if(!(typeof gFontsFamilies === 'undefined' || gFontsFamilies === null))
LoadGFonts(gFontsFamilies, comp);
if(!(typeof totalTypekitFonts === 'undefined' || totalTypekitFonts === null)) {
var typekitObject = {type: 'Typekit', loadedFonts: 0, totalFonts: totalTypekitFonts, callOnLoad: lib.tfontAvailable};
Typekit.load({
async: true,
'fontactive': function(family) {
isFontAvailable(family, typekitObject);
}
});
}
} catch(e) {};
var loader = new createjs.LoadQueue(false);
loader.addEventListener("fileload", function(evt){handleFileLoad(evt,comp)});
loader.addEventListener("complete", function(evt){handleComplete(evt,comp)});
var lib=comp.getLibrary();
loader.loadManifest(lib.properties.manifest);
}
function handleFileLoad(evt, comp) {
var images=comp.getImages();
if (evt && (evt.item.type == "image")) { images[evt.item.id] = evt.result; }
}
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.
var lib=comp.getLibrary();
var ss=comp.getSpriteSheet();
var queue = evt.target;
var ssMetadata = lib.ssMetadata;
for(i=0; i<ssMetadata.length; i++) {
ss[ssMetadata[i].name] = new createjs.SpriteSheet( {"images": [queue.getResult(ssMetadata[i].name)], "frames": ssMetadata[i].frames} )
}
exportRoot = new lib.lynch02();
stage = new lib.Stage(canvas);
stage.enableMouseOver();
//Registers the "tick" event listener.
fnStartAnimation = function() {
stage.addChild(exportRoot);
createjs.Ticker.framerate = lib.properties.fps;
createjs.Ticker.addEventListener("tick", stage);
}
//Code to support hidpi screens and responsive scaling.
AdobeAn.makeResponsive(true,'both',true,1,[canvas,anim_container,dom_overlay_container]);
AdobeAn.compositionLoaded(lib.properties.id);
fnStartAnimation();
}
</script>
<!-- write your code here -->
</head>
<body onload="init();" style="margin:0px;">
<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: block; 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: block;">
</div>
</div>
</body>
</html>