-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgravity.html
More file actions
115 lines (103 loc) · 3.21 KB
/
Copy pathgravity.html
File metadata and controls
115 lines (103 loc) · 3.21 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
content="Experience an interactive gravity simulation created by Rayk Kretzschmar. Explore physics concepts through this engaging and visually stunning web experiment.">
<meta name="robots" content="noindex">
<title>Interactive Gravity Simulation by Rayk Kretzschmar</title>
<link rel="icon" type="image/x-icon" href="favicon.ico">
<style>
html,
body {
margin: 0;
width: 100%;
height: 100%;
overflow: hidden;
background-color: #000;
color: #fff;
font-family: 'Inter', sans-serif;
}
canvas {
display: block;
position: fixed;
inset: 0;
width: 100vw;
height: 100vh;
}
#ui {
position: absolute;
top: 20px;
left: 20px;
max-width: min(420px, calc(100vw - 40px));
padding: 14px 16px;
border-radius: 12px;
background: linear-gradient(145deg, rgba(18, 24, 36, 0.82), rgba(8, 12, 20, 0.68));
border: 1px solid rgba(255, 255, 255, 0.16);
box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
backdrop-filter: blur(6px);
pointer-events: none;
}
h1 {
margin: 0;
font-size: 1.4rem;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
#ui p {
margin: 8px 0 0;
font-size: 0.95rem;
line-height: 1.45;
opacity: 0.92;
}
#ui .controls {
margin-top: 10px;
font-size: 0.85rem;
opacity: 0.8;
letter-spacing: 0.01em;
}
.back-link {
position: absolute;
top: 20px;
right: 20px;
color: #fff;
text-decoration: none;
background: rgba(255, 255, 255, 0.1);
padding: 8px 16px;
border-radius: 20px;
backdrop-filter: blur(5px);
transition: background 0.2s;
pointer-events: auto;
}
.back-link:hover {
background: rgba(255, 255, 255, 0.2);
}
@media (max-width: 700px) {
#ui {
top: 12px;
left: 12px;
max-width: calc(100vw - 24px);
padding: 12px 13px;
}
.back-link {
top: 12px;
right: 12px;
padding: 7px 12px;
font-size: 0.9rem;
}
}
</style>
</head>
<body>
<div id="ui">
<h1>Gravity Simulator</h1>
<p>Build a dynamic orbital system by launching new bodies and watching them bend trajectories through mutual
gravity.</p>
<p class="controls">Controls: click and drag to set launch velocity. Use arrow keys or WASD to move the camera.
</p>
</div>
<a href="index.html" class="back-link">← Back to Home</a>
<canvas id="simCanvas"></canvas>
<script src="gravity.js"></script>
</body>
</html>