forked from Uni-Sol/js-demos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kochflake.html
59 lines (53 loc) · 2.37 KB
/
kochflake.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="viewport" content="user-scalable=no,width=640" />
<title>Koch<snow>Flake</title>
<script type="text/javascript" src="scripts/debugger.js"></script>
</head>
<body onload='load();layer1.onmousemove="";'>
<div id='kochkanvas'>
<div id='layer1' width='1024' height='576'>
<div id='main-header'>
<h4>WHERE THE CANVAS AT?!!</h4>
</div>
</div><br>
<input id='zin' type='button' value='Zoom+'
style='display:block;position:relative;margin-top:-160px;width:120px;'
onclick='kscale*=1.30;//layer1.getContext("2d").fillRect(0,0,640,360);' /><br>
<input id='zout' type='button' value='Zoom-'
style='display:block;position:relative;margin-top:-20px;width:120px;'
onclick='kscale*=0.85;//layer1.getContext("2d").fillRect(0,0,640,360);' /><br>
<input id='zspin' type='button' value='Spin(*)'
style='display:block;position:relative;margin-top:-20px;width:120px;'
onclick='setInterval(spinKoch,33);' /><br>
<input id='stop' type='button' value='STOP' style='display:block;position:relative;margin-top:-0px;'
onclick='clearInterval(ki)' />
</div>
<p id="vstatus"></p>
<p id="license" style="color:#fff">
<img src="http://i.creativecommons.org/l/by-sa/3.0/nz/88x31.png" alt="Creative Commons Licence"><br />
<em>These demos by <a href="mailto:[email protected]">Revlin John </a> are licensed under the <a href="http://creativecommons.org/licenses/by-sa/3.0/nz/deed.en_GB">Creative Commons Attribution-ShareAlike 3.0 License, 2009-2020 </a></em>
</p>
<script type="text/javascript" src="scripts/koch.js"></script>
<script type="text/javascript">
function load() {
var canvas=document.createElement("canvas");
canvas.width = document.getElementById("layer1").getAttribute('width');
canvas.height = document.getElementById("layer1").getAttribute('height');
document.getElementById('kochkanvas').replaceChild( canvas, document.getElementById("layer1") );
canvasApp(canvas);
if (typeof Debugger === "function") {
Debugger.on = false;
return;
} else {
window.Debugger = {
log: function() {
/* no debugger.js */
}
};
}
}
</script>
</body>
</html>