[object Object]

← back to Saloonwallpaper

hero/ideas: single big full-bleed hero (remove 2x2 four-square grid + hero-4grid.js/json + inert CSS), collapse Ideas to one rail

94058b9ad02cceb438bfc1d3ad6359a2d245eddd · 2026-06-01 14:16:32 -0700 · Steve Abrams

Files touched

Diff

commit 94058b9ad02cceb438bfc1d3ad6359a2d245eddd
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Jun 1 14:16:32 2026 -0700

    hero/ideas: single big full-bleed hero (remove 2x2 four-square grid + hero-4grid.js/json + inert CSS), collapse Ideas to one rail
---
 public/hero-4grid.js   | 104 ---------------------------------------------
 public/hero-4grid.json | 113 -------------------------------------------------
 public/index.html      |   2 +-
 3 files changed, 1 insertion(+), 218 deletions(-)

diff --git a/public/hero-4grid.js b/public/hero-4grid.js
deleted file mode 100644
index c495e6f..0000000
--- a/public/hero-4grid.js
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * hero-4grid.js — universal 2×2 rotating hero for DW-family sites.
- *
- * What it does:
- *   - Fetches /data/hero-4grid.json on load
- *   - Switches the hero to 4-square mode (data-hero-mode="four-square")
- *   - Paints 4 cells with the configured images
- *   - Auto-cycles each cell every N seconds, rotating through the pool
- *   - Applies object-fit: cover; object-position: center 12% to ENFORCE
- *     the "never show image with header" rule
- *
- * Drop-in:  <script src="/hero-4grid.js" defer></script>
- *
- * Per-site override: set window.Hero4GridConfig = { url, autocycle } before load.
- */
-(function () {
-  'use strict';
-  if (window.__hero4GridLoaded) return;
-  window.__hero4GridLoaded = true;
-
-  var CFG = window.Hero4GridConfig || {};
-  var URL = CFG.url || '/hero-4grid.json';
-
-  function inject(cellEls, grid) {
-    // Switch hero mode
-    document.documentElement.dataset.heroMode = 'four-square';
-    var cinema = document.querySelector('.cinema');
-    if (!cinema) return;
-    // Build .cinema-grid if absent
-    var gridEl = cinema.querySelector('.cinema-grid');
-    if (!gridEl) {
-      gridEl = document.createElement('div');
-      gridEl.className = 'cinema-grid';
-      cinema.appendChild(gridEl);
-    }
-    gridEl.innerHTML = '';
-    for (var i = 0; i < 4; i++) {
-      var cell = document.createElement('div');
-      cell.className = 'cell hero4-cell';
-      cell.dataset.idx = i;
-      gridEl.appendChild(cell);
-    }
-    // Anti-header crop CSS — applied via inline so it ALWAYS wins
-    var style = document.createElement('style');
-    style.id = 'hero4-crop';
-    style.textContent =
-      '.hero4-cell{background-size:cover !important;background-position:center 12% !important;transition:opacity 600ms ease;}' +
-      '.hero4-cell.swap-out{opacity:0;}';
-    document.head.appendChild(style);
-
-    paint(grid);
-    if (grid.rotation_pool && grid.rotation_pool.length > 4) {
-      startRotation(grid);
-    }
-  }
-
-  function paint(grid) {
-    var cells = document.querySelectorAll('.hero4-cell');
-    for (var i = 0; i < cells.length; i++) {
-      var c = grid.cells[i];
-      if (c && c.image_url) {
-        cells[i].style.backgroundImage = "url('" + c.image_url + "')";
-        cells[i].title = c.title || '';
-      }
-    }
-  }
-
-  function startRotation(grid) {
-    var sec = Number(grid.autocycle_seconds) || 6;
-    var pool = grid.rotation_pool.slice();
-    // Index per cell — start with the next image after the initial 4
-    var nextIdx = [4 % pool.length, 5 % pool.length, 6 % pool.length, 7 % pool.length];
-    var cellIdx = 0;
-    setInterval(function () {
-      if (document.hidden) return; // pause when tab hidden
-      var cells = document.querySelectorAll('.hero4-cell');
-      var cell = cells[cellIdx];
-      if (!cell) return;
-      var next = pool[nextIdx[cellIdx] % pool.length];
-      if (!next || !next.image_url) { cellIdx = (cellIdx + 1) % 4; return; }
-      // Preload then swap
-      var pre = new Image();
-      pre.onload = function () {
-        cell.classList.add('swap-out');
-        setTimeout(function () {
-          cell.style.backgroundImage = "url('" + next.image_url + "')";
-          cell.title = next.title || '';
-          cell.classList.remove('swap-out');
-        }, 600);
-      };
-      pre.src = next.image_url;
-      nextIdx[cellIdx] = (nextIdx[cellIdx] + 4) % pool.length;
-      cellIdx = (cellIdx + 1) % 4;
-    }, sec * 1000);
-  }
-
-  fetch(URL, { credentials: 'same-origin' })
-    .then(function (r) { return r.ok ? r.json() : null; })
-    .then(function (grid) {
-      if (!grid || !grid.cells || !Array.isArray(grid.cells)) return;
-      inject(null, grid);
-    })
-    .catch(function (e) { console.warn('[hero-4grid] fetch failed:', e); });
-})();
diff --git a/public/hero-4grid.json b/public/hero-4grid.json
deleted file mode 100644
index adbcda6..0000000
--- a/public/hero-4grid.json
+++ /dev/null
@@ -1,113 +0,0 @@
-{
-  "cells": [
-    {
-      "kind": "room",
-      "sku": "wolfgordonwallcovering_dwwg_kam-5103-jpg",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/kam-5103.jpg?v=1762298426",
-      "title": "Kami - Pearl | Wolf Gordon Wallcoverings"
-    },
-    {
-      "kind": "pattern",
-      "sku": "dwkk-130027",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W4013_86_1e712722-15d2-440b-9f64-84411f60fa51.jpg?v=1753321469",
-      "title": "Kravet Design - Beige Wallcovering | Kravet"
-    },
-    {
-      "kind": "room",
-      "sku": "wolfgordonwallcovering_dwwg_blg-5632-jpg",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/blg-5632.jpg?v=1762287561",
-      "title": "Belgrade - Verde | Wolf Gordon Wallcoverings"
-    },
-    {
-      "kind": "pattern",
-      "sku": "bellevue-gilded-durable-walls-xww-52991",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/gilded-pretty_penny.jpg?v=1777480736",
-      "title": "Bellevue Gilded Durable | Hollywood Wallcoverings"
-    }
-  ],
-  "rotation_pool": [
-    {
-      "sku": "wolfgordonwallcovering_dwwg_kam-5103-jpg",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/kam-5103.jpg?v=1762298426",
-      "title": "Kami - Pearl | Wolf Gordon Wallcoverings"
-    },
-    {
-      "sku": "dwkk-130027",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W4013_86_1e712722-15d2-440b-9f64-84411f60fa51.jpg?v=1753321469",
-      "title": "Kravet Design - Beige Wallcovering | Kravet"
-    },
-    {
-      "sku": "wolfgordonwallcovering_dwwg_blg-5632-jpg",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/blg-5632.jpg?v=1762287561",
-      "title": "Belgrade - Verde | Wolf Gordon Wallcoverings"
-    },
-    {
-      "sku": "bellevue-gilded-durable-walls-xww-52991",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/gilded-pretty_penny.jpg?v=1777480736",
-      "title": "Bellevue Gilded Durable | Hollywood Wallcoverings"
-    },
-    {
-      "sku": "croydon-type-ii-vinyl-wallcovering-xkm-47480",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/xkm-47480-sample-croydon-type-ii-vinyl-hollywood-wallcoverings.jpg?v=1775709507",
-      "title": "Croydon Type II Vinyl | Hollywood Wallcoverings"
-    },
-    {
-      "sku": "eur-80177-ncw4181-designer-wallcoverings-los-angeles",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/nina_crop_7513498517555.jpg?v=1775522590",
-      "title": "Sansui 04 | Nina Campbell Europe"
-    },
-    {
-      "sku": "hallandale-rice-paper-effect-durable-walls-xwt-53469",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/xwt-53469-sample-hallandale-rice-paper-effect-durable-hollywood-wallcoverings.jpg?v=1775715887",
-      "title": "Hallandale Rice Paper Effect Durable | Hollywood Wallcoverings"
-    },
-    {
-      "sku": "i-love-baroque-medusa-stripe-white-linen-wallcovering-versace-1",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/522e5849c0f09262a5c7745fa4648102.jpg?v=1773710383",
-      "title": "I Love Baroque Medusa Stripe White Linen Wallcovering | Versace"
-    },
-    {
-      "sku": "vaticano-durable-vinyl-dur-72377",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/DUR-72377-sample-clean.jpg?v=1774485271",
-      "title": "Vaticano Durable Vinyl | Hollywood Wallcoverings"
-    },
-    {
-      "sku": "eur-80135-ncw4126-designer-wallcoverings-los-angeles",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/nina_crop_7513496944691.jpg?v=1775522322",
-      "title": "Huntly 06 - Pale Gray Wallcovering | Nina Campbell"
-    },
-    {
-      "sku": "wolfgordonwallcovering_dwwg_sp10201-jpg",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/products/WolfGordonWallcovering_DWWG_sp10200.jpg?v=1733872402",
-      "title": "SP10201 | Wolf Gordon Wallcoverings"
-    },
-    {
-      "sku": "camila-lilac-modern-damask-wallpaper-wallpaper-cca-82840",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/products/6ed3a9091307458f7700bb5e226dae92_72be2b7a-ca25-4124-bf72-b2095bd9a55f.jpg?v=1572309957",
-      "title": "Camila Lilac Modern Damask Wallcovering Wallcovering"
-    },
-    {
-      "sku": "dwkk-127819",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/W0133_01_CAC_da43075b-0744-4332-9738-50442b5e291f.jpg?v=1753321587",
-      "title": "Sapphire Garden Wp - Ivory Multi By Clarke And Clarke | Clarke & Clarke Botanical Wonders Wallcovering | Animal/Insects Wallcovering Print"
-    },
-    {
-      "sku": "dwkk-121666",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/GDW5253_006_68d2deb5-5f90-4242-83cf-c58cdec31b1d.jpg?v=1753293798",
-      "title": "Miguel - Marron Brown By Gaston Y Daniela | Lorenzo Castillo Hispania Wp |Modern Geometric Wallcovering Print"
-    },
-    {
-      "sku": "skelton-type-ii-vinyl-wallcovering-xpy-48390",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/files/xpy-48390-sample-skelton-type-ii-vinyl-hollywood-wallcoverings.jpg?v=1775734082",
-      "title": "Skelton Type II Vinyl | Hollywood Wallcoverings"
-    },
-    {
-      "sku": "wolfgordonwallcovering_dwwg_sm8007-jpg",
-      "image_url": "https://cdn.shopify.com/s/files/1/0015/4117/7456/products/WolfGordonWallcovering_DWWG_sm8006.jpg?v=1733872547",
-      "title": "SM8007 | Wolf Gordon Wallcoverings"
-    }
-  ],
-  "autocycle_seconds": 6,
-  "updated_at": "2026-05-14T15:38:53.274Z",
-  "generated_by": "dw-4grid-fanout.js"
-}
\ No newline at end of file
diff --git a/public/index.html b/public/index.html
index 0d2dd33..14b9cee 100644
--- a/public/index.html
+++ b/public/index.html
@@ -211,7 +211,7 @@ textarea:focus-visible,
 /* Never-show-images-with-headers rule (2026-05-14): every hero image
    is cropped to center 12% from the top to defeat vendor watermarks /
    scraped-site chrome / banner overlays. */
-.cinema-bg, .hero4-cell, .cell { background-position: center 12% !important; }
+.cinema-bg, .cell { background-position: center 12% !important; }
 .card img, .product img { object-position: center 12% !important; }
 </style>
 <!-- Meta Pixel — INERT until set-fb-pixel.sh is run (does NOT load fbevents.js or hit Meta until flipped) -->

← 21b12b9 fleet rebuild: dw-header (hamburgers UL + centered name) + u  ·  back to Saloonwallpaper  ·  header name → domain name 'Saloon Wallpaper' (remove odd bra b737bcd →