-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew.html
More file actions
53 lines (53 loc) · 2.48 KB
/
new.html
File metadata and controls
53 lines (53 loc) · 2.48 KB
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
<!doctype HTML>
<html>
<head>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="screens/screens.css">
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<meta name="apple-mobile-web-app-title" content="X0lotl">
<link rel="manifest" href="/site.webmanifest">
<title>Js Tests</title>
<script type="module">
import scrn from "./screens/screens.js"
window.scrn = scrn
</script>
</head>
<body>
<h1>I am testing javascript here now!</h1>
<hr>
<h2>Paragraph editing</h2>
<p id="jsPara">
Okay, will this work?
</p>
<button onclick="changePara()">Test</button>
<hr>
<h2>Editing SVGs and mouse tracking</h2>
<p>I made a folder called <code>/screens/</code> where you can see all the SVG editing stuff I used.</p>
<svg class="screen" onmousemove="scrn.moveToCursor(event, 'circ0')">
<circle id="circ0" r="50" fill="red" />
</svg>
<hr>
<div id="debug" style="white-space: pre;">
</div>
<h2>Procedural Animation (PA) Part 1: Ropes</h2>
<p>In order to make procedural animation, I started by making a <code>ropes(ids, dist)</code> function, that would move elements in the list <code>ids</code> to be <code>dist</code> pixels apart. (It's in <code>screens/screens.js</code>)</p>
<svg class="screen" id="PA1" onmousemove="scrn.moveToCursor(event, 'rcirc3');scrn.rope(['rcirc3','rcirc2','rcirc1','rcirc0'], document.getElementById('distance').value)">
<circle id="rcirc0" class="rope" cx="10" cy="10" r="25" fill="red" />
<circle id="rcirc1" class="rope" cx="10" cy="10" r="25" fill="blue" />
<circle id="rcirc2" class="rope" cx="10" cy="10" r="25" fill="red" />
<circle id="rcirc3" class="rope" cx="10" cy="10" r="25" fill="blue" />
</svg>
<label for="size">Size:</label>
<input type="range" value="25" id="size" oninput="scrn.resize(this.value, 'PA1', 'rope');">
<label for="distance">Distance:</label>
<input type="range" id="distance" min="1">
<script>
function changePara() {
document.getElementById("jsPara").textContent = "It worked!"
}
</script>
</body>
</html>