← back to Raffiawallcoverings
hero: activate self-contained 2x2 hero-4grid (fleet sweep, local)
7b3d07b9f836212a7f00d926d86a0de0ae17f932 · 2026-06-01 13:36:32 -0700 · Steve
Files touched
M public/hero-4grid.jsM public/index.html
Diff
commit 7b3d07b9f836212a7f00d926d86a0de0ae17f932
Author: Steve <steve@designerwallcoverings.com>
Date: Mon Jun 1 13:36:32 2026 -0700
hero: activate self-contained 2x2 hero-4grid (fleet sweep, local)
---
public/hero-4grid.js | 12 ++++++++++--
public/index.html | 2 ++
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/public/hero-4grid.js b/public/hero-4grid.js
index c495e6f..54a9cbb 100644
--- a/public/hero-4grid.js
+++ b/public/hero-4grid.js
@@ -43,9 +43,17 @@
// Anti-header crop CSS — applied via inline so it ALWAYS wins
var style = document.createElement('style');
style.id = 'hero4-crop';
+ // Self-contained: inject the 2×2 LAYOUT too (not just the crop), so the grid
+ // works on any site that has the <script> tag even if its index.html never
+ // shipped .cinema-grid CSS. Hides the single .cinema-bg only once four-square
+ // mode is actually active (set in inject()), so a fetch failure keeps the
+ // static hero. Appended last → wins over any per-site .cinema-grid at equal
+ // specificity; identical values so sites that DO define it are unaffected.
style.textContent =
- '.hero4-cell{background-size:cover !important;background-position:center 12% !important;transition:opacity 600ms ease;}' +
- '.hero4-cell.swap-out{opacity:0;}';
+ '.cinema-grid{position:absolute;inset:0;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:0;z-index:0;}' +
+ '.hero4-cell{width:100%;height:100%;background-size:cover !important;background-position:center 12% !important;background-repeat:no-repeat;transition:opacity 600ms ease;}' +
+ '.hero4-cell.swap-out{opacity:0;}' +
+ '[data-hero-mode="four-square"] .cinema-bg{display:none !important;}';
document.head.appendChild(style);
paint(grid);
diff --git a/public/index.html b/public/index.html
index f6c7438..937658e 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1245,5 +1245,7 @@ async function renderRailSections(){
<script src="/corner-nav.js" defer></script>
<script src="/sku-redact.js" defer></script>
+<!-- hero4-fix: activate 2x2 hero (self-contained; was commented placeholder) -->
+<script src="/hero-4grid.js" defer></script>
</body>
</html>
← 01e36a6 Remove Big Red widget — never UX-worked, collided with Help
·
back to Raffiawallcoverings
·
fleet rebuild: dw-header (hamburgers UL + centered name) + u da8c9e4 →