mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 03:26:16 +00:00
more JS 💀
This commit is contained in:
parent
0cc5f70e4f
commit
9e788b0cec
3 changed files with 10 additions and 11 deletions
|
@ -9,7 +9,7 @@ function loadOnView() {
|
||||||
const webpSupport = checkWebpSupport();
|
const webpSupport = checkWebpSupport();
|
||||||
|
|
||||||
for (let i = 0; i < lazyLoad.length; i++) {
|
for (let i = 0; i < lazyLoad.length; i++) {
|
||||||
let image = lazyLoad[i];
|
const image = lazyLoad[i];
|
||||||
if (image.getBoundingClientRect().top < window.innerHeight && image.getBoundingClientRect().bottom > 0) {
|
if (image.getBoundingClientRect().top < window.innerHeight && image.getBoundingClientRect().bottom > 0) {
|
||||||
if (!image.src && webpSupport) {
|
if (!image.src && webpSupport) {
|
||||||
image.src = `${image.getAttribute('data-src')}&e=webp`;
|
image.src = `${image.getAttribute('data-src')}&e=webp`;
|
||||||
|
|
|
@ -10,11 +10,11 @@ function addNotification(notificationText, notificationLevel) {
|
||||||
// Create notification element
|
// Create notification element
|
||||||
const notification = document.createElement('div');
|
const notification = document.createElement('div');
|
||||||
notification.classList.add('sniffle__notification');
|
notification.classList.add('sniffle__notification');
|
||||||
notification.onclick = function() {
|
notification.onclick = () => {
|
||||||
if (notification) {
|
if (notification) {
|
||||||
notification.classList.add('hide');
|
notification.classList.add('hide');
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(() => {
|
||||||
notificationContainer.removeChild(notification);
|
notificationContainer.removeChild(notification);
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
@ -48,15 +48,14 @@ function addNotification(notificationText, notificationLevel) {
|
||||||
|
|
||||||
// Append notification to container
|
// Append notification to container
|
||||||
notificationContainer.appendChild(notification);
|
notificationContainer.appendChild(notification);
|
||||||
setTimeout(function() { notification.classList.add('show'); }, 5);
|
setTimeout(() => { notification.classList.add('show'); }, 5);
|
||||||
|
|
||||||
// Remove notification after 5 seconds
|
// Remove notification after 5 seconds
|
||||||
setTimeout(function() {
|
setTimeout(() => {
|
||||||
if (notification) {
|
if (notification) {
|
||||||
notification.classList.add('hide');
|
notification.classList.add('hide');
|
||||||
|
setTimeout(() => {
|
||||||
setTimeout(function() {
|
notificationContainer.removeChild(notification);
|
||||||
notificationContainer.removeChild(notification);
|
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
|
@ -14,7 +14,7 @@ function openUploadTab() {
|
||||||
// Stop scrolling and open upload tab
|
// Stop scrolling and open upload tab
|
||||||
document.querySelector("html").style.overflow = "hidden";
|
document.querySelector("html").style.overflow = "hidden";
|
||||||
uploadTab.style.display = "block";
|
uploadTab.style.display = "block";
|
||||||
setTimeout(function () { uploadTab.classList.add("open"); }, 5);
|
setTimeout(() => { uploadTab.classList.add("open"); }, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
// close upload tab
|
// close upload tab
|
||||||
|
@ -25,7 +25,7 @@ function closeUploadTab() {
|
||||||
// un-Stop scrolling and close upload tab
|
// un-Stop scrolling and close upload tab
|
||||||
document.querySelector("html").style.overflow = "auto";
|
document.querySelector("html").style.overflow = "auto";
|
||||||
uploadTab.classList.remove("open");
|
uploadTab.classList.remove("open");
|
||||||
setTimeout(function () {
|
setTimeout(() => {
|
||||||
uploadTab.style.display = "none";
|
uploadTab.style.display = "none";
|
||||||
|
|
||||||
uploadTabContainer.style.transform = "";
|
uploadTabContainer.style.transform = "";
|
||||||
|
@ -76,7 +76,7 @@ function tabDragStopped(event) {
|
||||||
} else {
|
} else {
|
||||||
uploadTab.style.transition = "transform 0.25s cubic-bezier(0.76, 0, 0.17, 1)";
|
uploadTab.style.transition = "transform 0.25s cubic-bezier(0.76, 0, 0.17, 1)";
|
||||||
uploadTab.style.transform = "translateY(0px)";
|
uploadTab.style.transform = "translateY(0px)";
|
||||||
setTimeout(function () { uploadTab.style.transition = ""; }, 250);
|
setTimeout(() => { uploadTab.style.transition = ""; }, 250);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue