-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathLevelUp.html
More file actions
210 lines (180 loc) · 3.96 KB
/
LevelUp.html
File metadata and controls
210 lines (180 loc) · 3.96 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
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Everything You Need To Level Up</title>
<style>
*{
margin:0;
padding:0;
box-sizing:border-box;
font-family:'Inter', sans-serif;
}
body{
background:#00000a;
color:white;
overflow-x:hidden;
}
/* Background Video */
video{
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
object-fit:cover;
z-index:-2;
}
/* Dark overlay */
.overlay{
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
background:rgba(0,0,0,0.65);
z-index:-1;
}
/* Scroll height */
.wrapper{
height:400vh;
}
/* Sticky container */
.sticky{
position:sticky;
top:0;
height:100vh;
display:flex;
align-items:center;
justify-content:space-between;
padding:0 8%;
}
/* Typography */
.hero-title .word {
font-family: "Noto Sans", sans-serif;
font-size: clamp(2.5rem, 6vw, 4rem);
font-weight: 800;
line-height: 1.2;
display: inline-block;
/* Background Image */
background-image: url("assets/textbg.jpeg");
background-size: 200% auto;
background-position: 0% 50%;
background-repeat: no-repeat;
/* Text Clip */
-webkit-background-clip: text;
background-clip: text;
color: transparent;
-webkit-text-fill-color: transparent;
/* Animation */
animation: textMove 18s linear infinite;
}
@keyframes textMove {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
@keyframes fadeUp{
from{opacity:0; transform:translateY(40px);}
to{opacity:1; transform:translateY(0);}
}
/* Image container */
.image-box{
width:550px;
aspect-ratio: 16 / 9;
border-radius:25px;
overflow:hidden;
position:relative;
box-shadow:0 30px 70px rgba(0,0,0,0.6);
backdrop-filter: blur(20px);
background:rgba(255,255,255,0.05);
display:flex;
align-items:center;
justify-content:center;
}
/* background blur layer */
.image-box::before{
content:"";
position:absolute;
inset:0;
background:inherit;
filter:blur(40px);
opacity:0.6;
z-index:0;
}
.image-box img{
position:absolute;
max-width:90%;
max-height:90%;
object-fit:contain; /* IMPORTANT */
opacity:0;
transition:opacity 0.7s ease, transform 0.7s ease;
transform:scale(0.95);
z-index:1;
}
.image-box img.active{
opacity:1;
transform:scale(1);
}
/* Scroll hint */
.scroll-text{
position:absolute;
bottom:40px;
left:50%;
transform:translateX(-50%);
letter-spacing:3px;
font-size:0.9rem;
opacity:0.7;
}
</style>
</head>
<body>
<!-- Background Video -->
<video autoplay muted loop>
<source src="assets/bgvideo.mp4" type="video/mp4">
</video>
<div class="overlay"></div>
<div class="wrapper">
<div class="sticky">
<div class="hero-title">
<span class="line">
<span class="word">Everything You</span>
</span>
<span class="line">
<span class="word">Need To Level Up 🚀</span>
</span>
</div>
<div class="image-box">
<img src="assets/githubstats.png" class="active">
<img src="assets/contribution.png">
<img src="assets/githubStreak.png">
</div>
<div class="scroll-text">SCROLL</div>
</div>
</div>
<script>
const images = document.querySelectorAll(".image-box img");
const totalImages = images.length;
window.addEventListener("scroll", () => {
const scrollTop = window.scrollY;
const scrollHeight = document.body.scrollHeight - window.innerHeight;
// scroll percentage (0 to 1)
const scrollPercent = scrollTop / scrollHeight;
// calculate index dynamically
const index = Math.min(
totalImages - 1,
Math.floor(scrollPercent * totalImages)
);
images.forEach(img => img.classList.remove("active"));
images[index].classList.add("active");
});
</script>
</body>
</html>