@luhtech/site-template 0.2.4 → 0.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.
package/README.md CHANGED
@@ -27,7 +27,11 @@ site with no way to supply one (GTM-L3 G1.4-R, 2026-09-08).
27
27
  renders nav from `site.nav`, footer from `site.footer.legalLine` +
28
28
  `parentHref`, and `<head>` from `page.seo` (title, description, og:\*,
29
29
  twitter:\*). `og:image`'s "must not be a staging host" rule is enforced by
30
- the schema itself, not this layout.
30
+ the schema itself, not this layout. Stamps `<html class="no-js">` and
31
+ removes it via an inline script before paint (fixed 0.3.0) --
32
+ `[data-reveal]` sections rely on a `.no-js [data-reveal]{opacity:1}`
33
+ fallback rule in each consumer's own `global.css` in case the deferred
34
+ reveal script fails to load; that rule had nothing to key off before this.
31
35
  - **`<Section section={s} />`** (`@luhtech/site-template/components/Section.astro`)
32
36
  dispatches on `sectionKind` to one component per kind: `Hero`, `Problem`,
33
37
  `Approach`, `Proof`, `Audiences`, `Open`, `Status`, `Sources`, `Cta`,
@@ -35,7 +39,28 @@ site with no way to supply one (GTM-L3 G1.4-R, 2026-09-08).
35
39
  `blockType` via the shared `Block` component; `figures[]` render with
36
40
  `provenance.sourceRef` (in `Sources`); `crossLinks[]` render as name +
37
41
  relationshipLine + href -- the one schema-legal way a page names a
38
- sibling brand.
42
+ sibling brand -- **for every `sectionKind`, generically**, not just
43
+ `open` (fixed 0.3.0: `about.json`/`insights.json`'s `crossLinks` entries
44
+ on `hero`/`proof` sections were silently invisible before this).
45
+ - **`<SplashHero {...} />`** (`@luhtech/site-template/components/SplashHero.astro`)
46
+ -- a trigger-flow hero: full-bleed photo, a one-time splash intro on load
47
+ (wireframe wordmark -> white-fill wave -> fly-out into the real nav logo's
48
+ on-screen position, measured at play time), then never repeats for that
49
+ session (`sessionStorage`, keyed by your own `sessionKey` so two on one
50
+ origin don't collide). Lifted out of Ectropy's own hand-built splash
51
+ (2026-09-03) into a real, parameterized component: photo, wordmark SVG
52
+ markup + viewBox, heading/lede/eyebrow/ctas, an optional drifting
53
+ background data-text layer, and the nav-logo fly-out target selector are
54
+ all props -- the motion mechanics (timing, reduced-motion handling,
55
+ fly-out math) are fixed and proven live. `heading`/`lede` are meant to
56
+ carry the same `brand.identity.tagline`/`oneLiner` values
57
+ `applyBrandDefaults()` binds onto a standard `Hero` section on `/` -- this
58
+ is a presentation alternative to `Hero`, not a different binding rule; a
59
+ consumer still calls `applyBrandDefaults()` and reads the result. Use it
60
+ in place of `<Section>` for the `hero`-kind section only, rendering the
61
+ rest of `page.sections` (filtered to exclude that one) through `<Section>`
62
+ as usual. See `~/dev/luhtech/Ectropy-Business/apps/marketing-site/src/pages/index.astro`
63
+ for the reference consumer.
39
64
  - **`loadBrand(path)`** (`@luhtech/site-template/content`) reads a
40
65
  `content/brand/<venture>.json` file and ajv-validates it against the live,
41
66
  version-pinned `portfolio/brand-identity.schema.json`. Mirrors
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luhtech/site-template",
3
- "version": "0.2.4",
3
+ "version": "0.3.1",
4
4
  "description": "Shared Astro component library + content-instance contract for LuhTech venture marketing sites -- one template renders every site from content/page.schema.json + content/site.schema.json instances.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -16,6 +16,7 @@ import Status from './sections/Status.astro';
16
16
  import Sources from './sections/Sources.astro';
17
17
  import Cta from './sections/Cta.astro';
18
18
  import Legal from './sections/Legal.astro';
19
+ import CrossLink from './CrossLink.astro';
19
20
 
20
21
  const SECTION_COMPONENTS: Record<string, any> = {
21
22
  hero: Hero,
@@ -46,3 +47,17 @@ if (!Component) {
46
47
  ) : (
47
48
  <Component section={section} />
48
49
  )}
50
+ {
51
+ // crossLinks[] is schema-legal on any section kind (not sectionKind-
52
+ // specific), so it renders once here rather than requiring every
53
+ // individual sections/*.astro component to remember to. Found live:
54
+ // about.json/insights.json's crossLinks entries (hero/proof kinds)
55
+ // were silently invisible before this fix -- only Open.astro rendered
56
+ // them. Open.astro's own inline rendering was removed to avoid a
57
+ // double-render now that this is the single path.
58
+ section.crossLinks?.length > 0 && (
59
+ <div class="grid gap-3 sm:grid-cols-2 mt-4" data-reveal>
60
+ {section.crossLinks.map((cl: any) => <CrossLink crossLink={cl} />)}
61
+ </div>
62
+ )
63
+ }
@@ -0,0 +1,272 @@
1
+ ---
2
+ // A trigger-flow hero: a full-bleed photo hero plays a one-time splash
3
+ // intro on load (wireframe -> white-fill wave -> fly-out into the nav
4
+ // logo's real on-screen position), then never repeats for that session.
5
+ // Lifted out of Ectropy's own hand-built index.astro (2026-09-03 v2, its
6
+ // own header comment explains the motion design rationale) into a real,
7
+ // parameterized component so any venture's landing page can opt into the
8
+ // same trigger pattern with its own photo/wordmark/copy/session key --
9
+ // not a one-off, not copy-pasted per site.
10
+ //
11
+ // What's fixed (the motion mechanics, proven live on ectropy.ai): two
12
+ // independent fixed layers (overlay shade + wordmark), stage timing,
13
+ // reduced-motion / sessionStorage-repeat handling, the fly-out math
14
+ // (measured against the real nav-logo rect at play time, not a guessed
15
+ // offset). What's parameterized: the photo, the wordmark SVG markup +
16
+ // viewBox, the heading/lede/eyebrow/ctas, the session key (so two splash
17
+ // heroes on the same origin -- e.g. a future article-landing variant --
18
+ // don't collide), the nav-logo target selector, and the optional
19
+ // drifting background data-text lines.
20
+ //
21
+ // heading/lede are meant to carry the SAME brand.identity.tagline/
22
+ // oneLiner values applyBrandDefaults() binds onto a standard Hero
23
+ // section on "/" -- this component is a presentation alternative to
24
+ // Hero.astro for a page that wants the trigger-flow treatment, not a
25
+ // different binding rule. A consumer still calls applyBrandDefaults()
26
+ // and reads heading/lede off the result the same way.
27
+ import CtaLink from './CtaLink.astro';
28
+
29
+ export interface Props {
30
+ photoSrc: string;
31
+ photoAlt: string;
32
+ eyebrow?: string;
33
+ heading: string;
34
+ lede: string;
35
+ ctas?: Array<{ label: string; href: string; intent: string }>;
36
+ /** Raw <polygon>/<path> markup for the wordmark SVG (no outer <svg> tag). */
37
+ wordmarkMarkup: string;
38
+ /** viewBox for the wordmark <svg>, e.g. "-50 -50 1100 286". */
39
+ wordmarkViewBox: string;
40
+ wordmarkAriaLabel: string;
41
+ /** Unique per venture/page -- sessionStorage key so the splash plays once per session, independently of any other SplashHero on the same origin. */
42
+ sessionKey: string;
43
+ /** CSS selector for the fly-out landing target, evaluated at play time. Default matches SiteLayout's own nav logo anchor. */
44
+ navLogoSelector?: string;
45
+ /** Optional drifting background data-text layer -- real, venture-specific short strings (not decorative lorem), low-opacity texture behind the hero copy. Omit to skip the layer entirely. */
46
+ dataLines?: string[];
47
+ }
48
+
49
+ const {
50
+ photoSrc,
51
+ photoAlt,
52
+ eyebrow,
53
+ heading,
54
+ lede,
55
+ ctas = [],
56
+ wordmarkMarkup,
57
+ wordmarkViewBox,
58
+ wordmarkAriaLabel,
59
+ sessionKey,
60
+ navLogoSelector = 'header a[href="/"]',
61
+ dataLines = [],
62
+ } = Astro.props;
63
+
64
+ const rowPositions = [4, 24, 40, 62, 80, 96];
65
+ ---
66
+ <section class="relative w-full h-[85vh] min-h-[520px] overflow-hidden hero-motion" id="hero">
67
+ <img src={photoSrc} alt={photoAlt} width="1376" height="768" class="absolute inset-0 w-full h-full object-cover" />
68
+ <div class="absolute inset-0 hero-gradient"></div>
69
+ {dataLines.length > 0 && (
70
+ <div class="absolute -inset-[10%] hero-datatext" id={`hero-datatext-${sessionKey}`} aria-hidden="true"></div>
71
+ )}
72
+ <div class="relative z-10 h-full flex flex-col items-start justify-end pb-20 px-6 sm:px-10 max-w-3xl mx-auto w-full">
73
+ <div class="flex items-start gap-4 sm:gap-5">
74
+ <span class="hero-rule w-0.5 self-stretch rounded-full mt-1" aria-hidden="true"></span>
75
+ <div>
76
+ {eyebrow && (
77
+ <p class="font-mono text-xs sm:text-sm tracking-[0.14em] uppercase text-accent-secondary mb-3">{eyebrow}</p>
78
+ )}
79
+ <h1 class="font-display text-4xl sm:text-5xl md:text-6xl font-semibold text-canvas leading-[1.12]">{heading}</h1>
80
+ </div>
81
+ </div>
82
+ <p class="mt-5 text-lg text-canvas/85 max-w-2xl">{lede}</p>
83
+ {ctas.length > 0 && (
84
+ <div class="mt-8 flex gap-4">
85
+ {ctas.map((cta, i) => <CtaLink cta={cta} variant={i === 0 ? 'primary' : 'secondary'} />)}
86
+ </div>
87
+ )}
88
+ </div>
89
+ </section>
90
+ <!-- Two independent fixed layers, not nested: the overlay's own "lift up"
91
+ exit transform would otherwise become the containing block for the
92
+ wordmark's fixed-position fly-out, compounding the two motions
93
+ together instead of letting them animate independently toward two
94
+ different targets. -->
95
+ <div class="splash-overlay" id={`splash-overlay-${sessionKey}`}></div>
96
+ <div class="splash-wordmark-wrap" id={`splash-wordmark-wrap-${sessionKey}`}>
97
+ <svg
98
+ class="splash-wordmark"
99
+ id={`splash-wordmark-${sessionKey}`}
100
+ xmlns="http://www.w3.org/2000/svg"
101
+ viewBox={wordmarkViewBox}
102
+ role="img"
103
+ aria-label={wordmarkAriaLabel}
104
+ set:html={wordmarkMarkup}
105
+ />
106
+ </div>
107
+
108
+ <style>
109
+ .hero-gradient{
110
+ background:
111
+ linear-gradient(to top, rgba(13,13,13,0.92) 0%, rgba(13,13,13,0.55) 35%, rgba(13,13,13,0.15) 65%, rgba(13,13,13,0.35) 100%),
112
+ linear-gradient(120deg, rgba(30,58,138,0.25), rgba(13,13,13,0) 55%);
113
+ }
114
+ .hero-datatext{
115
+ pointer-events: none;
116
+ overflow: hidden;
117
+ mix-blend-mode: overlay;
118
+ font-family: "JetBrains Mono", monospace;
119
+ font-size: 12px;
120
+ line-height: 1.9;
121
+ color: #BFD3F5;
122
+ white-space: pre;
123
+ letter-spacing: 0.02em;
124
+ }
125
+ .hero-datatext :global(.row){
126
+ display: block;
127
+ position: absolute;
128
+ left: 0;
129
+ white-space: nowrap;
130
+ animation: hero-drift linear infinite;
131
+ }
132
+ @keyframes hero-drift{ from{ transform: translateX(0); } to{ transform: translateX(-50%); } }
133
+
134
+ .hero-rule{ background: var(--color-accent-secondary); }
135
+
136
+ .splash-overlay{
137
+ position: fixed;
138
+ inset: 0;
139
+ z-index: 100;
140
+ background: radial-gradient(ellipse at 50% 45%, rgba(20,28,48,0.55) 0%, rgba(8,9,12,0.7) 75%);
141
+ transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
142
+ }
143
+ .splash-overlay.hide{
144
+ transform: translateY(-100%);
145
+ pointer-events: none;
146
+ }
147
+ .splash-wordmark-wrap{
148
+ position: fixed;
149
+ inset: 0;
150
+ z-index: 101;
151
+ display: flex;
152
+ align-items: center;
153
+ justify-content: center;
154
+ pointer-events: none;
155
+ }
156
+ .splash-wordmark{ width: min(640px, 80vw); height: auto; overflow: visible; }
157
+ .splash-wordmark :global(polygon),
158
+ .splash-wordmark :global(path){
159
+ fill: #FFFFFF;
160
+ fill-opacity: 0;
161
+ stroke: #FFFFFF;
162
+ stroke-opacity: 0;
163
+ transition: stroke-opacity 0.6s ease-out,
164
+ fill-opacity 1s ease-out var(--fill-delay, 0s);
165
+ }
166
+ .splash-wordmark.wireframe :global(polygon),
167
+ .splash-wordmark.wireframe :global(path){ stroke-opacity: 0.9; }
168
+ .splash-wordmark.filled :global(polygon),
169
+ .splash-wordmark.filled :global(path){ stroke-opacity: 1; fill-opacity: 1; }
170
+ .splash-wordmark.fly-out{
171
+ transform-origin: top left;
172
+ transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
173
+ }
174
+
175
+ @media (prefers-reduced-motion: reduce){
176
+ .hero-datatext :global(.row){ animation: none !important; transition: none !important; }
177
+ .splash-overlay, .splash-wordmark-wrap{ display: none !important; }
178
+ }
179
+ </style>
180
+
181
+ <script define:vars={{ sessionKey, navLogoSelector, dataLines, rowPositions }}>
182
+ if (dataLines.length > 0) {
183
+ const datatext = document.getElementById(`hero-datatext-${sessionKey}`);
184
+ if (datatext) {
185
+ rowPositions.forEach((topPct, r) => {
186
+ const row = document.createElement('span');
187
+ row.className = 'row';
188
+ row.style.top = topPct + '%';
189
+ row.style.opacity = String(0.5 + (r % 3) * 0.15);
190
+ const text = dataLines[r % dataLines.length];
191
+ row.textContent = (text + ' ').repeat(5);
192
+ row.style.animationDuration = (55 + r * 9) + 's';
193
+ row.style.animationDirection = r % 2 ? 'reverse' : 'normal';
194
+ datatext.appendChild(row);
195
+ });
196
+ }
197
+ }
198
+
199
+ // Splash intro: wireframe -> white fill wave -> fly out to the nav
200
+ // logo's real position. Each polygon/path needs a data-cx attribute
201
+ // (real horizontal centroid) to drive the wave direction -- markup
202
+ // without it just fills on a single beat instead of a wave, which is
203
+ // still a correct (if less dramatic) fallback, not a broken state.
204
+ // Plays once per session (sessionStorage, keyed by sessionKey),
205
+ // skipped entirely under reduced-motion.
206
+ const SEEN_KEY = `splash-seen-${sessionKey}`;
207
+ const splash = document.getElementById(`splash-overlay-${sessionKey}`);
208
+ const wordmarkWrap = document.getElementById(`splash-wordmark-wrap-${sessionKey}`);
209
+ const wordmark = document.getElementById(`splash-wordmark-${sessionKey}`);
210
+ const navLogo = navLogoSelector ? document.querySelector(navLogoSelector) : null;
211
+
212
+ function skipSplash() {
213
+ if (splash) splash.style.display = 'none';
214
+ if (wordmarkWrap) wordmarkWrap.style.display = 'none';
215
+ }
216
+
217
+ let alreadySeen = false;
218
+ try {
219
+ alreadySeen = sessionStorage.getItem(SEEN_KEY) === '1';
220
+ } catch {
221
+ // sessionStorage unavailable (private mode, etc) -- fail open and play the splash
222
+ }
223
+
224
+ if (
225
+ splash && wordmarkWrap && wordmark && !alreadySeen &&
226
+ !window.matchMedia('(prefers-reduced-motion: reduce)').matches
227
+ ) {
228
+ try { sessionStorage.setItem(SEEN_KEY, '1'); } catch {}
229
+
230
+ if (navLogo) navLogo.style.opacity = '0';
231
+
232
+ const polys = [...wordmark.querySelectorAll('polygon, path')];
233
+ const xs = polys.map((p) => parseFloat(p.dataset.cx || '0'));
234
+ const xmin = Math.min(...xs);
235
+ const xmax = Math.max(...xs);
236
+ const range = xmax - xmin || 1;
237
+ const WAVE_MS = 1600;
238
+ polys.forEach((p, i) => {
239
+ const t = (xs[i] - xmin) / range;
240
+ p.style.setProperty('--fill-delay', t * WAVE_MS + 'ms');
241
+ });
242
+ const FILL_DONE = 500 + WAVE_MS + 1000;
243
+ const HOLD_MS = 700;
244
+ const EXIT_MS = 800;
245
+
246
+ requestAnimationFrame(() => wordmark.classList.add('wireframe'));
247
+ setTimeout(() => wordmark.classList.add('filled'), 500);
248
+
249
+ setTimeout(() => {
250
+ if (navLogo) {
251
+ const navRect = navLogo.getBoundingClientRect();
252
+ const wmRect = wordmark.getBoundingClientRect();
253
+ if (navRect.width > 0 && wmRect.width > 0) {
254
+ const scale = navRect.width / wmRect.width;
255
+ const dx = navRect.left - wmRect.left;
256
+ const dy = navRect.top - wmRect.top;
257
+ wordmark.classList.add('fly-out');
258
+ wordmark.style.transform = `translate(${dx}px, ${dy}px) scale(${scale})`;
259
+ }
260
+ }
261
+ splash.classList.add('hide');
262
+ }, FILL_DONE + HOLD_MS);
263
+
264
+ setTimeout(() => {
265
+ if (navLogo) navLogo.style.opacity = '';
266
+ skipSplash();
267
+ }, FILL_DONE + HOLD_MS + EXIT_MS);
268
+ } else {
269
+ if (navLogo) navLogo.style.opacity = '';
270
+ skipSplash();
271
+ }
272
+ </script>
@@ -1,9 +1,8 @@
1
1
  ---
2
- // sectionKind: open -- open-standards/open-core statement. crossLinks are
3
- // the schema-legal way this section names a sibling brand its openness
4
- // connects to.
2
+ // sectionKind: open -- open-standards/open-core statement. crossLinks
3
+ // (the schema-legal way a section names a sibling brand) render once,
4
+ // generically, for every sectionKind -- see Section.astro.
5
5
  import Block from '../Block.astro';
6
- import CrossLink from '../CrossLink.astro';
7
6
 
8
7
  export interface Props { section: any }
9
8
  const { section } = Astro.props;
@@ -13,9 +12,4 @@ const { section } = Astro.props;
13
12
  {section.heading && <h2 class="font-display text-2xl font-bold mb-3">{section.heading}</h2>}
14
13
  {section.subheading && <p class="text-ink/80 max-w-2xl mb-4">{section.subheading}</p>}
15
14
  {section.blocks?.map((b: any) => <Block block={b} class="mb-3" />)}
16
- {section.crossLinks?.length > 0 && (
17
- <div class="grid gap-3 sm:grid-cols-2 mt-4">
18
- {section.crossLinks.map((cl: any) => <CrossLink crossLink={cl} />)}
19
- </div>
20
- )}
21
15
  </section>
@@ -31,7 +31,58 @@ async function buildValidator() {
31
31
  return ajv.compile(pageSchema as object);
32
32
  }
33
33
 
34
+ export interface PageBlock {
35
+ blockType: string;
36
+ text: string;
37
+ label?: string;
38
+ }
39
+
40
+ export interface PageClaim {
41
+ claimId: string;
42
+ kind: string;
43
+ text: string;
44
+ featureRef?: string;
45
+ sourcedStatus?: string;
46
+ }
47
+
48
+ export interface PageCta {
49
+ label: string;
50
+ href: string;
51
+ intent: string;
52
+ }
53
+
54
+ export interface PageCrossLink {
55
+ brandRef: string;
56
+ relationshipLine: string;
57
+ href: string;
58
+ }
59
+
60
+ export interface PageSection {
61
+ sectionId: string;
62
+ sectionKind: string;
63
+ heading?: string;
64
+ subheading?: string;
65
+ eyebrow?: string;
66
+ blocks?: PageBlock[];
67
+ claims?: PageClaim[];
68
+ ctas?: PageCta[];
69
+ crossLinks?: PageCrossLink[];
70
+ figures?: unknown[];
71
+ [key: string]: unknown;
72
+ }
73
+
74
+ /**
75
+ * `sections` is typed as a real array (not the bare index signature's
76
+ * `unknown`) so a consumer's `page.sections.map(...)` typechecks without
77
+ * a local cast -- found live migrating Ectropy/JobsiteControl/Qullqa/
78
+ * Siltana to this package: `astro check` failed ts(18046) on every one
79
+ * of them ("'page.sections' is of type 'unknown'"), each independently
80
+ * patched with its own `(s: any)` workaround before this fix landed.
81
+ * Other top-level fields stay on the index signature -- only the one
82
+ * every consumer actually iterates gets a real type.
83
+ */
34
84
  export interface LoadedPage {
85
+ sections: PageSection[];
35
86
  [key: string]: unknown;
36
87
  }
37
88
 
@@ -32,10 +32,11 @@ const nav =
32
32
  ? [...rawNav, HOLDING_NAV_ITEM]
33
33
  : rawNav;
34
34
  ---
35
- <html lang="en">
35
+ <html lang="en" class="no-js">
36
36
  <head>
37
37
  <meta charset="utf-8" />
38
38
  <meta name="viewport" content="width=device-width, initial-scale=1" />
39
+ <script is:inline>document.documentElement.classList.remove('no-js');</script>
39
40
  <title>{seo.title}</title>
40
41
  <meta name="description" content={seo.description} />
41
42
  {seo.noindex && <meta name="robots" content="noindex, nofollow" />}