← back to Retrowalls
Phase 2: mobile-ready + tap-to-reveal
41252b263827937342162daa280e43cd3fe64030 · 2026-05-19 11:23:10 -0700 · Steve Abrams
Files touched
Diff
commit 41252b263827937342162daa280e43cd3fe64030
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Tue May 19 11:23:10 2026 -0700
Phase 2: mobile-ready + tap-to-reveal
---
public/index.html | 29 +++++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/public/index.html b/public/index.html
index c5e7086..a567209 100644
--- a/public/index.html
+++ b/public/index.html
@@ -123,7 +123,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 }
@@ -131,7 +131,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 }
@@ -482,7 +489,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">
@@ -599,6 +606,8 @@ textarea:focus-visible,
<script>
const state = { q:'', facet:'all', sort:'newest', view:'grid', page:1, pages:1, total:0, loading:false, exhausted:false };
+// 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 (sort hydrates in the sort-select wire-up below).
(function(){
@@ -752,7 +761,19 @@ 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. Desktop (hover)
+ // shows the overlay on hover, so a click opens immediately.
+ 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);
}
← b573903 stage2: wire microsite catalog + admin CRUD + grid/list view
·
back to Retrowalls
·
Phase 2b: harden .card .pat against long-token title clippin c0aa94c →