mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 03:26:16 +00:00
Optimise loading and reduce image size
This commit is contained in:
parent
df2b2091ec
commit
16df5bc255
9 changed files with 59 additions and 25 deletions
|
@ -1,7 +1,9 @@
|
|||
// fade in images
|
||||
function imgFade(obj, time = 250) {
|
||||
obj.style.transition = `opacity ${time}ms`;
|
||||
obj.style.opacity = 1;
|
||||
function imgFade(obj, time = 200) {
|
||||
obj.style.opacity = null;
|
||||
obj.style.animation = `imgFadeIn ${time}ms`;
|
||||
|
||||
setTimeout(() => { obj.style.animation = null; }, time);
|
||||
}
|
||||
// Lazy load images when they are in view
|
||||
function loadOnView() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue