-
Notifications
You must be signed in to change notification settings - Fork 0
/
journey-to-the-center.html
177 lines (148 loc) · 4.72 KB
/
journey-to-the-center.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Journey to the Center</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Jua&display=swap');
body {
margin: 0;
padding: 0;
height: 31855px; /* 6371 km * 5 pixels per km + 100px for final section */
font-family: 'Jua', sans-serif;
text-align: center;
background-image: url('https://www.transparenttextures.com/patterns/cartoon-clouds.png'), linear-gradient(#87ceeb, #87ceeb);
background-attachment: fixed;
}
.header {
top: 0;
width: 100%;
background-color: #87ceeb;
padding: 10px 0;
z-index: 100;
}
.header h1 {
margin: 0;
font-size: 2em;
color: white;
}
.header p {
margin: 0;
font-size: 1em;
color: white;
}
.km-display {
position: fixed;
bottom: 10px;
left: 50%;
transform: translateX(-50%);
font-size: 30px;
color: white;
background: rgba(0, 0, 0, 0.7);
padding: 10px;
border-radius: 10px;
}
.depth-text {
position: absolute;
left: 50%;
transform: translateX(-50%);
color: white;
font-size: 20px;
}
.final-text-1 {
position: absolute;
left: 50%;
transform: translateX(-50%);
color: white;
font-size: 25px;
}
.final-text-2 {
position: absolute;
left: 50%;
transform: translateX(-50%);
color: white;
font-size: 18px;
}
.final-text-3 {
position: absolute;
left: 50%;
transform: translateX(-50%);
color: white;
font-size: 16px;
}
.layer {
width: 100%;
}
.surface {
background: #58d160;
height: 25px;
}
.ground {
background: linear-gradient(#9B7653, #828282);
height: 245px;
}
.crust {
background: linear-gradient(#828282, #e8391a);
height: 750px;
}
.upper-mantle {
background: linear-gradient(#e8391a, #f5961b);
height: 1300px;
}
.lower-mantle {
background: linear-gradient(#f5961b, #ff8400);
height: 1250px;
}
.outer-core {
background: linear-gradient(#ff8400, #ffd000);
height: 11150px;
}
.inner-core {
background: linear-gradient(#ffd000, #ffe985);
height: 11275px;
}
.center {
background: linear-gradient(#ffe985, #fffced);
height: 6700px;
}
.final-section {
background: black;
color: white;
height: 1000px;
display: flex;
align-items: center;
justify-content: center;
}
</style>
</head>
<body>
<div class="header">
<h1>Journey to the Center</h1>
<p>5 pixels = 1 km</p>
</div>
<div class="surface layer"></div>
<div class="ground layer"></div>
<div class="crust layer"></div>
<div class="upper-mantle layer"></div>
<div class="lower-mantle layer"></div>
<div class="outer-core layer"></div>
<div class="inner-core layer"></div>
<div class="center layer"></div>
<div class="final-section">Created by cdrc</div>
<div class="km-display" id="kmDisplay">0 km</div>
<!-- Additional text at specific depths -->
<div class="depth-text" style="top: 7500px;">Welcome to the Earth's Crust</div>
<div class="depth-text" style="top: 20500px;">Entering the Upper Mantle</div>
<div class="final-text-1" style="top: 33000px;">You have made it to the center of the earth.</div>
<div class="final-text-2" style="top: 33105px;">You are experiencing 5,200 C° or 9,392 F°</div>
<div class="final-text-3" style="top: 33180px;">The pressure you are currently experiencing is 3,000,000x that of earth.</div>
<!-- Add more text as needed -->
<script>
window.onscroll = function() {
var depth = Math.min(Math.round(window.pageYOffset / 5), 6371);
document.getElementById('kmDisplay').innerText = depth + ' km';
};
</script>
</body>
</html>