-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
100 lines (92 loc) · 4.48 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="https://www.svgrepo.com/show/187801/solar-system-space.svg" type="image/x-icon" />
<title>Orrery</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div id="tooltip"></div>
<button class="menu-button" id="menuButton">
<img src="icons/menu.svg" alt="menu" width="24" height="24">
</button>
<button id="toggleOrbitsButton" class="toggle-orbits-button" title="Remove Orbits">
<img id="toggleOrbitsIcon" src="icons/remove.svg" alt="Hide Orbits" width="24" height="24">
</button>
<button id="pausePlayButton" class="pause-play-button" title="Pause Animation">
<img id="playPauseIcon" src="icons/pause.svg" alt="Pause Icon" width="24" height="24">
</button>
<div class="drawer" id="drawer">
<h2>MENU</h2>
<br>
<ul>
<hr>
<li onclick="window.location.href='galaxy/galaxy.html'">Galaxy</li>
<li onclick="window.location.href='sun/sun.html'">Sun</li>
<li onclick="window.location.href='moon/moon.html'">Moon</li>
<li id="planetsItem">
<div class="parent">Planets <span>▼</span></div>
<ul>
<hr>
<li onclick="window.location.href='mercury/mercury.html'">Mercury</li>
<li onclick="window.location.href='venus/venus.html'">Venus</li>
<li onclick="window.location.href='earth/earth.html'">Earth</li>
<li onclick="window.location.href='mars/mars.html'">Mars</li>
<li onclick="window.location.href='jupiter/jupiter.html'">Jupiter</li>
<li onclick="window.location.href='saturn/saturn.html'">Saturn</li>
<li onclick="window.location.href='uranus/uranus.html'">Uranus</li>
<li onclick="window.location.href='neptune/neptune.html'">Neptune</li>
</ul>
</li>
<li id="dwarfPlanetsItem">
<div class="parent"> Dwarf Planets <span>▼</span></div>
<ul>
<hr>
<li onclick="window.location.href='pluto/pluto.html'">Pluto</li>
<li onclick="window.location.href='ceres/ceres.html'">Ceres</li>
<li onclick="window.location.href='haumea/haumea.html'">Haumea</li>
<li onclick="window.location.href='makemake/makemake.html'">Makemake</li>
<li onclick="window.location.href='eris/eris.html'">Eris</li>
</ul>
</li>
<li id="asteroidsItem">
<div class="parent"> Asteroids <span>▼</span></div>
<ul>
<hr>
<li onclick="window.location.href='eros/eros.html'">Eros</li>
<li onclick="window.location.href='bennu/bennu.html'">Bennu</li>
<li onclick="window.location.href='itokawa/itokawa.html'">Itokawa</li>
</ul>
</li>
</ul>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/examples/js/controls/OrbitControls.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/examples/js/loaders/GLTFLoader.js"></script>
<script src="script.js"></script>
<script>
const menuButton = document.getElementById('menuButton');
const drawer = document.getElementById('drawer');
const planetsItem = document.getElementById('planetsItem');
const dwarfPlanetsItem = document.getElementById('dwarfPlanetsItem');
const asteroidsItem = document.getElementById('asteroidsItem');
menuButton.addEventListener('click', () => {
drawer.classList.toggle('open');
});
planetsItem.addEventListener('click', (event) => {
event.stopPropagation();
planetsItem.classList.toggle('active');
});
dwarfPlanetsItem.addEventListener('click', (event) => {
event.stopPropagation();
dwarfPlanetsItem.classList.toggle('active');
});
asteroidsItem.addEventListener('click', (event) => {
event.stopPropagation();
asteroidsItem.classList.toggle('active');
});
</script>
</body>
</html>