-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmessage.html
53 lines (43 loc) · 1.75 KB
/
message.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
<!DOCTYPE html>
<html>
<head>
<title>Cloth Simulation</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/matter-js/0.14.2/matter.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>
<!-- <script src="app.js"></script> Your JavaScript file -->
<script src="vector.js"></script> <!-- Your JavaScript file -->
<script src="point.js"></script> <!-- Your JavaScript file -->
<script src="charpoint.js"></script> <!-- Your JavaScript file -->
<script src="stick.js"></script> <!-- Your JavaScript file -->
<!-- <script src="verlet.js"></script> Your JavaScript file -->
<script src="mouse.js"></script> <!-- Your JavaScript file -->
<script src="entity.js"></script> <!-- Your JavaScript file -->
<script src="verly.js"></script> <!-- Your JavaScript file -->
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="pre-love-note">
<code id="pressC">Press "C" to tear!</code>
</div>
<div class="container">
<canvas id="c">
</canvas>
</div>
<script src="make_message.js"></script>
<script>
let pressC = document.getElementById('pressC'); // Assuming 'pressC' is the id of your element
document.onkeydown = function(e) {
if (e.key === 'c' || e.key === 'C') {
pressC.style.backgroundColor = "yellow";
pressC.textContent = "While pressing 'C' move the mouse through the poem...";
}
};
document.onkeyup = function(e) {
if (e.key === 'c' || e.key === 'C') {
pressC.style.backgroundColor = "white";
pressC.textContent = "Press 'C' to tear!";
}
};
</script>
</body>
</html>