Move JS to layout HTML for faster loading

Keep images square through JS and not a bug with ::after
This commit is contained in:
Michał Gdula 2023-04-22 13:45:29 +00:00
parent ac2e73042e
commit e9e3706172
7 changed files with 103 additions and 99 deletions

View file

@ -0,0 +1,11 @@
// fade in images
function imgFade(obj, time = 200) {
setTimeout(() => {
obj.style.animation = `imgFadeIn ${time}ms`;
setTimeout(() => {
obj.style.opacity = null;
obj.style.animation = null;
}, time);
}, 1);
}