Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
124 lines (115 loc) · 5.01 KB
/
Copy pathindex.html
File metadata and controls
124 lines (115 loc) · 5.01 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
116
117
118
119
120
121
122
123
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Star Wars Planet Explorer - SWAPI</title>
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<div class="stars"></div>
<div class="container">
<header>
<h1>🌌 Star Wars Explorer</h1>
<p class="subtitle">Discover planets and characters from a galaxy far, far away...</p>
</header>
<!-- Tab Navigation -->
<div class="tab-navigation">
<button class="tab-btn active" data-tab="planets">🪐 Planets</button>
<button class="tab-btn" data-tab="people">👤 Characters</button>
</div>
<!-- Planets Controls -->
<div class="controls" id="planetsControls">
<label for="planetId">Choose a Planet:</label>
<input type="number" id="planetId" min="1" max="60" value="1" placeholder="Enter planet ID (1-60)">
<button id="fetchBtn">Explore Planet</button>
<button id="randomBtn">Random Planet</button>
</div>
<!-- People Controls -->
<div class="controls hidden" id="peopleControls">
<label for="personId">Choose a Character:</label>
<input type="number" id="personId" min="1" max="83" value="1" placeholder="Enter character ID (1-83)">
<button id="fetchPersonBtn">Explore Character</button>
<button id="randomPersonBtn">Random Character</button>
</div>
<div id="loading" class="loading hidden">
<div class="spinner"></div>
<p>Traveling through hyperspace...</p>
</div>
<div id="error" class="error hidden"></div>
<!-- Planet Card -->
<div id="planetCard" class="planet-card hidden">
<h2 id="planetName"></h2>
<div class="data-grid">
<div class="data-item">
<span class="data-label">Climate:</span>
<span class="data-value" id="climate"></span>
</div>
<div class="data-item">
<span class="data-label">Terrain:</span>
<span class="data-value" id="terrain"></span>
</div>
<div class="data-item">
<span class="data-label">Population:</span>
<span class="data-value" id="population"></span>
</div>
<div class="data-item">
<span class="data-label">Diameter:</span>
<span class="data-value" id="diameter"></span>
</div>
<div class="data-item">
<span class="data-label">Gravity:</span>
<span class="data-value" id="gravity"></span>
</div>
<div class="data-item">
<span class="data-label">Orbital Period:</span>
<span class="data-value" id="orbitalPeriod"></span>
</div>
<div class="data-item">
<span class="data-label">Rotation Period:</span>
<span class="data-value" id="rotationPeriod"></span>
</div>
<div class="data-item">
<span class="data-label">Surface Water:</span>
<span class="data-value" id="surfaceWater"></span>
</div>
</div>
</div>
<!-- Character Card -->
<div id="characterCard" class="planet-card hidden">
<h2 id="characterName"></h2>
<div class="data-grid">
<div class="data-item">
<span class="data-label">Height:</span>
<span class="data-value" id="height"></span>
</div>
<div class="data-item">
<span class="data-label">Mass:</span>
<span class="data-value" id="mass"></span>
</div>
<div class="data-item">
<span class="data-label">Hair Color:</span>
<span class="data-value" id="hairColor"></span>
</div>
<div class="data-item">
<span class="data-label">Skin Color:</span>
<span class="data-value" id="skinColor"></span>
</div>
<div class="data-item">
<span class="data-label">Eye Color:</span>
<span class="data-value" id="eyeColor"></span>
</div>
<div class="data-item">
<span class="data-label">Birth Year:</span>
<span class="data-value" id="birthYear"></span>
</div>
<div class="data-item">
<span class="data-label">Gender:</span>
<span class="data-value" id="gender"></span>
</div>
</div>
</div>
</div>
<script src="js/index.js"></script>
</body>
</html>