diff --git a/onlylegs/static/js/index.js b/onlylegs/static/js/index.js index 8ce7f6d..f56f454 100644 --- a/onlylegs/static/js/index.js +++ b/onlylegs/static/js/index.js @@ -5,26 +5,8 @@ function imgFade(obj, time = 200) { setTimeout(() => { obj.style.animation = null; }, time); } -// Lazy load images when they are in view -function loadOnView() { - const lazyLoad = document.querySelectorAll('#lazy-load'); - const webpSupport = checkWebpSupport(); - - for (let i = 0; i < lazyLoad.length; i++) { - const image = lazyLoad[i]; - if (image.getBoundingClientRect().top < window.innerHeight && image.getBoundingClientRect().bottom > 0) { - if (!image.src && webpSupport) { - image.src = `${image.getAttribute('data-src')}&e=webp`; - } else if (!image.src) { - image.src = image.getAttribute('data-src'); - } - } - } -} window.onload = function () { - loadOnView(); - const times = document.querySelectorAll('.time'); for (let i = 0; i < times.length; i++) { // Remove milliseconds @@ -70,8 +52,6 @@ window.onload = function () { } }; window.onscroll = function () { - loadOnView(); - // Top Of Page button const topOfPage = document.querySelector('.top-of-page'); if (document.body.scrollTop > 300 || document.documentElement.scrollTop > 20) { @@ -90,6 +70,3 @@ window.onscroll = function () { } } }; -window.onresize = function () { - loadOnView(); -}; diff --git a/onlylegs/static/js/webp.js b/onlylegs/static/js/webp.js deleted file mode 100644 index 93a4ade..0000000 --- a/onlylegs/static/js/webp.js +++ /dev/null @@ -1,10 +0,0 @@ -function checkWebpSupport() { - let webpSupport = false; - try { - webpSupport = document.createElement('canvas').toDataURL('image/webp').indexOf('data:image/webp') === 0; - } catch (e) { - webpSupport = false; - } - - return webpSupport; -} diff --git a/onlylegs/static/sass/components/image-view/image.sass b/onlylegs/static/sass/components/image-view/image.sass index 99fd1ac..ac7b9d7 100644 --- a/onlylegs/static/sass/components/image-view/image.sass +++ b/onlylegs/static/sass/components/image-view/image.sass @@ -1,4 +1,4 @@ -.image-container +.image-container, picture margin: auto width: 100% @@ -20,7 +20,7 @@ object-position: center @media (max-width: 1100px) - .image-container + .image-container, picture margin: 0 auto max-height: 69vh diff --git a/onlylegs/static/sass/components/settings.sass b/onlylegs/static/sass/components/settings.sass index cce4ac3..8587a76 100644 --- a/onlylegs/static/sass/components/settings.sass +++ b/onlylegs/static/sass/components/settings.sass @@ -26,4 +26,4 @@ padding: 0 font-size: 1.25rem - font-weight: 700 \ No newline at end of file + font-weight: 700 diff --git a/onlylegs/templates/group.html b/onlylegs/templates/group.html index 3a5b651..61ec8d6 100644 --- a/onlylegs/templates/group.html +++ b/onlylegs/templates/group.html @@ -4,7 +4,7 @@ {% if images %} - + {% endif %} @@ -180,7 +180,7 @@ {% endblock %} @@ -35,13 +33,16 @@