Skip to content

Commit edd99ab

Browse files
authored
Update lang.html
1 parent 9f0bf8b commit edd99ab

File tree

1 file changed

+5
-55
lines changed

1 file changed

+5
-55
lines changed

homepage/lang.html

Lines changed: 5 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
color: #d4d5d7;
2525
font-family: 'Inter', system-ui, sans-serif;
2626
text-align: center;
27-
scroll-snap-type: y proximity;
2827
}
2928

3029
body {
@@ -36,45 +35,21 @@
3635
padding: 0 20px;
3736
}
3837

39-
.top-snap-marker {
40-
scroll-snap-align: start;
41-
}
42-
4338
.logo {
4439
width: 70px;
4540
border-radius: 22.5%;
4641
border: 1px solid rgba(255,255,255,.1);
4742
margin: 0 auto;
43+
margin-bottom: 24px;
4844
margin-top: 50px;
49-
position: relative;
50-
z-index: 1000;
5145
}
5246

5347
.title {
5448
font-size: 19px;
5549
margin-bottom: 24px;
56-
padding-top: 24px;
5750
margin-top: 0;
51+
position: relative;
5852
text-align: center;
59-
position: sticky;
60-
z-index: 999;
61-
top: 0;
62-
scroll-snap-align: start;
63-
}
64-
65-
.title::before {
66-
content: '';
67-
position: fixed;
68-
left: 0;
69-
top: 0;
70-
right: 0;
71-
background: linear-gradient(180deg, #1a1c24 calc(100% - 23px), #1a1c2400);
72-
height: calc(24px + 23px + 24px + 12px);
73-
z-index: -1;
74-
}
75-
76-
.center {
77-
scroll-snap-align: center;
7853
}
7954

8055
.button {
@@ -162,51 +137,26 @@
162137
</head>
163138

164139
<body ontouchstart="">
165-
<div class="top-snap-marker"></div>
166140
<img class="logo" src="/icons/iphone-app-180.png" width="80" draggable="false" alt="Codeit">
167141
<p class="title">Supported languages</p>
168-
<div class="languages center" style="display: inline-block;line-height: 1.5;text-align: left;width: max-content;margin: auto;">Just a sec...</div>
142+
<div class="languages" style="display: inline-block;line-height: 1.5;text-align: left;width: max-content;margin: auto;">Just a sec...</div>
169143
<p style="margin-top: 50px;margin-bottom: 50px;">
170144
<a href="/" style="color: inherit;">- ❤️ Codeit team</a>
171145
</p>
172146

173147
<script src="https://prismjs.com/components.js"></script>
174148
<script>
175149

176-
const languages = Object.keys(components.languages);
177150
let out = '';
178-
179-
out += '<p style="margin-top:0;margin-bottom:7px;">'+ languages.length +' languages</p>';
180-
181-
languages.forEach(lang => {
151+
152+
Object.keys(components.languages).forEach(lang => {
182153

183154
out += '<li>' + lang + '</li>';
184155

185156
});
186157

187158
document.querySelector('.languages').innerHTML = out;
188159

189-
190-
// scroll listener
191-
192-
const scrollEl = document.documentElement,
193-
title = document.querySelector('.title'),
194-
scrollEnd = title.offsetTop,
195-
logo = document.querySelector('.logo');
196-
197-
window.addEventListener('scroll', () => {
198-
199-
const scrollPos = scrollEl.scrollTop;
200-
201-
if (scrollPos <= scrollEnd) {
202-
203-
const opacityPercent = 1 - (scrollPos / scrollEnd);
204-
logo.style.opacity = opacityPercent;
205-
206-
}
207-
208-
});
209-
210160
</script>
211161

212162
</body>

0 commit comments

Comments
 (0)