@spatial-elements/sveltekit 1.0.0-beta.5 → 1.0.0-beta.6
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/dist/catalog/catalogTransition.css +12 -0
- package/dist/spatial-element/BrandStageShell.svelte +2 -0
- package/dist/spatial-element/CarouselSection.svelte +337 -323
- package/dist/spatial-element/CarouselSection.svelte.d.ts +2 -7
- package/dist/spatial-element/CarouselSpatialElement.svelte +140 -126
- package/dist/spatial-element/CarouselSpatialElement.svelte.d.ts +5 -1
- package/dist/spatial-element/PointerHint.svelte +78 -0
- package/dist/spatial-element/PointerHint.svelte.d.ts +3 -0
- package/dist/spatial-element/SpatialElementCard.svelte +66 -1
- package/dist/spatial-element/SpatialElementMediaRail.svelte +20 -2
- package/dist/spatial-element/SpatialElementPage.svelte +0 -3
- package/dist/spatial-element/SpatialElementSummaryContent.svelte +182 -0
- package/dist/spatial-element/SpatialElementSummaryContent.svelte.d.ts +18 -0
- package/dist/spatial-element/SpatialElementSummaryPanel.svelte +5 -370
- package/dist/spatial-element/carouselTextHit.d.ts +2 -0
- package/dist/spatial-element/carouselTextHit.js +17 -0
- package/dist/spatial-element/truncatedTitle.d.ts +5 -0
- package/dist/spatial-element/truncatedTitle.js +28 -0
- package/dist/stage/Stage.svelte +39 -2
- package/dist/stage/StageViewport.svelte +7 -1
- package/package.json +2 -2
|
@@ -32,8 +32,11 @@
|
|
|
32
32
|
data-spatial-element-departing-media-content={media.kind === 'minimap' ? undefined : ''}
|
|
33
33
|
>
|
|
34
34
|
{#if media.kind === 'minimap'}
|
|
35
|
-
<button type="button" aria-label={media.label} class="thumb thumb-minimap active"
|
|
36
|
-
|
|
35
|
+
<button type="button" aria-label={media.label} class="thumb thumb-minimap active">
|
|
36
|
+
{#if spatialElement.fallbackImage}
|
|
37
|
+
<img class="minimap-poster" src={spatialElement.fallbackImage} alt="" />
|
|
38
|
+
{/if}
|
|
39
|
+
</button>
|
|
37
40
|
{:else if media.kind === 'drawing'}
|
|
38
41
|
<button type="button" aria-label={media.label} class="thumb thumb-drawing">
|
|
39
42
|
<span class="drawing-sheet" aria-hidden="true"></span>
|
|
@@ -96,6 +99,21 @@
|
|
|
96
99
|
overflow: hidden;
|
|
97
100
|
}
|
|
98
101
|
|
|
102
|
+
.minimap-poster {
|
|
103
|
+
position: absolute;
|
|
104
|
+
inset: 10%;
|
|
105
|
+
width: 80%;
|
|
106
|
+
height: 80%;
|
|
107
|
+
object-fit: contain;
|
|
108
|
+
transition: opacity 240ms ease;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
:global(.stage-enhanced) .minimap-poster { opacity: 0; }
|
|
112
|
+
|
|
113
|
+
@media (prefers-reduced-motion: reduce) {
|
|
114
|
+
.minimap-poster { transition: none; }
|
|
115
|
+
}
|
|
116
|
+
|
|
99
117
|
.thumb-image img {
|
|
100
118
|
display: block;
|
|
101
119
|
max-width: calc(100% - 18px);
|
|
@@ -238,9 +238,6 @@
|
|
|
238
238
|
.spatial-element-hero :global(.spatial-element-visual) {
|
|
239
239
|
grid-column: 1;
|
|
240
240
|
grid-row: 1;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
:global(.spatial-element-visual) {
|
|
244
241
|
min-height: clamp(540px, calc(100vh - 300px), 680px);
|
|
245
242
|
border-radius: 28px;
|
|
246
243
|
background: transparent;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { catalogActionSemantic } from '@spatial-elements/core/catalog/catalogAction';
|
|
3
|
+
import type { CatalogEndpointAddress, CatalogEndpointRole } from '@spatial-elements/core/catalog/CatalogEndpointRegistry';
|
|
4
|
+
import type { SpatialElementFeature, SpatialElementAction } from '@spatial-elements/core/spatial-element/types';
|
|
5
|
+
import { ShoppingCart } from 'lucide-svelte';
|
|
6
|
+
import { createCatalogEndpointAction } from '../catalog/catalogEndpointAction.js';
|
|
7
|
+
let { spatialElement, address, contentInset, heading = 'h3', element = $bindable() }: {
|
|
8
|
+
spatialElement: { id: string; eyebrow: string; title: string; features: SpatialElementFeature[]; action?: SpatialElementAction };
|
|
9
|
+
address: (role: CatalogEndpointRole) => CatalogEndpointAddress | undefined;
|
|
10
|
+
contentInset: number;
|
|
11
|
+
heading?: 'h1' | 'h3';
|
|
12
|
+
element?: HTMLDivElement;
|
|
13
|
+
} = $props();
|
|
14
|
+
const catalogEndpoint = createCatalogEndpointAction();
|
|
15
|
+
</script>
|
|
16
|
+
<div bind:this={element} class="summary-presentation" style:min-height={`${Math.max(504 - contentInset * 2, 0)}px`}>
|
|
17
|
+
<div class="panel-copy">
|
|
18
|
+
<p
|
|
19
|
+
class="panel-kicker"
|
|
20
|
+
data-shared-role="eyebrow"
|
|
21
|
+
data-spatial-element-id={spatialElement.id}
|
|
22
|
+
use:catalogEndpoint={address('eyebrow')}
|
|
23
|
+
>
|
|
24
|
+
{spatialElement.eyebrow}
|
|
25
|
+
</p>
|
|
26
|
+
<svelte:element this={heading} class="summary-title"
|
|
27
|
+
id={heading === 'h1' ? 'spatial-element-title' : undefined}
|
|
28
|
+
tabindex={heading === 'h1' ? -1 : undefined}
|
|
29
|
+
data-shared-role="title"
|
|
30
|
+
data-spatial-element-id={spatialElement.id}
|
|
31
|
+
use:catalogEndpoint={address('title')}
|
|
32
|
+
>
|
|
33
|
+
{spatialElement.title}
|
|
34
|
+
</svelte:element>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<ul
|
|
38
|
+
class="feature-list"
|
|
39
|
+
aria-label="SpatialElement highlights"
|
|
40
|
+
use:catalogEndpoint={address('features')}
|
|
41
|
+
data-catalog-rich-shared="features"
|
|
42
|
+
data-catalog-semantic={JSON.stringify(spatialElement.features)}
|
|
43
|
+
>
|
|
44
|
+
{#each spatialElement.features as feature (feature.label)}
|
|
45
|
+
<li>
|
|
46
|
+
<span class="feature-content" data-catalog-secondary>
|
|
47
|
+
<span class="feature-marker" aria-hidden="true">{feature.marker ?? 'Link'}</span>
|
|
48
|
+
<span>{feature.label}</span>
|
|
49
|
+
</span>
|
|
50
|
+
</li>
|
|
51
|
+
{/each}
|
|
52
|
+
</ul>
|
|
53
|
+
|
|
54
|
+
{#if spatialElement.action}
|
|
55
|
+
{#if spatialElement.action.href}
|
|
56
|
+
<a
|
|
57
|
+
use:catalogEndpoint={address('primary-action')}
|
|
58
|
+
data-catalog-rich-shared="primary-action"
|
|
59
|
+
data-catalog-semantic={catalogActionSemantic(spatialElement.action)}
|
|
60
|
+
class="spatial-element-action spatial-element-action-expanded"
|
|
61
|
+
href={spatialElement.action.href}
|
|
62
|
+
rel="external"
|
|
63
|
+
aria-label={spatialElement.action.ariaLabel}
|
|
64
|
+
>
|
|
65
|
+
<span class="spatial-element-action-surface" data-catalog-secondary>
|
|
66
|
+
<ShoppingCart
|
|
67
|
+
class="spatial-element-action-icon"
|
|
68
|
+
size={27}
|
|
69
|
+
strokeWidth={2}
|
|
70
|
+
aria-hidden="true"
|
|
71
|
+
/>
|
|
72
|
+
<span class="spatial-element-action-label">{spatialElement.action.label}</span>
|
|
73
|
+
</span>
|
|
74
|
+
</a>
|
|
75
|
+
{:else}
|
|
76
|
+
<button
|
|
77
|
+
use:catalogEndpoint={address('primary-action')}
|
|
78
|
+
data-catalog-rich-shared="primary-action"
|
|
79
|
+
data-catalog-semantic={catalogActionSemantic(spatialElement.action)}
|
|
80
|
+
class="spatial-element-action spatial-element-action-expanded"
|
|
81
|
+
type="button"
|
|
82
|
+
aria-label={spatialElement.action.ariaLabel}
|
|
83
|
+
>
|
|
84
|
+
<span class="spatial-element-action-surface" data-catalog-secondary>
|
|
85
|
+
<ShoppingCart
|
|
86
|
+
class="spatial-element-action-icon"
|
|
87
|
+
size={27}
|
|
88
|
+
strokeWidth={2}
|
|
89
|
+
aria-hidden="true"
|
|
90
|
+
/>
|
|
91
|
+
<span class="spatial-element-action-label">{spatialElement.action.label}</span>
|
|
92
|
+
</span>
|
|
93
|
+
</button>
|
|
94
|
+
{/if}
|
|
95
|
+
{/if}
|
|
96
|
+
</div>
|
|
97
|
+
<style>
|
|
98
|
+
.summary-presentation {
|
|
99
|
+
position: relative;
|
|
100
|
+
box-sizing: border-box;
|
|
101
|
+
display: flex;
|
|
102
|
+
flex-direction: column;
|
|
103
|
+
justify-content: space-between;
|
|
104
|
+
gap: 24px;
|
|
105
|
+
pointer-events: auto;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.summary-title {
|
|
109
|
+
max-width: 390px;
|
|
110
|
+
margin: 10px 0 0;
|
|
111
|
+
font-size: clamp(30px, 3vw, 40px);
|
|
112
|
+
font-weight: 780;
|
|
113
|
+
line-height: 1.16;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.panel-kicker {
|
|
117
|
+
margin: 0;
|
|
118
|
+
font-size: 14px;
|
|
119
|
+
font-weight: 720;
|
|
120
|
+
letter-spacing: 0.05em;
|
|
121
|
+
text-transform: uppercase;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.feature-list {
|
|
125
|
+
display: grid;
|
|
126
|
+
gap: 20px;
|
|
127
|
+
margin: 0;
|
|
128
|
+
padding: 0;
|
|
129
|
+
color: var(--spatial-element-body);
|
|
130
|
+
font-size: 18px;
|
|
131
|
+
list-style: none;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.feature-content {
|
|
135
|
+
display: flex;
|
|
136
|
+
align-items: baseline;
|
|
137
|
+
gap: 14px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.feature-marker {
|
|
141
|
+
color: var(--spatial-element-accent);
|
|
142
|
+
font-weight: 800;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.spatial-element-action {
|
|
146
|
+
display: block;
|
|
147
|
+
box-sizing: border-box;
|
|
148
|
+
width: 100%;
|
|
149
|
+
min-height: 62px;
|
|
150
|
+
border: 0;
|
|
151
|
+
padding: 0;
|
|
152
|
+
color: inherit;
|
|
153
|
+
background: transparent;
|
|
154
|
+
text-decoration: none;
|
|
155
|
+
cursor: pointer;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.spatial-element-action-surface {
|
|
159
|
+
display: flex;
|
|
160
|
+
align-items: center;
|
|
161
|
+
justify-content: center;
|
|
162
|
+
gap: 10px;
|
|
163
|
+
box-sizing: border-box;
|
|
164
|
+
width: 100%;
|
|
165
|
+
min-height: 62px;
|
|
166
|
+
border-radius: 7px;
|
|
167
|
+
color: var(--spatial-element-on-accent);
|
|
168
|
+
background: var(--spatial-element-accent);
|
|
169
|
+
font:
|
|
170
|
+
760 22px/1 system-ui,
|
|
171
|
+
sans-serif;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
:global(.spatial-element-action-icon) {
|
|
175
|
+
flex: none;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.spatial-element-action-label {
|
|
179
|
+
white-space: nowrap;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CatalogEndpointAddress, CatalogEndpointRole } from '@spatial-elements/core/catalog/CatalogEndpointRegistry';
|
|
2
|
+
import type { SpatialElementFeature, SpatialElementAction } from '@spatial-elements/core/spatial-element/types';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
spatialElement: {
|
|
5
|
+
id: string;
|
|
6
|
+
eyebrow: string;
|
|
7
|
+
title: string;
|
|
8
|
+
features: SpatialElementFeature[];
|
|
9
|
+
action?: SpatialElementAction;
|
|
10
|
+
};
|
|
11
|
+
address: (role: CatalogEndpointRole) => CatalogEndpointAddress | undefined;
|
|
12
|
+
contentInset: number;
|
|
13
|
+
heading?: 'h1' | 'h3';
|
|
14
|
+
element?: HTMLDivElement;
|
|
15
|
+
};
|
|
16
|
+
declare const SpatialElementSummaryContent: import("svelte").Component<$$ComponentProps, {}, "element">;
|
|
17
|
+
type SpatialElementSummaryContent = ReturnType<typeof SpatialElementSummaryContent>;
|
|
18
|
+
export default SpatialElementSummaryContent;
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount } from 'svelte';
|
|
3
|
-
import
|
|
4
|
-
import { mouseHover } from '@spatial-elements/core/stage/mouseHover';
|
|
5
|
-
import { ShoppingCart } from 'lucide-svelte';
|
|
3
|
+
import SpatialElementSummaryContent from './SpatialElementSummaryContent.svelte';
|
|
6
4
|
import Panel from '../stage/Panel.svelte';
|
|
7
5
|
import { useSpatialTheme } from './brandContext.js';
|
|
8
6
|
import type { ResolvedSpatialElementData as SpatialElementData } from '@spatial-elements/core/spatial-element/spatialElement';
|
|
9
|
-
import { createCatalogEndpointAction } from '../catalog/catalogEndpointAction.js';
|
|
10
7
|
|
|
11
8
|
let { spatialElement }: { spatialElement: SpatialElementData } = $props();
|
|
12
9
|
const readTheme = useSpatialTheme();
|
|
13
10
|
const theme = $derived(readTheme());
|
|
14
|
-
const catalogEndpoint = createCatalogEndpointAction();
|
|
15
11
|
const contentInset = $derived(theme.panelShape.contentInset ?? Math.max(16, Math.round(theme.panelShape.radius * 0.7)));
|
|
16
|
-
let presentation
|
|
12
|
+
let presentation = $state<HTMLDivElement>(null!);
|
|
17
13
|
let panelHeight = $state<number>();
|
|
18
14
|
|
|
19
15
|
onMount(() => {
|
|
@@ -37,6 +33,7 @@
|
|
|
37
33
|
slot: 'detail.summary',
|
|
38
34
|
role: 'summary-surface'
|
|
39
35
|
}}
|
|
36
|
+
pointerReactive={false}
|
|
40
37
|
transitionGroup="shared"
|
|
41
38
|
class="spatial-element-panel"
|
|
42
39
|
shape={theme.panelShape}
|
|
@@ -47,128 +44,12 @@
|
|
|
47
44
|
data-shared-role="summary-surface"
|
|
48
45
|
data-spatial-element-id={spatialElement.id}
|
|
49
46
|
>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<p
|
|
53
|
-
class="panel-kicker"
|
|
54
|
-
data-shared-role="eyebrow"
|
|
55
|
-
data-spatial-element-id={spatialElement.id}
|
|
56
|
-
use:catalogEndpoint={{
|
|
57
|
-
brandId: theme.id,
|
|
58
|
-
spatialElementId: spatialElement.id,
|
|
59
|
-
slot: 'detail.summary',
|
|
60
|
-
role: 'eyebrow'
|
|
61
|
-
}}
|
|
62
|
-
>
|
|
63
|
-
{spatialElement.eyebrow}
|
|
64
|
-
</p>
|
|
65
|
-
<h1
|
|
66
|
-
id="spatial-element-title"
|
|
67
|
-
tabindex="-1"
|
|
68
|
-
data-shared-role="title"
|
|
69
|
-
data-spatial-element-id={spatialElement.id}
|
|
70
|
-
use:catalogEndpoint={{
|
|
71
|
-
brandId: theme.id,
|
|
72
|
-
spatialElementId: spatialElement.id,
|
|
73
|
-
slot: 'detail.summary',
|
|
74
|
-
role: 'title'
|
|
75
|
-
}}
|
|
76
|
-
>
|
|
77
|
-
{spatialElement.title}
|
|
78
|
-
</h1>
|
|
79
|
-
</div>
|
|
80
|
-
|
|
81
|
-
<ul
|
|
82
|
-
class="feature-list"
|
|
83
|
-
aria-label="SpatialElement highlights"
|
|
84
|
-
use:catalogEndpoint={{
|
|
85
|
-
brandId: theme.id,
|
|
86
|
-
spatialElementId: spatialElement.id,
|
|
87
|
-
slot: 'detail.summary',
|
|
88
|
-
role: 'features'
|
|
89
|
-
}}
|
|
90
|
-
data-catalog-rich-shared="features"
|
|
91
|
-
data-catalog-semantic={JSON.stringify(spatialElement.features)}
|
|
92
|
-
>
|
|
93
|
-
{#each spatialElement.features as feature (feature.label)}
|
|
94
|
-
<li>
|
|
95
|
-
<span class="feature-content" data-catalog-secondary>
|
|
96
|
-
<span class="feature-marker" aria-hidden="true">{feature.marker ?? 'Link'}</span>
|
|
97
|
-
<span>{feature.label}</span>
|
|
98
|
-
</span>
|
|
99
|
-
</li>
|
|
100
|
-
{/each}
|
|
101
|
-
</ul>
|
|
102
|
-
|
|
103
|
-
{#if spatialElement.action}
|
|
104
|
-
{#if spatialElement.action.href}
|
|
105
|
-
<a
|
|
106
|
-
use:catalogEndpoint={{
|
|
107
|
-
brandId: theme.id,
|
|
108
|
-
spatialElementId: spatialElement.id,
|
|
109
|
-
slot: 'detail.summary',
|
|
110
|
-
role: 'primary-action'
|
|
111
|
-
}}
|
|
112
|
-
data-catalog-rich-shared="primary-action"
|
|
113
|
-
data-catalog-semantic={catalogActionSemantic(spatialElement.action)}
|
|
114
|
-
class="spatial-element-action spatial-element-action-expanded"
|
|
115
|
-
href={spatialElement.action.href}
|
|
116
|
-
rel="external"
|
|
117
|
-
aria-label={spatialElement.action.ariaLabel}
|
|
118
|
-
>
|
|
119
|
-
<span class="spatial-element-action-surface" data-catalog-secondary>
|
|
120
|
-
<ShoppingCart
|
|
121
|
-
class="spatial-element-action-icon"
|
|
122
|
-
size={27}
|
|
123
|
-
strokeWidth={2}
|
|
124
|
-
aria-hidden="true"
|
|
125
|
-
/>
|
|
126
|
-
<span class="spatial-element-action-label">{spatialElement.action.label}</span>
|
|
127
|
-
</span>
|
|
128
|
-
</a>
|
|
129
|
-
{:else}
|
|
130
|
-
<button
|
|
131
|
-
use:catalogEndpoint={{
|
|
132
|
-
brandId: theme.id,
|
|
133
|
-
spatialElementId: spatialElement.id,
|
|
134
|
-
slot: 'detail.summary',
|
|
135
|
-
role: 'primary-action'
|
|
136
|
-
}}
|
|
137
|
-
data-catalog-rich-shared="primary-action"
|
|
138
|
-
data-catalog-semantic={catalogActionSemantic(spatialElement.action)}
|
|
139
|
-
class="spatial-element-action spatial-element-action-expanded"
|
|
140
|
-
type="button"
|
|
141
|
-
aria-label={spatialElement.action.ariaLabel}
|
|
142
|
-
>
|
|
143
|
-
<span class="spatial-element-action-surface" data-catalog-secondary>
|
|
144
|
-
<ShoppingCart
|
|
145
|
-
class="spatial-element-action-icon"
|
|
146
|
-
size={27}
|
|
147
|
-
strokeWidth={2}
|
|
148
|
-
aria-hidden="true"
|
|
149
|
-
/>
|
|
150
|
-
<span class="spatial-element-action-label">{spatialElement.action.label}</span>
|
|
151
|
-
</span>
|
|
152
|
-
</button>
|
|
153
|
-
{/if}
|
|
154
|
-
{/if}
|
|
155
|
-
</div>
|
|
47
|
+
<SpatialElementSummaryContent {spatialElement} {contentInset} heading="h1" bind:element={presentation}
|
|
48
|
+
address={(role) => ({ brandId: theme.id, spatialElementId: spatialElement.id, slot: 'detail.summary', role })} />
|
|
156
49
|
</Panel>
|
|
157
50
|
</div>
|
|
158
51
|
|
|
159
52
|
<style>
|
|
160
|
-
@property --summary-feature-hover-progress {
|
|
161
|
-
syntax: '<number>';
|
|
162
|
-
inherits: false;
|
|
163
|
-
initial-value: 0;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
@property --summary-action-hover-progress {
|
|
167
|
-
syntax: '<number>';
|
|
168
|
-
inherits: false;
|
|
169
|
-
initial-value: 0;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
53
|
.spatial-element-aside {
|
|
173
54
|
position: relative;
|
|
174
55
|
min-height: inherit;
|
|
@@ -188,254 +69,8 @@
|
|
|
188
69
|
display: block;
|
|
189
70
|
overflow: visible;
|
|
190
71
|
color: color-mix(in srgb, var(--spatial-element-ink) 92%, transparent);
|
|
191
|
-
transform-style: preserve-3d;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.summary-presentation {
|
|
195
|
-
--summary-depth-progress: var(--stage-panel-pointer-proximity, 0);
|
|
196
|
-
--summary-shadow-strength: var(--stage-panel-shadow-strength, 0.18);
|
|
197
|
-
--summary-feature-depth: 40;
|
|
198
|
-
--summary-feature-hover-depth: 48;
|
|
199
|
-
--summary-eyebrow-depth: 60;
|
|
200
|
-
--summary-title-depth: 96;
|
|
201
|
-
--summary-action-depth: 76;
|
|
202
|
-
--summary-action-hover-depth: 24;
|
|
203
|
-
|
|
204
|
-
position: relative;
|
|
205
|
-
box-sizing: border-box;
|
|
206
|
-
display: flex;
|
|
207
|
-
flex-direction: column;
|
|
208
|
-
justify-content: space-between;
|
|
209
|
-
gap: 24px;
|
|
210
|
-
pointer-events: auto;
|
|
211
|
-
transform-style: preserve-3d;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.panel-copy {
|
|
215
|
-
transform-style: preserve-3d;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.summary-presentation h1 {
|
|
219
|
-
max-width: 390px;
|
|
220
|
-
margin: 10px 0 0;
|
|
221
|
-
font-size: clamp(30px, 3vw, 40px);
|
|
222
|
-
font-weight: 780;
|
|
223
|
-
line-height: 1.16;
|
|
224
|
-
transform-origin: left center;
|
|
225
|
-
will-change: transform;
|
|
226
72
|
}
|
|
227
73
|
|
|
228
|
-
.panel-kicker {
|
|
229
|
-
margin: 0;
|
|
230
|
-
font-size: 14px;
|
|
231
|
-
font-weight: 720;
|
|
232
|
-
letter-spacing: 0.05em;
|
|
233
|
-
text-transform: uppercase;
|
|
234
|
-
transform-origin: left center;
|
|
235
|
-
will-change: transform;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.feature-list {
|
|
239
|
-
display: grid;
|
|
240
|
-
gap: 20px;
|
|
241
|
-
margin: 0;
|
|
242
|
-
padding: 0;
|
|
243
|
-
color: var(--spatial-element-body);
|
|
244
|
-
font-size: 18px;
|
|
245
|
-
list-style: none;
|
|
246
|
-
transform-style: preserve-3d;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
.feature-list li {
|
|
250
|
-
transform-style: preserve-3d;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
.feature-content {
|
|
254
|
-
--summary-feature-hover-progress: 0;
|
|
255
|
-
--summary-feature-effective-depth: calc(
|
|
256
|
-
var(--summary-feature-depth) * var(--summary-depth-progress) +
|
|
257
|
-
var(--summary-feature-hover-depth) * var(--summary-feature-hover-progress)
|
|
258
|
-
);
|
|
259
|
-
--summary-feature-shadow-depth: calc(
|
|
260
|
-
var(--summary-feature-depth) * var(--summary-depth-progress)
|
|
261
|
-
);
|
|
262
|
-
|
|
263
|
-
display: flex;
|
|
264
|
-
align-items: baseline;
|
|
265
|
-
gap: 14px;
|
|
266
|
-
text-shadow:
|
|
267
|
-
0 calc(0.055px * var(--summary-feature-shadow-depth))
|
|
268
|
-
calc(0.055px * var(--summary-feature-shadow-depth))
|
|
269
|
-
rgb(
|
|
270
|
-
0 0 0 /
|
|
271
|
-
calc(0.0168 * var(--summary-shadow-strength) * var(--summary-feature-shadow-depth))
|
|
272
|
-
),
|
|
273
|
-
0 calc(0.194px * var(--summary-feature-shadow-depth))
|
|
274
|
-
calc(0.278px * var(--summary-feature-shadow-depth))
|
|
275
|
-
rgb(
|
|
276
|
-
0 0 0 /
|
|
277
|
-
calc(0.00936 * var(--summary-shadow-strength) * var(--summary-feature-shadow-depth))
|
|
278
|
-
);
|
|
279
|
-
transform: translateZ(calc(1px * var(--summary-feature-effective-depth)));
|
|
280
|
-
transform-origin: left center;
|
|
281
|
-
transition: --summary-feature-hover-progress 260ms cubic-bezier(0.22, 0.75, 0.25, 1);
|
|
282
|
-
will-change: transform;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.summary-presentation:global([data-mouse-hover]) .feature-list li:hover .feature-content {
|
|
286
|
-
--summary-feature-hover-progress: 1;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
.feature-marker {
|
|
290
|
-
color: var(--spatial-element-accent);
|
|
291
|
-
font-weight: 800;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
.spatial-element-action {
|
|
295
|
-
display: block;
|
|
296
|
-
box-sizing: border-box;
|
|
297
|
-
width: 100%;
|
|
298
|
-
min-height: 62px;
|
|
299
|
-
border: 0;
|
|
300
|
-
padding: 0;
|
|
301
|
-
color: inherit;
|
|
302
|
-
background: transparent;
|
|
303
|
-
text-decoration: none;
|
|
304
|
-
cursor: pointer;
|
|
305
|
-
transform-style: preserve-3d;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
.summary-presentation:global([data-mouse-hover]) .spatial-element-action:hover .spatial-element-action-surface,
|
|
309
|
-
.spatial-element-action:focus-visible .spatial-element-action-surface {
|
|
310
|
-
--summary-action-hover-progress: 1;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.spatial-element-action-surface {
|
|
314
|
-
--summary-action-hover-progress: 0;
|
|
315
|
-
|
|
316
|
-
display: flex;
|
|
317
|
-
align-items: center;
|
|
318
|
-
justify-content: center;
|
|
319
|
-
gap: 10px;
|
|
320
|
-
box-sizing: border-box;
|
|
321
|
-
width: 100%;
|
|
322
|
-
min-height: 62px;
|
|
323
|
-
border-radius: 7px;
|
|
324
|
-
color: var(--spatial-element-on-accent);
|
|
325
|
-
background: var(--spatial-element-accent);
|
|
326
|
-
font:
|
|
327
|
-
760 22px/1 system-ui,
|
|
328
|
-
sans-serif;
|
|
329
|
-
transform-origin: center;
|
|
330
|
-
transition: --summary-action-hover-progress 260ms cubic-bezier(0.22, 0.75, 0.25, 1);
|
|
331
|
-
will-change: transform;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.panel-kicker {
|
|
335
|
-
--summary-eyebrow-effective-depth: calc(
|
|
336
|
-
var(--summary-eyebrow-depth) * var(--summary-depth-progress)
|
|
337
|
-
);
|
|
338
|
-
|
|
339
|
-
text-shadow:
|
|
340
|
-
0 calc(0.055px * var(--summary-eyebrow-effective-depth))
|
|
341
|
-
calc(0.04px * var(--summary-eyebrow-effective-depth))
|
|
342
|
-
rgb(
|
|
343
|
-
0 0 0 /
|
|
344
|
-
calc(0.0134 * var(--summary-shadow-strength) * var(--summary-eyebrow-effective-depth))
|
|
345
|
-
),
|
|
346
|
-
0 calc(0.117px * var(--summary-eyebrow-effective-depth))
|
|
347
|
-
calc(0.167px * var(--summary-eyebrow-effective-depth))
|
|
348
|
-
rgb(
|
|
349
|
-
0 0 0 /
|
|
350
|
-
calc(0.0074 * var(--summary-shadow-strength) * var(--summary-eyebrow-effective-depth))
|
|
351
|
-
);
|
|
352
|
-
transform: translateZ(calc(1px * var(--summary-eyebrow-effective-depth)));
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
.summary-presentation h1 {
|
|
356
|
-
--summary-title-effective-depth: calc(
|
|
357
|
-
var(--summary-title-depth) * var(--summary-depth-progress)
|
|
358
|
-
);
|
|
359
|
-
|
|
360
|
-
text-shadow:
|
|
361
|
-
0 calc(0.055px * var(--summary-title-effective-depth))
|
|
362
|
-
calc(0.04px * var(--summary-title-effective-depth))
|
|
363
|
-
rgb(
|
|
364
|
-
0 0 0 /
|
|
365
|
-
calc(0.007 * var(--summary-shadow-strength) * var(--summary-title-effective-depth))
|
|
366
|
-
),
|
|
367
|
-
0 calc(0.156px * var(--summary-title-effective-depth))
|
|
368
|
-
calc(0.203px * var(--summary-title-effective-depth))
|
|
369
|
-
rgb(
|
|
370
|
-
0 0 0 /
|
|
371
|
-
calc(0.0039 * var(--summary-shadow-strength) * var(--summary-title-effective-depth))
|
|
372
|
-
);
|
|
373
|
-
transform: translateZ(calc(1px * var(--summary-title-effective-depth)));
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
.spatial-element-action-surface {
|
|
377
|
-
--summary-action-effective-depth: calc(
|
|
378
|
-
var(--summary-action-depth) * var(--summary-depth-progress) +
|
|
379
|
-
var(--summary-action-hover-depth) * var(--summary-action-hover-progress)
|
|
380
|
-
);
|
|
381
|
-
|
|
382
|
-
box-shadow:
|
|
383
|
-
0 calc(0.078px * var(--summary-action-effective-depth))
|
|
384
|
-
calc(0.094px * var(--summary-action-effective-depth))
|
|
385
|
-
rgb(
|
|
386
|
-
0 0 0 /
|
|
387
|
-
calc(0.0105 * var(--summary-shadow-strength) * var(--summary-action-effective-depth))
|
|
388
|
-
),
|
|
389
|
-
0 calc(0.237px * var(--summary-action-effective-depth))
|
|
390
|
-
calc(0.316px * var(--summary-action-effective-depth))
|
|
391
|
-
rgb(
|
|
392
|
-
0 0 0 /
|
|
393
|
-
calc(0.0068 * var(--summary-shadow-strength) * var(--summary-action-effective-depth))
|
|
394
|
-
);
|
|
395
|
-
transform: translateZ(calc(1px * var(--summary-action-effective-depth)));
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
:global(.spatial-element-action-icon) {
|
|
399
|
-
flex: none;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
.spatial-element-action-label {
|
|
403
|
-
white-space: nowrap;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
/* Zero-depth transforms still promote text to composited layers in Chromium.
|
|
407
|
-
* Remove those layers while the complete panel is in its native DOM rest mode. */
|
|
408
|
-
:global([data-stage-panel-render-mode='native']) .summary-presentation,
|
|
409
|
-
:global([data-stage-panel-render-mode='native']) .panel-copy,
|
|
410
|
-
:global([data-stage-panel-render-mode='native']) .feature-list,
|
|
411
|
-
:global([data-stage-panel-render-mode='native']) .feature-list li,
|
|
412
|
-
:global([data-stage-panel-render-mode='native']) .spatial-element-action {
|
|
413
|
-
transform-style: flat;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
:global([data-stage-panel-render-mode='native']) .panel-kicker,
|
|
417
|
-
:global([data-stage-panel-render-mode='native']) .summary-presentation h1,
|
|
418
|
-
:global([data-stage-panel-render-mode='native']) .feature-content,
|
|
419
|
-
:global([data-stage-panel-render-mode='native']) .spatial-element-action-surface {
|
|
420
|
-
transform: none;
|
|
421
|
-
will-change: auto;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
@media (prefers-reduced-motion: reduce) {
|
|
425
|
-
.summary-presentation {
|
|
426
|
-
--summary-depth-progress: 0;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
.feature-content,
|
|
430
|
-
.summary-presentation:global([data-mouse-hover]) .feature-list li:hover .feature-content,
|
|
431
|
-
.spatial-element-action-surface,
|
|
432
|
-
.summary-presentation:global([data-mouse-hover]) .spatial-element-action:hover .spatial-element-action-surface,
|
|
433
|
-
.spatial-element-action:focus-visible .spatial-element-action-surface {
|
|
434
|
-
--summary-feature-hover-progress: 0;
|
|
435
|
-
--summary-action-hover-progress: 0;
|
|
436
|
-
transition: none;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
74
|
|
|
440
75
|
@media (max-width: 1100px) {
|
|
441
76
|
.spatial-element-aside { min-height: 0; }
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Test rendered text fragments, not the full width of their block container. */
|
|
2
|
+
export function carouselTextHit(target, x, y) {
|
|
3
|
+
if (!(target instanceof HTMLElement) || !target.closest('.summary') ||
|
|
4
|
+
target.closest('a, button, input, textarea, select, [contenteditable]'))
|
|
5
|
+
return;
|
|
6
|
+
const walker = document.createTreeWalker(target, NodeFilter.SHOW_TEXT);
|
|
7
|
+
const range = document.createRange();
|
|
8
|
+
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
9
|
+
if (!node.textContent?.trim())
|
|
10
|
+
continue;
|
|
11
|
+
range.selectNodeContents(node);
|
|
12
|
+
for (const rect of range.getClientRects()) {
|
|
13
|
+
if (x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom)
|
|
14
|
+
return target;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|