patx/afterdarklabs

minify JS

Commit 6bcc7dd · patx · 2026-09-07T19:19:59-04:00

Changeset
6bcc7dd4144db0440615be29c9b4a617858e8662
Parents
52579abe234bc8247f446afdf5bd71091ab4e7cd

View source at this commit

Comments

No comments yet.

Log in to comment

Diff

diff --git a/docs/index.html b/docs/index.html
index 314ecf0..a0f946d 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -294,39 +294,7 @@
 
     </main>
 
-    <script>
-        (() => {
-            const scroller = document.querySelector('#work-scroller');
-            const mobileQuery = window.matchMedia('(max-width: 767px)');
-
-            if (!scroller) return;
-
-            const cards = [...scroller.querySelectorAll(':scope > article')];
-
-            const closeCards = () => {
-                cards.forEach((card) => card.classList.remove('is-active'));
-            };
-
-            scroller.addEventListener('click', (event) => {
-                if (!mobileQuery.matches || event.target.closest('.portfolio-live-link')) return;
-
-                const card = event.target.closest('article');
-                if (!card || card.parentElement !== scroller) return;
-
-                const wasActive = card.classList.contains('is-active');
-                closeCards();
-                if (!wasActive) card.classList.add('is-active');
-            });
-
-            document.addEventListener('click', (event) => {
-                if (mobileQuery.matches && !event.target.closest('#work-scroller > article')) {
-                    closeCards();
-                }
-            });
-
-            mobileQuery.addEventListener?.('change', closeCards);
-        })();
-    </script>
+    <script>(()=>{const e=document.querySelector("#work-scroller"),t=window.matchMedia("(max-width: 767px)");if(!e)return;const c=[...e.querySelectorAll(":scope > article")],s=()=>c.forEach(e=>e.classList.remove("is-active"));e.addEventListener("click",c=>{if(!t.matches||c.target.closest(".portfolio-live-link"))return;const o=c.target.closest("article");if(!o||o.parentElement!==e)return;const i=o.classList.contains("is-active");s(),i||o.classList.add("is-active")}),document.addEventListener("click",e=>{t.matches&&!e.target.closest("#work-scroller > article")&&s()}),t.addEventListener?.("change",s)})();</script>
 
 </body>
 </html>