v1.4.1-beta/website

This commit is contained in:
2020-06-29 01:02:08 -04:00
parent c37f4db6ad
commit 05c23f2dab
6 changed files with 106 additions and 94 deletions
+9 -4
View File
@@ -1,16 +1,21 @@
var LOGO_INIT = 0;
var GET_INIT = 0;
function handleSticky() {
const logo = document.querySelector('.logo');
const logoCircle = document.querySelector('.logo-circle');
if (window.scrollY >= LOGO_INIT) {
const get = document.querySelector('.landing .link-button');
if (window.scrollY >= LOGO_INIT + logo.offsetHeight) {
logo.classList.add('stickied');
logoCircle.classList.add('stickied');
} else {
logo.classList.remove('stickied');
logoCircle.classList.remove('stickied');
}
if (window.scrollY >= GET_INIT + get.offsetHeight) {
get.classList.add('stickied');
} else {
get.classList.remove('stickied');
}
}
window.onload = function () {
LOGO_INIT = document.querySelector('.logo').offsetTop;
GET_INIT = document.querySelector('.landing .link-button').offsetTop;
window.addEventListener('scroll', this.handleSticky);
};