mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 11:36:16 +00:00
Fix jumpUp button
Switch to reffere instead of src url Once again, I am changing animations
This commit is contained in:
parent
f845f614df
commit
a9b13f1e39
7 changed files with 38 additions and 22 deletions
|
@ -1,15 +1,17 @@
|
|||
let navToggle = true;
|
||||
|
||||
document.onscroll = function() {
|
||||
document.querySelector('.background-decoration').style.opacity = `${1 - window.scrollY / 621}`;
|
||||
document.querySelector('.background-decoration').style.top = `-${window.scrollY / 5}px`;
|
||||
try {
|
||||
document.querySelector('.background-decoration').style.opacity = `${1 - window.scrollY / 621}`;
|
||||
document.querySelector('.background-decoration').style.top = `-${window.scrollY / 5}px`;
|
||||
} catch (e) {
|
||||
console.log('No background decoration found');
|
||||
}
|
||||
|
||||
if (document.body.scrollTop > 300 || document.documentElement.scrollTop > 20) {
|
||||
document.querySelector('.jumpUp').style.opacity = 1;
|
||||
document.querySelector('.jumpUp').style.right = "0.75rem";
|
||||
document.querySelector('.jumpUp').classList = 'jumpUp jumpUp--show';
|
||||
} else {
|
||||
document.querySelector('.jumpUp').style.opacity = 0;
|
||||
document.querySelector('.jumpUp').style.right = "-3rem";
|
||||
document.querySelector('.jumpUp').classList = 'jumpUp';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue