@luhtech/site-template 0.6.1 → 0.7.0
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 +74 -0
- package/package.json +3 -2
- package/src/components/Block.astro +47 -6
- package/src/components/Icon.astro +51 -47
- package/src/components/sections/Article.astro +14 -9
- package/src/components/sections/Proof.astro +6 -2
- package/src/content/loadPage.ts +10 -2
- package/src/layouts/SiteLayout.astro +22 -1
package/README.md
CHANGED
|
@@ -262,6 +262,80 @@ switches to a red dashed stroke with an explicit "at a loss" label --
|
|
|
262
262
|
computed from the same real props, not a second data path to keep in
|
|
263
263
|
sync.
|
|
264
264
|
|
|
265
|
+
## data-reveal: on-screen content never waits on a scroll (0.6.2)
|
|
266
|
+
|
|
267
|
+
Real user report: a page's `/insights/` index looked genuinely blank on
|
|
268
|
+
first load at common laptop viewport heights. Root cause: `[data-reveal]`
|
|
269
|
+
sections default to `opacity:0` and only reveal once
|
|
270
|
+
`SiteLayout.astro`'s `IntersectionObserver` fires -- but that callback is
|
|
271
|
+
async (next frame, not synchronous with paint), and any section whose top
|
|
272
|
+
sits close to the fold could read as "just never revealed" rather than
|
|
273
|
+
"will reveal in a moment." `fullPage` Playwright screenshots (used during
|
|
274
|
+
this session's own local review) scroll through the whole page and
|
|
275
|
+
mask this exact failure mode -- a real gap in that verification, not
|
|
276
|
+
just the bug itself.
|
|
277
|
+
|
|
278
|
+
The reveal script now checks each `[data-reveal]` element's real bounding
|
|
279
|
+
rect at setup time: anything already on screen (or within 10% of the
|
|
280
|
+
viewport height below it) reveals immediately, synchronously, no observer
|
|
281
|
+
round-trip. Only genuinely below-the-fold sections keep the scroll-
|
|
282
|
+
triggered fade-in. Same visual result for content that was always meant
|
|
283
|
+
to animate in on scroll; content already visible at load is now
|
|
284
|
+
guaranteed visible at load.
|
|
285
|
+
|
|
286
|
+
## One real icon family, and diagrams that sit where they're authored (0.7.0)
|
|
287
|
+
|
|
288
|
+
Two real, related gaps found in live local review, fixed together
|
|
289
|
+
(d-2026-09-09-sr-inline-diagram-image-blocks): a section's `diagrams[]`
|
|
290
|
+
always rendered as one group after every body block, never next to the
|
|
291
|
+
paragraph each one actually illustrates; and `Icon.astro` was 26
|
|
292
|
+
hand-drawn inline SVGs, forked verbatim into LuhTech-Business as its own
|
|
293
|
+
duplicate copy, with only 2 of 11 `sectionKind` components wiring icon
|
|
294
|
+
support in at all.
|
|
295
|
+
|
|
296
|
+
**`content/page.schema.json` v1.3.0** (additive) gives `block` two new
|
|
297
|
+
`blockType` values: `diagram` (required `diagramId`, resolved against
|
|
298
|
+
this same section's own `diagrams[]` -- the block is a position, `diagrams[]`
|
|
299
|
+
stays the data) and `image` (required `src`+`alt`, optional `caption` --
|
|
300
|
+
the first real mechanism for a photo to appear inline in an article body
|
|
301
|
+
at all). Existing instances validate unchanged; `PAGE_PIN` bumped to
|
|
302
|
+
`1.3.0`.
|
|
303
|
+
|
|
304
|
+
**`Block.astro`** renders both: `diagram` dispatches to `Diagram.astro`
|
|
305
|
+
after resolving `diagramId` against a new `diagrams` prop -- a dangling
|
|
306
|
+
id throws at build time rather than silently rendering nothing, the same
|
|
307
|
+
"raised loudly, never silently dropped" discipline business-tools' own
|
|
308
|
+
chunk parser already applies to a stray `::figure`. `image` renders a
|
|
309
|
+
real `<figure>`/`<img>`/`<figcaption>`. `sections/Article.astro` no
|
|
310
|
+
longer renders `diagrams[]` as one trailing block after the prose --
|
|
311
|
+
every block (including `diagram`) renders in a single ordered pass, and
|
|
312
|
+
any diagram genuinely *not* referenced by a block still renders in a
|
|
313
|
+
fallback strip at the end, so authored data is never silently dropped.
|
|
314
|
+
The `href`-wrap mechanism `Block.astro` already had gets real link
|
|
315
|
+
styling: hover underline-offset, and an `https://` href (always a link
|
|
316
|
+
leaving this venture's own site, per the schema's own href pattern)
|
|
317
|
+
opens in a new tab with a small external-link marker.
|
|
318
|
+
|
|
319
|
+
**`Icon.astro`** is now a thin wrapper over `@lucide/astro` (new
|
|
320
|
+
dependency, ~1,800 real maintained icons, ISC, official Astro package)
|
|
321
|
+
instead of a hand-rolled `Record<string,string>` of raw SVG path data.
|
|
322
|
+
All 26 existing keys map to their real, confirmed Lucide equivalents
|
|
323
|
+
(verified against the installed package's own icon files, not guessed);
|
|
324
|
+
`crane` has no literal match in Lucide's catalog, so `hammer` is used as
|
|
325
|
+
a disclosed, closest-real substitute. The public `name: string` prop
|
|
326
|
+
contract is unchanged -- an unknown name still renders nothing rather
|
|
327
|
+
than failing the build. `sections/Proof.astro` (the one `sectionKind`
|
|
328
|
+
that visibly wanted a heading icon and had none wired) now reads
|
|
329
|
+
`icons.section[section.sectionId]`, same convention `Open.astro` already
|
|
330
|
+
used.
|
|
331
|
+
|
|
332
|
+
A `tsconfig.json` was added (this repo had none) extending
|
|
333
|
+
`astro/tsconfigs/base` -- required so TypeScript can resolve
|
|
334
|
+
`@lucide/astro`'s extensionless, `.ts`-native exports via `moduleResolution:
|
|
335
|
+
"Bundler"`; incidentally also cleared 24 pre-existing implicit-`any`
|
|
336
|
+
diagnostics across `ToolCalculator.astro` and the diagram components that
|
|
337
|
+
the repo's prior no-tsconfig default resolution wasn't catching.
|
|
338
|
+
|
|
265
339
|
## Migrating a venture site
|
|
266
340
|
|
|
267
341
|
A migration is: author `content/site.<venture>.json` + `content/pages/*.json`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luhtech/site-template",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
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",
|
|
@@ -36,12 +36,13 @@
|
|
|
36
36
|
"tailwindcss": "^4"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
+
"@lucide/astro": "^1.42.0",
|
|
39
40
|
"ajv": "^8.17.1",
|
|
40
41
|
"ajv-formats": "^3.0.1"
|
|
41
42
|
},
|
|
42
43
|
"luhtech": {
|
|
43
44
|
"schemaPins": {
|
|
44
|
-
"content/page.schema.json": "1.
|
|
45
|
+
"content/page.schema.json": "1.3.0",
|
|
45
46
|
"content/site.schema.json": "1.0.0",
|
|
46
47
|
"content/capability-claim.schema.json": "0.2.0",
|
|
47
48
|
"content/tool.schema.json": "1.1.0",
|
|
@@ -12,20 +12,51 @@
|
|
|
12
12
|
// concluding paragraph, same semantics as paragraph, styled with a top
|
|
13
13
|
// rule to read as the piece's final beat.
|
|
14
14
|
//
|
|
15
|
-
//
|
|
15
|
+
// diagram/image added v1.3.0 (d-2026-09-09-sr-inline-diagram-image-blocks):
|
|
16
|
+
// diagram is a positioned reference into this same section's own
|
|
17
|
+
// diagrams[] -- a dangling diagramId is a real authoring error, surfaced
|
|
18
|
+
// as a build failure rather than silently skipped (same discipline
|
|
19
|
+
// business-tools' own chunk parser already applies to a stray ::figure).
|
|
20
|
+
// image is the first real mechanism for a photo/asset to appear inline
|
|
21
|
+
// in an article body at all.
|
|
22
|
+
//
|
|
23
|
+
// href (v1.1.0) makes the whole rendered block a real link -- an
|
|
16
24
|
// audiences-section card pointing at a market-specific page, or an
|
|
17
25
|
// article-list entry pointing at that article's own page. Wraps
|
|
18
26
|
// whatever the blockType already renders in an outer <a>, so link
|
|
19
27
|
// behavior is uniform across every blockType without each needing its
|
|
20
|
-
// own href-aware markup.
|
|
28
|
+
// own href-aware markup. An https:// href is always a link leaving this
|
|
29
|
+
// venture's own site (the schema's own href pattern reserves bare "/"
|
|
30
|
+
// and "#" paths for same-site) -- it opens in a new tab and gets a
|
|
31
|
+
// small external-link marker, the "nice links" treatment.
|
|
32
|
+
import Diagram from './Diagram.astro';
|
|
33
|
+
import Icon from './Icon.astro';
|
|
34
|
+
|
|
21
35
|
export interface Props {
|
|
22
|
-
block: { blockType: string; text
|
|
36
|
+
block: { blockType: string; text?: string; label?: string; href?: string; diagramId?: string; src?: string; alt?: string; caption?: string };
|
|
37
|
+
// This section's own diagrams[] array, only needed when block.blockType
|
|
38
|
+
// is "diagram" -- the block is a position, diagrams[] stays the data.
|
|
39
|
+
diagrams?: { diagramId: string; diagramType: string; caption?: string; data: any }[];
|
|
23
40
|
class?: string;
|
|
24
41
|
}
|
|
25
|
-
const { block, class: className = '' } = Astro.props;
|
|
26
|
-
const items = block.blockType === 'list' ? block.text.split('\n').filter(Boolean) : [];
|
|
42
|
+
const { block, diagrams = [], class: className = '' } = Astro.props;
|
|
43
|
+
const items = block.blockType === 'list' ? (block.text ?? '').split('\n').filter(Boolean) : [];
|
|
44
|
+
const isExternalLink = typeof block.href === 'string' && block.href.startsWith('https://');
|
|
27
45
|
const Wrapper = block.href ? 'a' : Fragment;
|
|
28
|
-
const wrapperProps = block.href
|
|
46
|
+
const wrapperProps = block.href
|
|
47
|
+
? {
|
|
48
|
+
href: block.href,
|
|
49
|
+
class: 'block no-underline hover:underline hover:underline-offset-4 decoration-accent-primary/50 transition-colors',
|
|
50
|
+
...(isExternalLink ? { target: '_blank', rel: 'noopener noreferrer' } : {}),
|
|
51
|
+
}
|
|
52
|
+
: {};
|
|
53
|
+
let resolvedDiagram;
|
|
54
|
+
if (block.blockType === 'diagram') {
|
|
55
|
+
resolvedDiagram = diagrams.find((d) => d.diagramId === block.diagramId);
|
|
56
|
+
if (!resolvedDiagram) {
|
|
57
|
+
throw new Error(`Block references diagramId "${block.diagramId}" not present in this section's diagrams[]`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
29
60
|
---
|
|
30
61
|
<Wrapper {...wrapperProps}>
|
|
31
62
|
{block.blockType === 'paragraph' && (
|
|
@@ -59,4 +90,14 @@ const wrapperProps = block.href ? { href: block.href, class: 'block no-underline
|
|
|
59
90
|
{block.blockType === 'close' && (
|
|
60
91
|
<p class={`leading-relaxed border-t border-ink/10 pt-6 ${className}`}>{block.text}</p>
|
|
61
92
|
)}
|
|
93
|
+
{block.blockType === 'diagram' && resolvedDiagram && <Diagram diagram={resolvedDiagram} class={`my-8 ${className}`} />}
|
|
94
|
+
{block.blockType === 'image' && (
|
|
95
|
+
<figure class={`my-8 ${className}`}>
|
|
96
|
+
<img src={block.src} alt={block.alt} class="w-full rounded-md" loading="lazy" />
|
|
97
|
+
{block.caption && <figcaption class="text-sm text-ink/60 mt-2 text-center">{block.caption}</figcaption>}
|
|
98
|
+
</figure>
|
|
99
|
+
)}
|
|
100
|
+
{isExternalLink && (
|
|
101
|
+
<Icon name="external-link" class="inline-block w-3.5 h-3.5 ml-1 align-text-top text-accent-primary/70" />
|
|
102
|
+
)}
|
|
62
103
|
</Wrapper>
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
-
// ARC-GTM-SURFACE D2.2: shared line-icon grammar
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
2
|
+
// ARC-GTM-SURFACE D2.2: shared line-icon grammar, backed by @lucide/astro
|
|
3
|
+
// (d-2026-09-09-sr-inline-diagram-image-blocks: replaced 26 hand-drawn inline
|
|
4
|
+
// SVGs with real Lucide components -- one real, maintained icon family behind
|
|
5
|
+
// the portfolio's whole icon surface instead of a hand-rolled set forked
|
|
6
|
+
// verbatim between this repo and LuhTech-Business). Registered brand-side as
|
|
7
|
+
// iconSetRef.iconSetId = "gtm-surface-line-icons-v1" -- a shared-set
|
|
8
|
+
// identifier (brand-identity schema's own alternative to a per-brand
|
|
9
|
+
// asset-bank upload), since this set is common across the portfolio rather
|
|
10
|
+
// than brand-specific.
|
|
9
11
|
//
|
|
10
12
|
// d-2026-09-09-sr-article-venture-routing-content-cells (LuhTech-Business
|
|
11
13
|
// build-out): this one file mixes truly portfolio-generic icons with
|
|
@@ -23,33 +25,39 @@
|
|
|
23
25
|
// CONSTRUCTION-SPECIFIC (Ectropy and other construction-venture sites
|
|
24
26
|
// only): voxel-grid, field-inspection, hard-hat, building, field-team,
|
|
25
27
|
// zone-map, change-order, crane.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'field-
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
'
|
|
45
|
-
'
|
|
46
|
-
'
|
|
47
|
-
'
|
|
48
|
-
'
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
-
'
|
|
28
|
+
//
|
|
29
|
+
// crane has no literal equivalent in Lucide's real catalog (confirmed
|
|
30
|
+
// against node_modules/@lucide/astro/src/icons -- no crane/tower-crane icon
|
|
31
|
+
// exists); hammer is the closest real, disclosed substitute, not a guess.
|
|
32
|
+
import { icons } from '@lucide/astro';
|
|
33
|
+
|
|
34
|
+
const ICONS: Record<string, keyof typeof icons> = {
|
|
35
|
+
'voxel-grid': 'Boxes',
|
|
36
|
+
'location-pin': 'MapPin',
|
|
37
|
+
'decision-chain': 'GitBranch',
|
|
38
|
+
'cost-tag': 'Tag',
|
|
39
|
+
'field-inspection': 'ClipboardCheck',
|
|
40
|
+
'schema-doc': 'FileCode',
|
|
41
|
+
'integration-plug': 'Plug',
|
|
42
|
+
'sync-loop': 'RefreshCw',
|
|
43
|
+
'hard-hat': 'HardHat',
|
|
44
|
+
'building': 'Building2',
|
|
45
|
+
'field-team': 'Construction',
|
|
46
|
+
'zone-map': 'Map',
|
|
47
|
+
'audit-trail': 'ClipboardList',
|
|
48
|
+
'change-order': 'FilePenLine',
|
|
49
|
+
'studio-compass': 'Compass',
|
|
50
|
+
'portfolio-grid': 'LayoutGrid',
|
|
51
|
+
'code-bracket': 'Code',
|
|
52
|
+
'team-people': 'Users',
|
|
53
|
+
'crane': 'Hammer',
|
|
54
|
+
'handshake': 'Handshake',
|
|
55
|
+
'rocket': 'Rocket',
|
|
56
|
+
'data-flow': 'Network',
|
|
57
|
+
'mail-envelope': 'Mail',
|
|
58
|
+
'message-bubble': 'MessageCircle',
|
|
59
|
+
'external-link': 'ExternalLink',
|
|
60
|
+
'lock': 'Lock',
|
|
53
61
|
};
|
|
54
62
|
|
|
55
63
|
export interface Props {
|
|
@@ -64,17 +72,13 @@ export interface Props {
|
|
|
64
72
|
class?: string;
|
|
65
73
|
}
|
|
66
74
|
const { name, class: className = 'w-6 h-6' } = Astro.props;
|
|
67
|
-
const
|
|
75
|
+
const lucideName = ICONS[name as keyof typeof ICONS];
|
|
76
|
+
const LucideIcon = lucideName ? icons[lucideName] : null;
|
|
68
77
|
---
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
stroke-linejoin="round"
|
|
77
|
-
class={className}
|
|
78
|
-
aria-hidden="true"
|
|
79
|
-
set:html={inner}
|
|
80
|
-
/>
|
|
78
|
+
{LucideIcon && (
|
|
79
|
+
<LucideIcon
|
|
80
|
+
class={className}
|
|
81
|
+
stroke-width="1.75"
|
|
82
|
+
aria-hidden="true"
|
|
83
|
+
/>
|
|
84
|
+
)}
|
|
@@ -6,12 +6,15 @@
|
|
|
6
6
|
// then paragraph/pullquote/stat blocks in the article's own order, closing
|
|
7
7
|
// with a `close` block if the source article ended with one.
|
|
8
8
|
// diagrams[]/toolRef added v1.2.0 (d-2026-09-09-sr-page-diagrams-and-
|
|
9
|
-
// tool-schema)
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
// diagrams
|
|
13
|
-
//
|
|
14
|
-
//
|
|
9
|
+
// tool-schema).
|
|
10
|
+
//
|
|
11
|
+
// v1.3.0 (d-2026-09-09-sr-inline-diagram-image-blocks): a section's
|
|
12
|
+
// diagrams now render inline, exactly where a `diagram` block places
|
|
13
|
+
// them, in this same single-pass blocks loop -- fixing the real gap
|
|
14
|
+
// where every diagram rendered as one group after all the prose,
|
|
15
|
+
// disconnected from the paragraph it illustrates. Any diagram in
|
|
16
|
+
// section.diagrams[] NOT referenced by a block still renders in the
|
|
17
|
+
// fallback strip below, so authored data is never silently dropped.
|
|
15
18
|
import Block from '../Block.astro';
|
|
16
19
|
import Diagram from '../Diagram.astro';
|
|
17
20
|
import ToolCalculator from '../ToolCalculator.astro';
|
|
@@ -28,17 +31,19 @@ export interface Props {
|
|
|
28
31
|
ventureRef?: string;
|
|
29
32
|
}
|
|
30
33
|
const { section, tool, toolSubmitEndpoint, route, ventureRef } = Astro.props;
|
|
34
|
+
const referencedDiagramIds = new Set((section.blocks ?? []).filter((b: any) => b.blockType === 'diagram').map((b: any) => b.diagramId));
|
|
35
|
+
const unreferencedDiagrams = (section.diagrams ?? []).filter((d: any) => !referencedDiagramIds.has(d.diagramId));
|
|
31
36
|
---
|
|
32
37
|
<section id={section.sectionId} class="py-8" data-reveal>
|
|
33
38
|
{section.eyebrow && <p class="text-sm font-mono uppercase tracking-wide text-accent-primary mb-3">{section.eyebrow}</p>}
|
|
34
39
|
{section.heading && <h1 class="font-display text-3xl sm:text-4xl font-bold mb-3 max-w-2xl">{section.heading}</h1>}
|
|
35
40
|
{section.subheading && <p class="text-lg text-ink/80 max-w-2xl mb-6">{section.subheading}</p>}
|
|
36
41
|
<div class="max-w-2xl space-y-5">
|
|
37
|
-
{section.blocks?.map((b: any) => <Block block={b} />)}
|
|
42
|
+
{section.blocks?.map((b: any) => <Block block={b} diagrams={section.diagrams} />)}
|
|
38
43
|
</div>
|
|
39
|
-
{
|
|
44
|
+
{unreferencedDiagrams.length > 0 && (
|
|
40
45
|
<div class="max-w-2xl space-y-8 mt-8">
|
|
41
|
-
{
|
|
46
|
+
{unreferencedDiagrams.map((d: any) => <Diagram diagram={d} />)}
|
|
42
47
|
</div>
|
|
43
48
|
)}
|
|
44
49
|
{section.toolRef && tool && toolSubmitEndpoint && (
|
|
@@ -6,12 +6,16 @@
|
|
|
6
6
|
// are cited, provenance.public numbers, never customer-use statements.
|
|
7
7
|
import Block from '../Block.astro';
|
|
8
8
|
import Figure from '../Figure.astro';
|
|
9
|
+
import Icon from '../Icon.astro';
|
|
10
|
+
import type { SectionIcons } from '../Section.astro';
|
|
9
11
|
|
|
10
|
-
export interface Props { section: any }
|
|
11
|
-
const { section } = Astro.props;
|
|
12
|
+
export interface Props { section: any; icons?: SectionIcons }
|
|
13
|
+
const { section, icons } = Astro.props;
|
|
14
|
+
const sectionIcon = icons?.section?.[section.sectionId];
|
|
12
15
|
---
|
|
13
16
|
<section id={section.sectionId} class="py-8" data-reveal>
|
|
14
17
|
{section.eyebrow && <p class="text-sm font-mono uppercase tracking-wide text-accent-primary mb-3">{section.eyebrow}</p>}
|
|
18
|
+
{sectionIcon && <Icon name={sectionIcon} class="w-8 h-8 text-accent-primary mb-3" />}
|
|
15
19
|
{section.heading && <h2 class="font-display text-2xl font-bold mb-3">{section.heading}</h2>}
|
|
16
20
|
{section.subheading && <p class="text-ink/80 max-w-2xl mb-4">{section.subheading}</p>}
|
|
17
21
|
{section.blocks?.map((b: any) => <Block block={b} class="mb-3" />)}
|
package/src/content/loadPage.ts
CHANGED
|
@@ -3,7 +3,7 @@ import Ajv from 'ajv';
|
|
|
3
3
|
import addFormats from 'ajv-formats';
|
|
4
4
|
import { fetchSchema, fetchSupportSchema } from './schemaFetch.js';
|
|
5
5
|
|
|
6
|
-
const PAGE_PIN = '1.
|
|
6
|
+
const PAGE_PIN = '1.3.0';
|
|
7
7
|
const CAPABILITY_CLAIM_PIN = '0.2.0';
|
|
8
8
|
|
|
9
9
|
let validatorPromise: ReturnType<typeof buildValidator> | null = null;
|
|
@@ -33,9 +33,17 @@ async function buildValidator() {
|
|
|
33
33
|
|
|
34
34
|
export interface PageBlock {
|
|
35
35
|
blockType: string;
|
|
36
|
-
text
|
|
36
|
+
// Required for the text kinds (paragraph/lede/pullquote/list/definition/
|
|
37
|
+
// caption/stat/close); not used by diagram/image, same conditional
|
|
38
|
+
// requirement as the schema's own allOf/if/then -- typed optional here so
|
|
39
|
+
// a real diagram/image block literal (no text) isn't a type error.
|
|
40
|
+
text?: string;
|
|
37
41
|
label?: string;
|
|
38
42
|
href?: string;
|
|
43
|
+
diagramId?: string;
|
|
44
|
+
src?: string;
|
|
45
|
+
alt?: string;
|
|
46
|
+
caption?: string;
|
|
39
47
|
}
|
|
40
48
|
|
|
41
49
|
export interface PageClaim {
|
|
@@ -86,6 +86,19 @@ const nav =
|
|
|
86
86
|
</div>
|
|
87
87
|
</footer>
|
|
88
88
|
<script>
|
|
89
|
+
// Content already on screen at load must never depend on a scroll
|
|
90
|
+
// event or an async observer callback to become visible -- real
|
|
91
|
+
// user report (2026-09-09): the insights index's card grid sits
|
|
92
|
+
// close enough to the fold on common viewport heights that it
|
|
93
|
+
// read as a genuinely blank page until scrolled, because
|
|
94
|
+
// IntersectionObserver's own first callback is asynchronous
|
|
95
|
+
// (next frame/microtask), not synchronous with page paint, and a
|
|
96
|
+
// slow first frame or a borderline-in-view element could leave
|
|
97
|
+
// data-reveal's default opacity:0 as the visible, unrevealed
|
|
98
|
+
// state. Elements already in (or near) the viewport at setup
|
|
99
|
+
// time reveal immediately, synchronously, no observer round-trip
|
|
100
|
+
// required; only genuinely below-the-fold elements keep the
|
|
101
|
+
// scroll-triggered animation.
|
|
89
102
|
const revealTargets = document.querySelectorAll('[data-reveal]');
|
|
90
103
|
if ('IntersectionObserver' in window && revealTargets.length) {
|
|
91
104
|
const observer = new IntersectionObserver(
|
|
@@ -99,7 +112,15 @@ const nav =
|
|
|
99
112
|
},
|
|
100
113
|
{ threshold: 0.2, rootMargin: '0px 0px -10% 0px' }
|
|
101
114
|
);
|
|
102
|
-
revealTargets.forEach((el) =>
|
|
115
|
+
revealTargets.forEach((el) => {
|
|
116
|
+
const rect = el.getBoundingClientRect();
|
|
117
|
+
const nearViewport = rect.top < window.innerHeight * 1.1 && rect.bottom > 0;
|
|
118
|
+
if (nearViewport) {
|
|
119
|
+
el.classList.add('is-visible');
|
|
120
|
+
} else {
|
|
121
|
+
observer.observe(el);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
103
124
|
} else {
|
|
104
125
|
revealTargets.forEach((el) => el.classList.add('is-visible'));
|
|
105
126
|
}
|