v1.1.0-beta/add request beta sticky

This commit is contained in:
Ayushya Amitabh
2020-05-15 00:04:11 -04:00
parent fa318f31fb
commit 0b0fe88bf4
2 changed files with 19 additions and 2 deletions
+5 -1
View File
@@ -27,14 +27,18 @@
window.addEventListener('scroll', function (ev) { window.addEventListener('scroll', function (ev) {
const title = document.getElementsByClassName('title')[0]; const title = document.getElementsByClassName('title')[0];
const support = document.getElementsByClassName('support')[0]; const support = document.getElementsByClassName('support')[0];
const request = document.getElementsByClassName('request')[0];
if (originalTitlePosition === null) originalTitlePosition = title.offsetTop; if (originalTitlePosition === null) originalTitlePosition = title.offsetTop;
if (window.scrollY > originalTitlePosition) { if (window.scrollY > originalTitlePosition) {
support.classList.add('stickied'); support.classList.add('stickied');
title.classList.add('stickied'); title.classList.add('stickied');
request.classList.add('stickied');
request.style.right = support.clientWidth + 64 + 'px';
} else { } else {
support.classList.remove('stickied'); support.classList.remove('stickied');
title.classList.remove('stickied'); title.classList.remove('stickied');
request.classList.remove('stickied');
} }
}); });
}; };
@@ -51,7 +55,7 @@
WATCH PARTY WATCH PARTY
</span> </span>
</a> </a>
<a class="cta-container" href="./beta.html#request"> <a class="cta-container request" href="./beta.html#request">
<mark class="cta"> <mark class="cta">
Request Beta Access Request Beta Access
</mark> </mark>
+14 -1
View File
@@ -160,7 +160,8 @@ footer mark {
footer > div > span.full { footer > div > span.full {
line-height: 2.5rem; line-height: 2.5rem;
} }
.support { .support,
.request {
transition: all ease-in-out 0.3s; transition: all ease-in-out 0.3s;
} }
@@ -168,6 +169,9 @@ footer > div > span.full {
.cta { .cta {
font-size: 1rem; font-size: 1rem;
} }
.stickied {
z-index: 9999;
}
.support { .support {
display: none; display: none;
margin-top: 0; margin-top: 0;
@@ -181,6 +185,15 @@ footer > div > span.full {
right: 2rem; right: 2rem;
display: block; display: block;
} }
.request.stickied .cta {
letter-spacing: 0rem;
}
.request.stickied {
position: fixed;
top: 2rem;
right: 2rem;
display: block;
}
.title { .title {
font-size: 5rem; font-size: 5rem;
} }