pandorga 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/assets/css/ledger/home.css +65 -29
- data/lib/pandorga/commands/new.rb +1 -1
- data/lib/pandorga/version.rb +1 -1
- data/scripts/test/test-css-structure.rb +6 -2
- data/scripts/test/test-hero-16x9.rb +3 -3
- data/scripts/test/test-hero-name.rb +5 -1
- data/scripts/test/test-regression-gate.mjs +64 -13
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: da1a0fafdbcf941ba9a15f0877c748a06b92327b0c84de5250d9326accf5cb00
|
|
4
|
+
data.tar.gz: d32f3605f5ee46108e8b5ed196a08561f6a1a49d69123ee8aa3ee9635695d7de
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e7df59f7292fffda8fc3d4e2723b3303002f72720ed0d91800c895545466d05e4f52e5ac9f5ddd5e4e2f4db9cb9c3b44898e625301aeaf51b499f2b3a7b8ebdb
|
|
7
|
+
data.tar.gz: 70fc16c8eeed66f4d8cf9ad7f9e5041f5e4caf58796c4fdfc1c071fce140373f16061fcc06bf7c2e2bdba4ca6e4fcabaf7da7fd8566d459f7a7c3749357ddc65
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [2.3.1] — 2026-10-29
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- CR-22.1: Home hero name uses approved B3 clamps (~35px@1024 / ~40px@1440 / stack clamp) and must fit inside the panel (PLT-AC-86); summary/tagline forced light on the photo (specificity over legend); desktop hero panel uses B3 aspect ratios 454/736 and 637/693 (PLT-AC-87); featured home posters keep 16:9 instead of stretching to content height; stronger bottom scrim for stack legibility.
|
|
10
|
+
|
|
5
11
|
## [2.3.0] — 2026-10-29
|
|
6
12
|
|
|
7
13
|
### Added
|
data/assets/css/ledger/home.css
CHANGED
|
@@ -1716,12 +1716,15 @@ button.home-project-inventory-row {
|
|
|
1716
1716
|
}
|
|
1717
1717
|
|
|
1718
1718
|
/* ── Featured article poster ──
|
|
1719
|
-
|
|
1719
|
+
Plate is always 16:9; cover crops the photo inside (PLT-AC-85 companion). */
|
|
1720
1720
|
.home-featured .ledger-poster {
|
|
1721
|
-
|
|
1722
|
-
|
|
1721
|
+
width: 100%;
|
|
1722
|
+
height: auto;
|
|
1723
|
+
aspect-ratio: 16 / 9;
|
|
1724
|
+
min-height: 0;
|
|
1723
1725
|
border: 1.5px solid var(--border-ink);
|
|
1724
1726
|
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-on-surface) 10%, transparent);
|
|
1727
|
+
overflow: hidden;
|
|
1725
1728
|
}
|
|
1726
1729
|
|
|
1727
1730
|
:root:not([data-theme="dark"]) .home-featured .ledger-poster,
|
|
@@ -1748,7 +1751,9 @@ html[data-theme="light"] .home-featured .ledger-poster {
|
|
|
1748
1751
|
|
|
1749
1752
|
.home-featured .ledger-poster {
|
|
1750
1753
|
order: 2;
|
|
1751
|
-
|
|
1754
|
+
width: 100%;
|
|
1755
|
+
height: auto;
|
|
1756
|
+
aspect-ratio: 16 / 9;
|
|
1752
1757
|
}
|
|
1753
1758
|
}
|
|
1754
1759
|
|
|
@@ -1835,9 +1840,10 @@ html[data-theme="light"] .home-featured .ledger-poster {
|
|
|
1835
1840
|
}
|
|
1836
1841
|
|
|
1837
1842
|
/* ═══════════════════════════════════════════════════════════════════════════
|
|
1838
|
-
CR-22 — Home hero B3 (PLT-AC-81…
|
|
1843
|
+
CR-22 / CR-22.1 — Home hero B3 (PLT-AC-81…87)
|
|
1839
1844
|
Photo as hero background + 50/50 masthead with Projects from 1024px.
|
|
1840
|
-
|
|
1845
|
+
Name sizes match approved B3 clamps; summary is light on the photo;
|
|
1846
|
+
desktop hero panel uses B3 aspect ratios; crops centered; home plates 16:9.
|
|
1841
1847
|
Config: --home-hero-vignette, --home-hero-pool (see pandorga.home.hero_overlay).
|
|
1842
1848
|
═══════════════════════════════════════════════════════════════════════════ */
|
|
1843
1849
|
|
|
@@ -1847,7 +1853,7 @@ html[data-theme="light"] .home-featured .ledger-poster {
|
|
|
1847
1853
|
--home-masthead-gutter: clamp(1.25rem, 2.2vw, 2rem);
|
|
1848
1854
|
}
|
|
1849
1855
|
|
|
1850
|
-
/* Shared: centered crop on home specimen/card plates (hero
|
|
1856
|
+
/* Shared: centered crop on home specimen/card plates (hero centers in CR-22 media). */
|
|
1851
1857
|
.home-specimen-figure > .ledger-poster img,
|
|
1852
1858
|
.home-specimen-figure > .ledger-poster video,
|
|
1853
1859
|
.home-card-grid .ledger-poster img,
|
|
@@ -1876,15 +1882,15 @@ html[data-theme="light"] .home-featured .ledger-poster {
|
|
|
1876
1882
|
90deg,
|
|
1877
1883
|
rgba(0, 0, 0, calc(0.55 * var(--home-hero-vignette) / 0.6)) 0%,
|
|
1878
1884
|
rgba(0, 0, 0, calc(0.28 * var(--home-hero-vignette) / 0.6)) 28%,
|
|
1879
|
-
rgba(0, 0, 0, calc(0.10 * var(--home-hero-vignette) / 0.6))
|
|
1885
|
+
rgba(0, 0, 0, calc(0.10 * var(--home-hero-vignette) / 0.6)) 55%,
|
|
1880
1886
|
transparent 76%
|
|
1881
1887
|
),
|
|
1882
1888
|
linear-gradient(
|
|
1883
1889
|
180deg,
|
|
1884
1890
|
rgba(0, 0, 0, calc(0.18 * var(--home-hero-vignette) / 0.6)) 0%,
|
|
1885
1891
|
transparent 22%,
|
|
1886
|
-
transparent
|
|
1887
|
-
rgba(0, 0, 0, calc(0.
|
|
1892
|
+
transparent 48%,
|
|
1893
|
+
rgba(0, 0, 0, calc(0.62 * var(--home-hero-vignette) / 0.6)) 100%
|
|
1888
1894
|
);
|
|
1889
1895
|
}
|
|
1890
1896
|
|
|
@@ -1913,12 +1919,17 @@ html[data-theme="light"] .home-featured .ledger-poster {
|
|
|
1913
1919
|
}
|
|
1914
1920
|
|
|
1915
1921
|
.home-hero {
|
|
1916
|
-
display:
|
|
1922
|
+
display: flex;
|
|
1923
|
+
flex-direction: column;
|
|
1917
1924
|
position: relative;
|
|
1918
1925
|
isolation: isolate;
|
|
1919
1926
|
min-height: 0;
|
|
1920
1927
|
height: auto;
|
|
1921
1928
|
gap: 0;
|
|
1929
|
+
justify-content: flex-end;
|
|
1930
|
+
align-items: stretch;
|
|
1931
|
+
padding: clamp(1.35rem, 4.5vw, 2.1rem) clamp(1.15rem, 5vw, 2rem) clamp(1.5rem, 4.5vw, 2.1rem);
|
|
1932
|
+
box-sizing: border-box;
|
|
1922
1933
|
}
|
|
1923
1934
|
|
|
1924
1935
|
.home-hero-portrait {
|
|
@@ -1969,14 +1980,20 @@ html[data-theme="light"] .home-featured .ledger-poster {
|
|
|
1969
1980
|
flex-direction: column;
|
|
1970
1981
|
justify-content: flex-end;
|
|
1971
1982
|
gap: 0.85rem;
|
|
1972
|
-
padding:
|
|
1983
|
+
padding: 0;
|
|
1973
1984
|
max-width: 36rem;
|
|
1974
1985
|
width: 100%;
|
|
1975
1986
|
box-sizing: border-box;
|
|
1976
1987
|
background: transparent;
|
|
1977
1988
|
}
|
|
1978
1989
|
|
|
1990
|
+
/* B3 stack name (~33.4px @390, ~45.8px @768) */
|
|
1991
|
+
.home-ledger .home-hero-title,
|
|
1979
1992
|
.home-hero-title {
|
|
1993
|
+
white-space: normal;
|
|
1994
|
+
font-size: clamp(1.9rem, 7vw, 2.6rem);
|
|
1995
|
+
line-height: 1.08;
|
|
1996
|
+
max-width: 100%;
|
|
1980
1997
|
color: #f4f4f4;
|
|
1981
1998
|
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
|
|
1982
1999
|
margin-bottom: 0;
|
|
@@ -1998,11 +2015,15 @@ html[data-theme="light"] .home-featured .ledger-poster {
|
|
|
1998
2015
|
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
|
|
1999
2016
|
}
|
|
2000
2017
|
|
|
2001
|
-
.home-hero-summary
|
|
2002
|
-
.home-hero-
|
|
2018
|
+
/* Specificity beats .home-hero .home-hero-summary { color: legend } */
|
|
2019
|
+
.home-hero .home-hero-summary,
|
|
2020
|
+
.home-hero .home-hero-summary p,
|
|
2021
|
+
.home-hero .home-hero-tagline {
|
|
2003
2022
|
color: #f0f0f0;
|
|
2004
2023
|
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
|
|
2005
|
-
max-width: 100
|
|
2024
|
+
max-width: min(34rem, 100%);
|
|
2025
|
+
font-size: clamp(0.95rem, 3.6vw, 1.05rem);
|
|
2026
|
+
line-height: 1.45;
|
|
2006
2027
|
}
|
|
2007
2028
|
|
|
2008
2029
|
.home-hero-tagline {
|
|
@@ -2015,6 +2036,8 @@ html[data-theme="light"] .home-featured .ledger-poster {
|
|
|
2015
2036
|
|
|
2016
2037
|
.home-hero-actions {
|
|
2017
2038
|
margin-top: 0.35rem;
|
|
2039
|
+
flex-wrap: wrap;
|
|
2040
|
+
gap: 0.4rem 0.55rem;
|
|
2018
2041
|
}
|
|
2019
2042
|
|
|
2020
2043
|
.home-hero-actions .ledger-cta,
|
|
@@ -2037,7 +2060,7 @@ html[data-theme="light"] .home-featured .ledger-poster {
|
|
|
2037
2060
|
display: grid;
|
|
2038
2061
|
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
2039
2062
|
column-gap: 0;
|
|
2040
|
-
align-items:
|
|
2063
|
+
align-items: start;
|
|
2041
2064
|
width: min(80rem, calc(100% - 2 * var(--gutter, 2rem)));
|
|
2042
2065
|
max-width: 80rem;
|
|
2043
2066
|
margin-inline: auto;
|
|
@@ -2056,9 +2079,11 @@ html[data-theme="light"] .home-featured .ledger-poster {
|
|
|
2056
2079
|
background: #050505;
|
|
2057
2080
|
border-radius: 3px;
|
|
2058
2081
|
overflow: hidden;
|
|
2059
|
-
align-self:
|
|
2060
|
-
|
|
2082
|
+
align-self: start;
|
|
2083
|
+
/* B3 @1024 ≈ 454×736 (w/h ≈ 0.617) */
|
|
2084
|
+
aspect-ratio: 454 / 736;
|
|
2061
2085
|
height: auto;
|
|
2086
|
+
min-height: 0;
|
|
2062
2087
|
}
|
|
2063
2088
|
|
|
2064
2089
|
.home-band--hero .home-hero-art,
|
|
@@ -2083,7 +2108,7 @@ html[data-theme="light"] .home-featured .ledger-poster {
|
|
|
2083
2108
|
padding-block: 1.25rem 1.75rem;
|
|
2084
2109
|
padding-inline: 0;
|
|
2085
2110
|
border-bottom: 0;
|
|
2086
|
-
align-self:
|
|
2111
|
+
align-self: start;
|
|
2087
2112
|
}
|
|
2088
2113
|
|
|
2089
2114
|
.home-band[data-home-kind="portfolio"] .home-band-inner {
|
|
@@ -2093,21 +2118,20 @@ html[data-theme="light"] .home-featured .ledger-poster {
|
|
|
2093
2118
|
padding-inline: 0;
|
|
2094
2119
|
}
|
|
2095
2120
|
|
|
2096
|
-
/* Remaining bands span the full masthead width */
|
|
2097
2121
|
.home-band:not(.home-band--hero):not([data-home-kind="portfolio"]) {
|
|
2098
2122
|
grid-column: 1 / -1;
|
|
2099
2123
|
}
|
|
2100
2124
|
|
|
2101
|
-
/* Override prior 1024 copy|portrait flex — photo is the panel background */
|
|
2102
2125
|
.home-hero {
|
|
2103
2126
|
display: flex;
|
|
2104
2127
|
flex-direction: column;
|
|
2105
2128
|
position: relative;
|
|
2106
2129
|
isolation: isolate;
|
|
2107
|
-
min-height:
|
|
2130
|
+
min-height: 100%;
|
|
2108
2131
|
height: 100%;
|
|
2109
2132
|
gap: 0;
|
|
2110
2133
|
align-items: stretch;
|
|
2134
|
+
justify-content: flex-end;
|
|
2111
2135
|
}
|
|
2112
2136
|
|
|
2113
2137
|
.home-hero-portrait {
|
|
@@ -2157,7 +2181,7 @@ html[data-theme="light"] .home-featured .ledger-poster {
|
|
|
2157
2181
|
.home-hero-copy {
|
|
2158
2182
|
position: relative;
|
|
2159
2183
|
z-index: 3;
|
|
2160
|
-
flex:
|
|
2184
|
+
flex: 0 0 auto;
|
|
2161
2185
|
display: flex;
|
|
2162
2186
|
flex-direction: column;
|
|
2163
2187
|
justify-content: flex-end;
|
|
@@ -2165,16 +2189,19 @@ html[data-theme="light"] .home-featured .ledger-poster {
|
|
|
2165
2189
|
width: 100%;
|
|
2166
2190
|
max-width: 100%;
|
|
2167
2191
|
min-width: 0;
|
|
2168
|
-
flex-basis: auto;
|
|
2169
2192
|
padding: 1.75rem 1.35rem 1.85rem 1.45rem;
|
|
2170
2193
|
box-sizing: border-box;
|
|
2171
2194
|
background: transparent;
|
|
2172
2195
|
}
|
|
2173
2196
|
|
|
2174
|
-
/*
|
|
2175
|
-
.home-ledger .home-hero-title
|
|
2197
|
+
/* B3 desk name (~35.2px @1024, ~40.1px @1440) */
|
|
2198
|
+
.home-ledger .home-hero-title,
|
|
2199
|
+
.home-hero-title {
|
|
2176
2200
|
white-space: nowrap;
|
|
2177
|
-
font-size: calc(
|
|
2201
|
+
font-size: calc(clamp(1.85rem, 2.6vw, 2.55rem) + 2pt);
|
|
2202
|
+
line-height: 1.08;
|
|
2203
|
+
max-width: 100%;
|
|
2204
|
+
overflow: hidden;
|
|
2178
2205
|
color: #f4f4f4;
|
|
2179
2206
|
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
|
|
2180
2207
|
margin-bottom: 0;
|
|
@@ -2196,11 +2223,14 @@ html[data-theme="light"] .home-featured .ledger-poster {
|
|
|
2196
2223
|
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
|
|
2197
2224
|
}
|
|
2198
2225
|
|
|
2199
|
-
.home-hero-summary,
|
|
2200
|
-
.home-hero-
|
|
2226
|
+
.home-hero .home-hero-summary,
|
|
2227
|
+
.home-hero .home-hero-summary p,
|
|
2228
|
+
.home-hero .home-hero-tagline {
|
|
2201
2229
|
color: #f0f0f0;
|
|
2202
2230
|
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
|
|
2203
2231
|
max-width: 100%;
|
|
2232
|
+
font-size: clamp(0.95rem, 1.15vw, 1.05rem);
|
|
2233
|
+
line-height: 1.45;
|
|
2204
2234
|
}
|
|
2205
2235
|
|
|
2206
2236
|
.home-hero-tagline::after {
|
|
@@ -2230,5 +2260,11 @@ html[data-theme="light"] .home-featured .ledger-poster {
|
|
|
2230
2260
|
.home-hero-actions .material-symbols-outlined {
|
|
2231
2261
|
color: #111;
|
|
2232
2262
|
}
|
|
2263
|
+
}
|
|
2233
2264
|
|
|
2265
|
+
/* Wider desktop: B3 @1440 ≈ 637×693 (w/h ≈ 0.92) */
|
|
2266
|
+
@media (min-width: 1280px) {
|
|
2267
|
+
.home-band--hero {
|
|
2268
|
+
aspect-ratio: 637 / 693;
|
|
2269
|
+
}
|
|
2234
2270
|
}
|
|
@@ -24,7 +24,7 @@ module Pandorga
|
|
|
24
24
|
|
|
25
25
|
gem "pandorga", "~> 2.0"
|
|
26
26
|
# Local checkout: gem "pandorga", path: "../pandorga"
|
|
27
|
-
# GitHub tag: gem "pandorga", github: "alexandrelheinen/pandorga", tag: "v2.3.
|
|
27
|
+
# GitHub tag: gem "pandorga", github: "alexandrelheinen/pandorga", tag: "v2.3.1"
|
|
28
28
|
gem "csv"
|
|
29
29
|
gem "base64"
|
|
30
30
|
RUBY
|
data/lib/pandorga/version.rb
CHANGED
|
@@ -302,8 +302,12 @@ end
|
|
|
302
302
|
if home_sheet.match?(/Cinzel/i) || home_sheet.include?("5.55")
|
|
303
303
|
errors << "assets/css/ledger/home.css must not contain Cinzel or obsolete 5.55 comments/divisors (PLT-AC-68)"
|
|
304
304
|
end
|
|
305
|
-
|
|
306
|
-
|
|
305
|
+
# Phone/base keep Ancizar 6.9; desktop CR-22.1 uses the approved B3 vw clamp.
|
|
306
|
+
unless home_sheet.include?("calc(100cqi * 0.92 / 6.9)")
|
|
307
|
+
errors << "assets/css/ledger/home.css: phone/base hero clamp must use Ancizar ~6.9 (PLT-AC-68)"
|
|
308
|
+
end
|
|
309
|
+
unless home_sheet.include?("calc(clamp(1.85rem, 2.6vw, 2.55rem) + 2pt)")
|
|
310
|
+
errors << "assets/css/ledger/home.css: desktop B3 name clamp missing (CR-22.1 / PLT-AC-86)"
|
|
307
311
|
end
|
|
308
312
|
|
|
309
313
|
# PLT-AC-69. Inventory / project logo icon font-sizes +2pt.
|
|
@@ -221,11 +221,11 @@ end
|
|
|
221
221
|
# ── 51.6 Name from 1024px ───────────────────────────────────────────────────
|
|
222
222
|
|
|
223
223
|
item(6) do
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
# CR-22.1: B3 desk name clamp (also declared on .home-hero-title)
|
|
225
|
+
title = ".home-hero-title"
|
|
226
226
|
expect_decl(title, "white-space", "nowrap", media: DESKTOP)
|
|
227
227
|
expect_decl(title, "font-size",
|
|
228
|
-
"calc(
|
|
228
|
+
"calc(clamp(1.85rem, 2.6vw, 2.55rem) + 2pt)",
|
|
229
229
|
media: DESKTOP)
|
|
230
230
|
end
|
|
231
231
|
|
|
@@ -145,7 +145,11 @@ check!(hero.include?("@media (min-width: 640px) and (max-width: 767px)"),
|
|
|
145
145
|
"missing 640-767 size query")
|
|
146
146
|
check!(hero.include?("calc(clamp(var(--type-section-lg), calc(100cqi * 0.92 / 6.9), var(--type-page-lg)) + 3pt)"),
|
|
147
147
|
"from 640px to 767px the name must be the section-lg clamp plus 3pt")
|
|
148
|
-
|
|
148
|
+
# CR-22.1 supersedes desktop --hero-name-fit 6.9 with the approved B3 clamp.
|
|
149
|
+
check!(css.include?("calc(clamp(1.85rem, 2.6vw, 2.55rem) + 2pt)"),
|
|
150
|
+
"desktop B3 name clamp must be present (CR-22.1)")
|
|
151
|
+
check!(css.include?("clamp(1.9rem, 7vw, 2.6rem)"),
|
|
152
|
+
"stack B3 name clamp must be present (CR-22.1)")
|
|
149
153
|
|
|
150
154
|
plain = hero.index("@media (min-width: 640px) {")
|
|
151
155
|
banded = hero.index("@media (min-width: 640px) and (max-width: 767px)")
|
|
@@ -512,13 +512,28 @@ const ASSERT_EXPRESSION = `
|
|
|
512
512
|
}
|
|
513
513
|
|
|
514
514
|
|
|
515
|
-
// CR-22 / PLT-AC-81…
|
|
515
|
+
// CR-22 / CR-22.1 / PLT-AC-81…87: B3 masthead, photo-bg, name fit, contrast, 16:9 plates
|
|
516
516
|
{
|
|
517
517
|
const hero = document.querySelector('.home-band--hero');
|
|
518
518
|
const proj = document.querySelector('.home-band[data-home-kind="portfolio"]');
|
|
519
519
|
const title = document.querySelector('.home-hero-title');
|
|
520
520
|
const actions = document.querySelector('.home-hero-actions');
|
|
521
521
|
const plateImg = document.querySelector('.home-hero-plate img');
|
|
522
|
+
const summary = document.querySelector('.home-hero-summary') || document.querySelector('.home-hero-summary p');
|
|
523
|
+
|
|
524
|
+
function parseRgb(c) {
|
|
525
|
+
if (!c) return null;
|
|
526
|
+
const m = String(c).match(/rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i);
|
|
527
|
+
if (!m) return null;
|
|
528
|
+
return { r: +m[1], g: +m[2], b: +m[3] };
|
|
529
|
+
}
|
|
530
|
+
function relLum({ r, g, b }) {
|
|
531
|
+
const f = (v) => {
|
|
532
|
+
v /= 255;
|
|
533
|
+
return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);
|
|
534
|
+
};
|
|
535
|
+
return 0.2126 * f(r) + 0.7152 * f(g) + 0.0722 * f(b);
|
|
536
|
+
}
|
|
522
537
|
|
|
523
538
|
if (hero && proj && window.innerWidth >= 1024) {
|
|
524
539
|
const ledger = document.querySelector('.home-ledger');
|
|
@@ -530,21 +545,16 @@ const ASSERT_EXPRESSION = `
|
|
|
530
545
|
if (delta > 1) {
|
|
531
546
|
errors.push('Projects left (' + pb.left.toFixed(1) + ') not within 1px of content mid (' + mid.toFixed(1) + ') Δ=' + delta.toFixed(1) + ' (PLT-AC-81)');
|
|
532
547
|
}
|
|
533
|
-
// Hero should occupy left half minus gutter (not wider than mid)
|
|
534
548
|
if (hb.right > mid + 1) {
|
|
535
549
|
errors.push('Hero right (' + hb.right.toFixed(1) + ') crosses content mid (' + mid.toFixed(1) + ') (PLT-AC-81)');
|
|
536
550
|
}
|
|
537
|
-
// Buttons on one line
|
|
538
551
|
if (actions) {
|
|
539
|
-
const tops = new Set([...actions.querySelectorAll('.ledger-cta, .home-hero-cta, a')].map(el => Math.round(el.getBoundingClientRect().top)));
|
|
540
|
-
// contacts slot may inject extra anchors — count visible CTA tops from direct actionable children
|
|
541
552
|
const ctas = [...actions.querySelectorAll(':scope > .ledger-cta, :scope > .home-hero-cta, :scope > span > .ledger-cta, :scope > span > a')];
|
|
542
553
|
const ctaTops = new Set(ctas.filter(el => el.getBoundingClientRect().width > 4).map(el => Math.round(el.getBoundingClientRect().top)));
|
|
543
554
|
if (ctaTops.size > 1) {
|
|
544
555
|
errors.push('Hero CTAs wrap to ' + ctaTops.size + ' rows at desktop; expected one line (PLT-AC-82)');
|
|
545
556
|
}
|
|
546
557
|
}
|
|
547
|
-
// Portrait is background (absolute covering hero)
|
|
548
558
|
const portrait = document.querySelector('.home-hero-portrait');
|
|
549
559
|
if (portrait) {
|
|
550
560
|
const pcs = getComputedStyle(portrait);
|
|
@@ -552,6 +562,28 @@ const ASSERT_EXPRESSION = `
|
|
|
552
562
|
errors.push('Hero portrait position is ' + pcs.position + ', expected absolute background (PLT-AC-82)');
|
|
553
563
|
}
|
|
554
564
|
}
|
|
565
|
+
|
|
566
|
+
// PLT-AC-86: name fits in panel; size near B3 (±4px)
|
|
567
|
+
if (title && hb.width > 40) {
|
|
568
|
+
const tr = title.getBoundingClientRect();
|
|
569
|
+
if (tr.right > hb.right + 1) {
|
|
570
|
+
errors.push('Hero name right (' + tr.right.toFixed(1) + ') past panel right (' + hb.right.toFixed(1) + ') (PLT-AC-86)');
|
|
571
|
+
}
|
|
572
|
+
const fs = parseFloat(getComputedStyle(title).fontSize);
|
|
573
|
+
const expect = window.innerWidth >= 1280 ? 40.11 : 35.23;
|
|
574
|
+
if (Math.abs(fs - expect) > 4) {
|
|
575
|
+
errors.push('Hero name font-size ' + fs.toFixed(2) + 'px not within 4px of B3 ' + expect + 'px (PLT-AC-86)');
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
// PLT-AC-87: hero panel aspect near B3
|
|
580
|
+
if (hb.height > 40) {
|
|
581
|
+
const ratio = hb.width / hb.height;
|
|
582
|
+
const expectR = window.innerWidth >= 1280 ? (637 / 693) : (454 / 736);
|
|
583
|
+
if (Math.abs(ratio - expectR) / expectR > 0.08) {
|
|
584
|
+
errors.push('Hero panel ratio ' + ratio.toFixed(3) + ' not within 8% of B3 ' + expectR.toFixed(3) + ' (PLT-AC-87)');
|
|
585
|
+
}
|
|
586
|
+
}
|
|
555
587
|
}
|
|
556
588
|
|
|
557
589
|
if (hero && window.innerWidth < 1024) {
|
|
@@ -573,13 +605,24 @@ const ASSERT_EXPRESSION = `
|
|
|
573
605
|
}
|
|
574
606
|
}
|
|
575
607
|
|
|
608
|
+
// Summary must be light on the photo (PLT-AC-86)
|
|
609
|
+
if (hero && summary) {
|
|
610
|
+
const col = getComputedStyle(summary).color;
|
|
611
|
+
const rgb = parseRgb(col);
|
|
612
|
+
if (rgb) {
|
|
613
|
+
const L = relLum(rgb);
|
|
614
|
+
if (L < 0.45) {
|
|
615
|
+
errors.push('Hero summary color luminance ' + L.toFixed(3) + ' < 0.45 (got ' + col + '); need light text on photo (PLT-AC-86)');
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
|
|
576
620
|
// Centered object-position on home crops (PLT-AC-85)
|
|
577
621
|
const cropImgs = document.querySelectorAll(
|
|
578
622
|
'.home-hero-plate img, .home-specimen-figure .ledger-poster img, .home-featured .ledger-poster img, .home-card-grid .ledger-poster img'
|
|
579
623
|
);
|
|
580
624
|
cropImgs.forEach((img, idx) => {
|
|
581
625
|
const op = getComputedStyle(img).objectPosition || '';
|
|
582
|
-
// Computed is typically "50% 50%" for center
|
|
583
626
|
const norm = op.trim().toLowerCase();
|
|
584
627
|
const ok = norm === 'center' || norm === '50% 50%' || /^50%\s+50%$/.test(norm);
|
|
585
628
|
if (!ok && img.getBoundingClientRect().width > 4) {
|
|
@@ -587,21 +630,29 @@ const ASSERT_EXPRESSION = `
|
|
|
587
630
|
}
|
|
588
631
|
});
|
|
589
632
|
|
|
633
|
+
// Home plates (not hero bg) must be 16:9 (PLT-AC-85 / plate rule)
|
|
634
|
+
const plates = document.querySelectorAll(
|
|
635
|
+
'.home-specimen-figure > .ledger-poster, .home-specimen-figure > .projects-plate, .home-featured .ledger-poster, .home-card-grid .ledger-poster'
|
|
636
|
+
);
|
|
637
|
+
plates.forEach((el, idx) => {
|
|
638
|
+
const r = el.getBoundingClientRect();
|
|
639
|
+
if (r.width < 8 || r.height < 8) return;
|
|
640
|
+
const ratio = r.width / r.height;
|
|
641
|
+
if (Math.abs(ratio - 16 / 9) / (16 / 9) > 0.03) {
|
|
642
|
+
errors.push('Home plate #' + idx + ' ratio ' + ratio.toFixed(3) + ' not 16:9 ±3% (PLT-AC-85)');
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
|
|
590
646
|
// Spotlight overlay present on portrait
|
|
591
647
|
if (hero) {
|
|
592
648
|
const portrait = document.querySelector('.home-hero-portrait');
|
|
593
649
|
if (portrait) {
|
|
594
650
|
const after = getComputedStyle(portrait, '::after');
|
|
595
|
-
if (!after || after.content === 'none' || after.content === '') {
|
|
596
|
-
// some engines report content as '""' for empty string content
|
|
597
|
-
}
|
|
598
651
|
const bg = after && after.backgroundImage;
|
|
599
652
|
if (bg && bg !== 'none') {
|
|
600
653
|
if (!/radial-gradient/i.test(bg)) {
|
|
601
654
|
errors.push('Hero spotlight ::after missing radial-gradient (PLT-AC-84)');
|
|
602
655
|
} else {
|
|
603
|
-
// Chromium often omits the default center ("at 50% 50%") when serializing.
|
|
604
|
-
// Fail only on an explicit non-center position keyword.
|
|
605
656
|
const atMatch = bg.match(/radial-gradient\([^)]*?\bat\s+([^,\)]+)/i);
|
|
606
657
|
if (atMatch) {
|
|
607
658
|
const pos = atMatch[1].trim().toLowerCase().replace(/\s+/g, ' ');
|
|
@@ -610,13 +661,13 @@ const ASSERT_EXPRESSION = `
|
|
|
610
661
|
errors.push('Hero spotlight radial at "' + atMatch[1].trim() + '", expected 50% 50% (PLT-AC-84)');
|
|
611
662
|
}
|
|
612
663
|
}
|
|
613
|
-
// No "at …" ⇒ engine default center — OK (source CSS has at 50% 50%).
|
|
614
664
|
}
|
|
615
665
|
}
|
|
616
666
|
}
|
|
617
667
|
}
|
|
618
668
|
}
|
|
619
669
|
|
|
670
|
+
|
|
620
671
|
return { errors };
|
|
621
672
|
})()
|
|
622
673
|
`;
|