-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
231 lines (231 loc) · 9.16 KB
/
index.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<!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">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>DES Visualizer</title>
<!-- write your code here -->
<!---->
<script src="js/bit-array-typed.js"></script>
<script src="js/des.js"></script>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/application.js"></script>
<style>
#animation_container {
/*position:absolute;*/
margin:auto;
/*left:0;right:0;
top:0;bottom:0;*/
}
</style>
<script src="https://code.createjs.com/createjs-2015.11.26.min.js"></script>
<script>
function LoadGFonts(families) {
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 = ["Inconsolata","Open Sans"];
</script>
<style>
@font-face {
font-family: 'Inconsolata';
font-style: normal;
font-weight: 400;
src: local('Inconsolata Regular'), local('Inconsolata-Regular'), url(https://fonts.gstatic.com/s/inconsolata/v15/BjAYBlHtW3CJxDcjzrnZCIbN6UDyHWBl620a-IRfuBk.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(https://fonts.gstatic.com/s/opensans/v13/k3k702ZOKiLJc3WVjuplzHhCUOGz7vYGh680lGh-uXM.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff) format('woff');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}</style>
<script src="index.js?1481665854605"></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");
try {
if(!(typeof gFontsFamilies === 'undefined' || gFontsFamilies === null))
LoadGFonts(gFontsFamilies);
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) {};
handleComplete();
}
function handleComplete() {
//This function is always called, irrespective of the content. You can use the variable "stage" after it is created in token create_stage.
exportRoot = new lib.DESVisualizer();
stage = new createjs.Stage(canvas);
stage.addChild(exportRoot);
stage.enableMouseOver();
//Registers the "tick" event listener.
fnStartAnimation = function() {
createjs.Ticker.setFPS(lib.properties.fps);
createjs.Ticker.addEventListener("tick", stage);
}
//Code to support hidpi screens and responsive scaling.
function makeResponsive(isResp, respDim, isScale, scaleType) {
var lastW, lastH, lastS=1;
window.addEventListener('resize', resizeCanvas);
resizeCanvas();
function resizeCanvas() {
var w = lib.properties.width, h = lib.properties.height;
var iw = window.innerWidth, ih=window.innerHeight;
var pRatio = window.devicePixelRatio || 1, xRatio=iw/w, yRatio=ih/h, sRatio=1;
if(isResp) {
if((respDim=='width'&&lastW==iw) || (respDim=='height'&&lastH==ih)) {
sRatio = lastS;
}
else if(!isScale) {
if(iw<w || ih<h)
sRatio = Math.min(xRatio, yRatio);
}
else if(scaleType==1) {
sRatio = Math.min(xRatio, yRatio);
}
else if(scaleType==2) {
sRatio = Math.max(xRatio, yRatio);
}
}
canvas.width = w*pRatio*sRatio;
canvas.height = h*pRatio*sRatio;
canvas.style.width = dom_overlay_container.style.width = anim_container.style.width = w*sRatio+'px';
canvas.style.height = anim_container.style.height = dom_overlay_container.style.height = h*sRatio+'px';
stage.scaleX = pRatio*sRatio;
stage.scaleY = pRatio*sRatio;
lastW = iw; lastH = ih; lastS = sRatio;
}
}
makeResponsive(true,'both',true,1);
fnStartAnimation();
}
</script>
<!-- write your code here -->
<script type="text/javascript">
$(document).ready(init);
</script>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/application.css" rel="stylesheet">
</head>
<body>
<header id="mainHeader">
<h1>DES Visualizer</h1>
<form id="jsMainForm" action="#">
<div class="inputSection">
<label for="jsMessageInput" class="primaryLabel">Input</label>
<div class="inputs">
<div class="upperRow">
<input id="jsMessageInput" type="text" class="form-control" placeholder="Input" maxlength="8" name="messageValue">
<a href="#" id="jsRandomMessage">Random</a>
</div>
<label>
<input type="radio" name="messageType" value="ascii" checked>
ASCII
</label>
<label>
<input type="radio" name="messageType" value="hex">
Hex
</label>
</div>
</div>
<div class="inputSection">
<label for="jsKeyInput" class="primaryLabel">Key</label>
<div class="inputs">
<div class="upperRow">
<input id="jsKeyInput" type="text" class="form-control" placeholder="Key" maxlength="8" name="keyValue">
<a href="#" id="jsRandomKey">Random</a>
</div>
<label>
<input type="radio" name="keyType" value="ascii" checked>
ASCII
</label>
<label>
<input type="radio" name="keyType" value="hex">
Hex
</label>
</div>
</div>
<div class="buttonWrapper">
<!--<button type="button" class="btn btn-default">?</button>-->
<button type="submit" class="btn btn-success">Encrypt</button>
</div>
</form>
</header>
<div id="animation_container" style="background-color:rgba(255, 255, 255, 1.00); width:1200px; height:650px">
<canvas id="canvas" width="1200" height="650" 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:1200px; height:650px; position: absolute; left: 0px; top: 0px; display: block;">
</div>
</div>
</body>
</html>