[object Object]

← back to Linenwallpaper

Phase 2: mobile-ready + tap-to-reveal

c8fd59e0463dc38a85a074707e1ee3d18f668819 · 2026-05-19 11:27:38 -0700 · Steve Abrams

Files touched

Diff

commit c8fd59e0463dc38a85a074707e1ee3d18f668819
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Tue May 19 11:27:38 2026 -0700

    Phase 2: mobile-ready + tap-to-reveal
---
 public/index.html | 28 ++++++++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/public/index.html b/public/index.html
index 68e24e7..777ba2c 100644
--- a/public/index.html
+++ b/public/index.html
@@ -124,7 +124,7 @@ header { position:fixed; top:0; left:0; right:0; display:flex; justify-content:s
 .card:hover { transform:scale(1.04); z-index:5 }
 .card img { width:100%; height:100%; object-fit:cover; display:block; transition:transform 0.4s ease }
 .card .overlay { position:absolute; left:0; right:0; bottom:0; padding:20px 16px 14px; background:linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.85) 100%); transform:translateY(48%); opacity:0.85; transition:transform 0.3s ease, opacity 0.3s ease }
-.card:hover .overlay { transform:translateY(0); opacity:1 }
+.card:hover .overlay, .card.revealed .overlay { transform:translateY(0); opacity:1 }
 .card .pat { font-size:13px; font-weight:600; letter-spacing:0.02em; color:#fff; line-height:1.25; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden }
 .card .ven { font-size:9px; letter-spacing:0.18em; text-transform:uppercase; color:#fff; opacity:0.7; font-weight:500; margin-top:4px }
 .card .actions { margin-top:10px; display:flex; gap:6px }
@@ -132,7 +132,14 @@ header { position:fixed; top:0; left:0; right:0; display:flex; justify-content:s
 .card .sample-btn:hover { background:var(--accent); color:#fff }
 
 @media (max-width:1024px) { .grid { grid-template-columns:repeat(min(var(--cols), 4), 1fr) } }
-@media (max-width:720px) { .grid { grid-template-columns:repeat(2, 1fr) } .density { display:none } }
+@media (max-width:720px) {
+  .grid { grid-template-columns:repeat(2, 1fr) }
+  /* keep sort + view toggle + search on mobile — only the column-density slider is meaningless at a fixed 2-col layout */
+  .density { flex-wrap:wrap; gap:10px }
+  .dens-only, #densitySlider, #densityLabel { display:none }
+  .density .search { flex:1 1 100%; order:5 }
+  .card .sample-btn { padding:12px 10px }   /* ≥44px touch target */
+}
 
 .sentinel { height:1px }
 .loading { text-align:center; color:var(--muted); padding:32px; font-size:10px; letter-spacing:0.32em; text-transform:uppercase; font-weight:700 }
@@ -480,7 +487,7 @@ textarea:focus-visible,
       <option value="price-asc">Price ↑</option>
       <option value="price-desc">Price ↓</option>
     </select>
-    <label>Grid</label>
+    <label class="dens-only">Grid</label>
     <input type="range" id="densitySlider" min="4" max="12" step="1" value="6" aria-label="Grid columns">
     <span class="ct" id="densityLabel">6 cols</span>
     <div class="search">
@@ -593,6 +600,8 @@ textarea:focus-visible,
 
 <script>
 const state = { q:'', facet:'all', page:1, pages:1, total:0, loading:false, exhausted:false, sort:'newest', view:'grid' };
+// Touch device = no hover. Drives tap-to-reveal card behavior.
+const TOUCH = window.matchMedia('(hover: none)').matches;
 const HOSTKEY = location.hostname.replace(/\./g, '_');
 // DW STANDARD: hydrate saved view BEFORE the first grid load.
 (function(){
@@ -746,7 +755,18 @@ async function loadGridPage() {
   const grid = document.getElementById('grid');
   for (const p of data.items) {
     const a = document.createElement('a');
-    a.className = 'card'; a.href = '#'; a.onclick = (e) => { e.preventDefault(); openDetails(p); };
+    a.className = 'card'; a.href = '#';
+    a.onclick = (e) => {
+      e.preventDefault();
+      // Touch devices have no hover — 1st tap reveals the card's info overlay,
+      // 2nd tap on the revealed card opens the detail modal.
+      if (TOUCH && !a.classList.contains('revealed')) {
+        document.querySelectorAll('.card.revealed').forEach(c => c.classList.remove('revealed'));
+        a.classList.add('revealed');
+        return;
+      }
+      openDetails(p);
+    };
     a.innerHTML = state.view === 'list' ? rowHTML(p) : cardHTML(p);
     grid.appendChild(a);
   }

← ef56740 stage2: wire microsite catalog + admin CRUD + grid/list view  ·  back to Linenwallpaper  ·  Phase 2b: harden .card .pat against long-token title clippin 782a1de →