From 0e793ecde5ef7f38800714cfe35aa5941a0cf320 Mon Sep 17 00:00:00 2001 From: schrumpel <Âgit@f0ck.it> Date: Fri, 1 Sep 2023 23:08:41 +0200 Subject: [PATCH 1/3] gives me three thumbnails on my phone, should be good --- public/s/css/f0ck.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/s/css/f0ck.css b/public/s/css/f0ck.css index c702d35..2dca6f8 100644 --- a/public/s/css/f0ck.css +++ b/public/s/css/f0ck.css @@ -1224,9 +1224,10 @@ div.posts { } @media (max-width: 376px) { - div.posts { +/* hat mich auf dem handy abgefuckt, testweiste raus */ + /*div.posts { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); - } + }*/ } div.posts>a { From d9ced4a8965423b061e774b207e73319ff83751b Mon Sep 17 00:00:00 2001 From: schrumpel <Âgit@f0ck.it> Date: Tue, 28 Nov 2023 20:08:32 +0100 Subject: [PATCH 2/3] wheeler fix --- public/s/js/f0ck.js | 51 ++++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/public/s/js/f0ck.js b/public/s/js/f0ck.js index bb59b18..9d483d2 100644 --- a/public/s/js/f0ck.js +++ b/public/s/js/f0ck.js @@ -46,19 +46,44 @@ i.src = e.src; }); + // + const wheelEventListener = function(event) { + if (event.target.closest('.media-object')) { + if (event.deltaY < 0) { + document.getElementById('prev').click(); + } else if (event.deltaY > 0) { + document.getElementById('next').click(); + } + } + }; + + window.addEventListener('wheel', wheelEventListener); + // + + if(f0ckimage = document.querySelector("img#f0ck-image")) { const f0ckimagescroll = document.querySelector("#image-scroll"); + + let isImageExpanded = false; + console.log("entry point - image unclicked") + f0ckimage.addEventListener("click", async e => { e.preventDefault(); const img = await imgSize(f0ckimage); - if(img.width > img.height) - return; - f0ckimagescroll.hasAttribute("style") - ? f0ckimagescroll.removeAttribute("style") - : f0ckimagescroll.setAttribute("style", "overflow-y: scroll"); - f0ckimage.hasAttribute("style") - ? f0ckimage.removeAttribute("style") - : f0ckimage.setAttribute("style", "max-height: none; height: auto; width: 100%; position: absolute; left: 0; border: var(--img-border-width) solid var(--img-border-color); border-top: none; border-bottom: none;"); + console.log("img clicked"); + if (isImageExpanded) { + isImageExpanded = false; + f0ckimagescroll.removeAttribute("style"); + f0ckimage.removeAttribute("style"); + console.log("image is not expanded") + window.addEventListener('wheel', wheelEventListener); + } else { + if (img.width > img.height) return; + isImageExpanded = true; + window.removeEventListener('wheel', wheelEventListener); + f0ckimagescroll.setAttribute("style", "overflow-y: scroll"); + f0ckimage.setAttribute("style", "max-height: none; height: auto; width: 100%; position: absolute; left: 0; border: var(--img-border-width) solid var(--img-border-color); border-top: none; border-bottom: none;"); + } }); } // @@ -236,14 +261,6 @@ // // - window.addEventListener('wheel', function(event) { - if (event.target.closest('.media-object')) { - if (event.deltaY < 0) { - document.getElementById('prev').click(); - } else if (event.deltaY > 0) { - document.getElementById('next').click(); - } - } - }); + // })(); From 0dff028982997b730371a3a52ff7b14b8638062f Mon Sep 17 00:00:00 2001 From: Abu Ottermann Date: Tue, 28 Nov 2023 19:16:01 +0000 Subject: [PATCH 3/3] revert 0e793ecde5ef7f38800714cfe35aa5941a0cf320 revert gives me three thumbnails on my phone, should be good --- public/s/css/f0ck.css | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/public/s/css/f0ck.css b/public/s/css/f0ck.css index 2dca6f8..c702d35 100644 --- a/public/s/css/f0ck.css +++ b/public/s/css/f0ck.css @@ -1224,10 +1224,9 @@ div.posts { } @media (max-width: 376px) { -/* hat mich auf dem handy abgefuckt, testweiste raus */ - /*div.posts { + div.posts { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); - }*/ + } } div.posts>a {