@aspect-ops/exon-ui 0.2.2 → 0.4.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 +0 -45
- package/dist/components/BottomNav/BottomNavItem.svelte +4 -3
- package/dist/components/BottomNav/BottomNavItem.svelte.d.ts +2 -1
- package/dist/components/CTASection/CTASection.svelte +298 -0
- package/dist/components/CTASection/CTASection.svelte.d.ts +15 -0
- package/dist/components/CTASection/index.d.ts +2 -0
- package/dist/components/CTASection/index.js +1 -0
- package/dist/components/DoughnutChart/DoughnutChart.svelte +4 -4
- package/dist/components/FlexibleGrid/FlexibleGrid.svelte +118 -0
- package/dist/components/FlexibleGrid/FlexibleGrid.svelte.d.ts +7 -0
- package/dist/components/FlexibleGrid/README.md +212 -0
- package/dist/components/FlexibleGrid/index.d.ts +2 -0
- package/dist/components/FlexibleGrid/index.js +1 -0
- package/dist/components/GlobalHeader/GlobalHeader.svelte +806 -0
- package/dist/components/GlobalHeader/GlobalHeader.svelte.d.ts +3 -0
- package/dist/components/GlobalHeader/index.d.ts +2 -0
- package/dist/components/GlobalHeader/index.js +1 -0
- package/dist/components/Hero/Hero.svelte +306 -0
- package/dist/components/Hero/Hero.svelte.d.ts +18 -0
- package/dist/components/Hero/index.d.ts +2 -0
- package/dist/components/Hero/index.js +1 -0
- package/dist/components/HeroLeftAligned/HeroLeftAligned.svelte +182 -0
- package/dist/components/HeroLeftAligned/HeroLeftAligned.svelte.d.ts +8 -0
- package/dist/components/HeroLeftAligned/README.md +168 -0
- package/dist/components/HeroLeftAligned/index.d.ts +2 -0
- package/dist/components/HeroLeftAligned/index.js +1 -0
- package/dist/components/IconFeatureCard/IconFeatureCard.svelte +173 -0
- package/dist/components/IconFeatureCard/IconFeatureCard.svelte.d.ts +4 -0
- package/dist/components/IconFeatureCard/README.md +234 -0
- package/dist/components/IconFeatureCard/index.d.ts +2 -0
- package/dist/components/IconFeatureCard/index.js +1 -0
- package/dist/components/ImageTextCard/ImageTextCard.svelte +149 -0
- package/dist/components/ImageTextCard/ImageTextCard.svelte.d.ts +22 -0
- package/dist/components/ImageTextCard/README.md +177 -0
- package/dist/components/ImageTextCard/index.d.ts +2 -0
- package/dist/components/ImageTextCard/index.js +1 -0
- package/dist/components/LogoCloud/LogoCloud.svelte +333 -0
- package/dist/components/LogoCloud/LogoCloud.svelte.d.ts +20 -0
- package/dist/components/LogoCloud/index.d.ts +2 -0
- package/dist/components/LogoCloud/index.js +1 -0
- package/dist/components/ServiceCard/ServiceCard.svelte +359 -0
- package/dist/components/ServiceCard/ServiceCard.svelte.d.ts +16 -0
- package/dist/components/ServiceCard/index.d.ts +1 -0
- package/dist/components/ServiceCard/index.js +1 -0
- package/dist/components/Sidebar/SidebarGroup.svelte +1 -4
- package/dist/components/SplitSection/SplitSection.svelte +194 -0
- package/dist/components/SplitSection/SplitSection.svelte.d.ts +15 -0
- package/dist/components/SplitSection/index.d.ts +1 -0
- package/dist/components/SplitSection/index.js +1 -0
- package/dist/components/TestimonialCard/TestimonialCard.svelte +290 -0
- package/dist/components/TestimonialCard/TestimonialCard.svelte.d.ts +14 -0
- package/dist/components/TestimonialCard/index.d.ts +1 -0
- package/dist/components/TestimonialCard/index.js +1 -0
- package/dist/components/Timeline/Timeline.svelte +444 -0
- package/dist/components/Timeline/Timeline.svelte.d.ts +19 -0
- package/dist/components/Timeline/index.d.ts +2 -0
- package/dist/components/Timeline/index.js +1 -0
- package/dist/index.d.ts +23 -1
- package/dist/index.js +13 -1
- package/dist/types/index.d.ts +49 -1
- package/dist/types/layout.d.ts +20 -0
- package/package.json +9 -2
- package/dist/components/Mermaid/Mermaid.svelte +0 -320
- package/dist/components/Mermaid/Mermaid.svelte.d.ts +0 -38
- package/dist/components/Mermaid/index.d.ts +0 -1
- package/dist/components/Mermaid/index.js +0 -1
- package/dist/components/Mermaid/mermaid.d.ts +0 -21
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface ServiceCardProps {
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
icon?: string | Snippet;
|
|
8
|
+
href?: string;
|
|
9
|
+
gradient?: string | [string, string]; // single color or [from, to]
|
|
10
|
+
variant?: 'gradient' | 'outlined' | 'filled' | 'glass';
|
|
11
|
+
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
linkText?: string; // default "Learn More"
|
|
13
|
+
class?: string;
|
|
14
|
+
onclick?: () => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let {
|
|
18
|
+
title,
|
|
19
|
+
description,
|
|
20
|
+
icon,
|
|
21
|
+
href,
|
|
22
|
+
gradient,
|
|
23
|
+
variant = 'gradient',
|
|
24
|
+
size = 'md',
|
|
25
|
+
linkText = 'Learn More',
|
|
26
|
+
class: className = '',
|
|
27
|
+
onclick
|
|
28
|
+
}: ServiceCardProps = $props();
|
|
29
|
+
|
|
30
|
+
// Determine if the icon is an emoji (single character)
|
|
31
|
+
const isEmoji = $derived(typeof icon === 'string' && icon.length <= 2);
|
|
32
|
+
const isIconName = $derived(typeof icon === 'string' && icon.length > 2);
|
|
33
|
+
|
|
34
|
+
// Build gradient style
|
|
35
|
+
const gradientStyle = $derived(() => {
|
|
36
|
+
if (!gradient || variant !== 'gradient') return '';
|
|
37
|
+
if (typeof gradient === 'string') {
|
|
38
|
+
return `--service-card-gradient-from: ${gradient}; --service-card-gradient-to: ${gradient};`;
|
|
39
|
+
}
|
|
40
|
+
return `--service-card-gradient-from: ${gradient[0]}; --service-card-gradient-to: ${gradient[1]};`;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// Determine component type
|
|
44
|
+
const Component = $derived(href ? 'a' : 'div');
|
|
45
|
+
const isClickable = $derived(!!href || !!onclick);
|
|
46
|
+
|
|
47
|
+
function handleClick(e: MouseEvent) {
|
|
48
|
+
if (onclick && !href) {
|
|
49
|
+
onclick();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<svelte:element
|
|
55
|
+
this={Component}
|
|
56
|
+
{href}
|
|
57
|
+
class="service-card service-card--{variant} service-card--{size} {className}"
|
|
58
|
+
style={gradientStyle()}
|
|
59
|
+
onclick={handleClick}
|
|
60
|
+
role={isClickable && !href ? 'button' : undefined}
|
|
61
|
+
tabindex={isClickable && !href ? 0 : undefined}
|
|
62
|
+
onkeydown={(e) => {
|
|
63
|
+
if (isClickable && !href && (e.key === 'Enter' || e.key === ' ')) {
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
handleClick(e);
|
|
66
|
+
}
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
{#if icon}
|
|
70
|
+
<div class="service-card__icon">
|
|
71
|
+
{#if isEmoji}
|
|
72
|
+
<span class="service-card__emoji" aria-hidden="true">{icon}</span>
|
|
73
|
+
{:else if isIconName}
|
|
74
|
+
<span class="service-card__icon-name" aria-hidden="true">{icon}</span>
|
|
75
|
+
{:else if typeof icon !== 'string'}
|
|
76
|
+
{@render icon()}
|
|
77
|
+
{/if}
|
|
78
|
+
</div>
|
|
79
|
+
{/if}
|
|
80
|
+
|
|
81
|
+
<div class="service-card__content">
|
|
82
|
+
<h3 class="service-card__title">{title}</h3>
|
|
83
|
+
<p class="service-card__description">{description}</p>
|
|
84
|
+
|
|
85
|
+
{#if isClickable}
|
|
86
|
+
<span class="service-card__link">
|
|
87
|
+
{linkText}
|
|
88
|
+
<span class="service-card__arrow" aria-hidden="true">→</span>
|
|
89
|
+
</span>
|
|
90
|
+
{/if}
|
|
91
|
+
</div>
|
|
92
|
+
</svelte:element>
|
|
93
|
+
|
|
94
|
+
<style>
|
|
95
|
+
.service-card {
|
|
96
|
+
/* CSS Variables */
|
|
97
|
+
--service-card-gradient-from: #667eea;
|
|
98
|
+
--service-card-gradient-to: #764ba2;
|
|
99
|
+
--service-card-text-color: #ffffff;
|
|
100
|
+
--service-card-padding: 1.5rem;
|
|
101
|
+
--service-card-radius: 0.75rem;
|
|
102
|
+
|
|
103
|
+
/* Base styles */
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-direction: column;
|
|
106
|
+
gap: 1rem;
|
|
107
|
+
padding: var(--service-card-padding);
|
|
108
|
+
border-radius: var(--service-card-radius);
|
|
109
|
+
color: var(--service-card-text-color);
|
|
110
|
+
text-decoration: none;
|
|
111
|
+
position: relative;
|
|
112
|
+
transition:
|
|
113
|
+
transform 0.3s ease,
|
|
114
|
+
box-shadow 0.3s ease;
|
|
115
|
+
min-height: 16rem;
|
|
116
|
+
overflow: hidden;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* Clickable states */
|
|
120
|
+
.service-card[href],
|
|
121
|
+
.service-card[role='button'] {
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.service-card:hover {
|
|
126
|
+
transform: translateY(-0.25rem);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.service-card:focus-visible {
|
|
130
|
+
outline: 2px solid currentColor;
|
|
131
|
+
outline-offset: 2px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* Gradient variant */
|
|
135
|
+
.service-card--gradient {
|
|
136
|
+
background: linear-gradient(
|
|
137
|
+
135deg,
|
|
138
|
+
var(--service-card-gradient-from),
|
|
139
|
+
var(--service-card-gradient-to)
|
|
140
|
+
);
|
|
141
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.service-card--gradient:hover {
|
|
145
|
+
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* Outlined variant */
|
|
149
|
+
.service-card--outlined {
|
|
150
|
+
background: transparent;
|
|
151
|
+
border: 2px solid currentColor;
|
|
152
|
+
color: var(--text-color, #1f2937);
|
|
153
|
+
--service-card-text-color: var(--text-color, #1f2937);
|
|
154
|
+
transition:
|
|
155
|
+
transform 0.3s ease,
|
|
156
|
+
box-shadow 0.3s ease,
|
|
157
|
+
background-color 0.3s ease;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.service-card--outlined:hover {
|
|
161
|
+
background-color: rgba(102, 126, 234, 0.05);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* Filled variant */
|
|
165
|
+
.service-card--filled {
|
|
166
|
+
background: var(--service-card-gradient-from, #667eea);
|
|
167
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.service-card--filled:hover {
|
|
171
|
+
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* Glass variant */
|
|
175
|
+
.service-card--glass {
|
|
176
|
+
background: rgba(255, 255, 255, 0.1);
|
|
177
|
+
backdrop-filter: blur(10px);
|
|
178
|
+
-webkit-backdrop-filter: blur(10px);
|
|
179
|
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
180
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
181
|
+
color: var(--text-color, #1f2937);
|
|
182
|
+
--service-card-text-color: var(--text-color, #1f2937);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.service-card--glass:hover {
|
|
186
|
+
background: rgba(255, 255, 255, 0.15);
|
|
187
|
+
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* Size variants */
|
|
191
|
+
.service-card--sm {
|
|
192
|
+
--service-card-padding: 1rem;
|
|
193
|
+
min-height: 12rem;
|
|
194
|
+
gap: 0.75rem;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.service-card--md {
|
|
198
|
+
--service-card-padding: 1.5rem;
|
|
199
|
+
min-height: 16rem;
|
|
200
|
+
gap: 1rem;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.service-card--lg {
|
|
204
|
+
--service-card-padding: 2rem;
|
|
205
|
+
min-height: 20rem;
|
|
206
|
+
gap: 1.5rem;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/* Icon */
|
|
210
|
+
.service-card__icon {
|
|
211
|
+
display: flex;
|
|
212
|
+
align-items: center;
|
|
213
|
+
justify-content: flex-start;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.service-card__emoji {
|
|
217
|
+
font-size: 3rem;
|
|
218
|
+
line-height: 1;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.service-card--sm .service-card__emoji {
|
|
222
|
+
font-size: 2rem;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.service-card--lg .service-card__emoji {
|
|
226
|
+
font-size: 4rem;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.service-card__icon-name {
|
|
230
|
+
font-size: 1.5rem;
|
|
231
|
+
font-weight: 600;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/* Content */
|
|
235
|
+
.service-card__content {
|
|
236
|
+
display: flex;
|
|
237
|
+
flex-direction: column;
|
|
238
|
+
gap: 0.5rem;
|
|
239
|
+
flex: 1;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.service-card__title {
|
|
243
|
+
margin: 0;
|
|
244
|
+
font-size: 1.5rem;
|
|
245
|
+
font-weight: 700;
|
|
246
|
+
line-height: 1.3;
|
|
247
|
+
color: inherit;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.service-card--sm .service-card__title {
|
|
251
|
+
font-size: 1.25rem;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.service-card--lg .service-card__title {
|
|
255
|
+
font-size: 1.75rem;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.service-card__description {
|
|
259
|
+
margin: 0;
|
|
260
|
+
font-size: 1rem;
|
|
261
|
+
line-height: 1.6;
|
|
262
|
+
color: inherit;
|
|
263
|
+
opacity: 0.95;
|
|
264
|
+
flex: 1;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.service-card--sm .service-card__description {
|
|
268
|
+
font-size: 0.875rem;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.service-card--lg .service-card__description {
|
|
272
|
+
font-size: 1.125rem;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/* Link */
|
|
276
|
+
.service-card__link {
|
|
277
|
+
display: inline-flex;
|
|
278
|
+
align-items: center;
|
|
279
|
+
gap: 0.5rem;
|
|
280
|
+
font-weight: 600;
|
|
281
|
+
font-size: 1rem;
|
|
282
|
+
margin-top: auto;
|
|
283
|
+
color: inherit;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.service-card--sm .service-card__link {
|
|
287
|
+
font-size: 0.875rem;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.service-card--lg .service-card__link {
|
|
291
|
+
font-size: 1.125rem;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.service-card__arrow {
|
|
295
|
+
display: inline-block;
|
|
296
|
+
transition: transform 0.3s ease;
|
|
297
|
+
font-size: 1.25em;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.service-card:hover .service-card__arrow {
|
|
301
|
+
transform: translateX(0.25rem);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/* Dark mode support */
|
|
305
|
+
@media (prefers-color-scheme: dark) {
|
|
306
|
+
.service-card--outlined,
|
|
307
|
+
.service-card--glass {
|
|
308
|
+
--service-card-text-color: #f9fafb;
|
|
309
|
+
color: var(--service-card-text-color);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.service-card--outlined {
|
|
313
|
+
border-color: rgba(255, 255, 255, 0.2);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.service-card--outlined:hover {
|
|
317
|
+
background-color: rgba(102, 126, 234, 0.1);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.service-card--glass {
|
|
321
|
+
background: rgba(0, 0, 0, 0.2);
|
|
322
|
+
border-color: rgba(255, 255, 255, 0.1);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.service-card--glass:hover {
|
|
326
|
+
background: rgba(0, 0, 0, 0.3);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/* Touch target minimum */
|
|
331
|
+
@media (pointer: coarse) {
|
|
332
|
+
.service-card {
|
|
333
|
+
min-height: 11rem; /* 176px, ensures adequate touch target */
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.service-card--sm {
|
|
337
|
+
min-height: 9rem;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.service-card--lg {
|
|
341
|
+
min-height: 13rem;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/* Responsive adjustments */
|
|
346
|
+
@media (min-width: 768px) {
|
|
347
|
+
.service-card {
|
|
348
|
+
min-height: 18rem;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.service-card--sm {
|
|
352
|
+
min-height: 14rem;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.service-card--lg {
|
|
356
|
+
min-height: 22rem;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface ServiceCardProps {
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
icon?: string | Snippet;
|
|
6
|
+
href?: string;
|
|
7
|
+
gradient?: string | [string, string];
|
|
8
|
+
variant?: 'gradient' | 'outlined' | 'filled' | 'glass';
|
|
9
|
+
size?: 'sm' | 'md' | 'lg';
|
|
10
|
+
linkText?: string;
|
|
11
|
+
class?: string;
|
|
12
|
+
onclick?: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare const ServiceCard: import("svelte").Component<ServiceCardProps, {}, "">;
|
|
15
|
+
type ServiceCard = ReturnType<typeof ServiceCard>;
|
|
16
|
+
export default ServiceCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ServiceCard } from './ServiceCard.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ServiceCard } from './ServiceCard.svelte';
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface SplitSectionProps {
|
|
5
|
+
reverse?: boolean;
|
|
6
|
+
ratio?: '1:1' | '1:2' | '2:1' | '3:2' | '2:3';
|
|
7
|
+
background?: string;
|
|
8
|
+
animated?: boolean;
|
|
9
|
+
verticalAlign?: 'top' | 'center' | 'bottom';
|
|
10
|
+
gap?: 'none' | 'sm' | 'md' | 'lg';
|
|
11
|
+
class?: string;
|
|
12
|
+
content: Snippet;
|
|
13
|
+
media: Snippet;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
reverse = false,
|
|
18
|
+
ratio = '1:1',
|
|
19
|
+
background,
|
|
20
|
+
animated = false,
|
|
21
|
+
verticalAlign = 'center',
|
|
22
|
+
gap = 'md',
|
|
23
|
+
class: className = '',
|
|
24
|
+
content,
|
|
25
|
+
media
|
|
26
|
+
}: SplitSectionProps = $props();
|
|
27
|
+
|
|
28
|
+
const ratioMap: Record<string, { content: string; media: string }> = {
|
|
29
|
+
'1:1': { content: '50%', media: '50%' },
|
|
30
|
+
'1:2': { content: '33.33%', media: '66.66%' },
|
|
31
|
+
'2:1': { content: '66.66%', media: '33.33%' },
|
|
32
|
+
'3:2': { content: '60%', media: '40%' },
|
|
33
|
+
'2:3': { content: '40%', media: '60%' }
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const gapMap: Record<string, string> = {
|
|
37
|
+
none: '0',
|
|
38
|
+
sm: '1rem',
|
|
39
|
+
md: '2rem',
|
|
40
|
+
lg: '4rem'
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const alignMap: Record<string, string> = {
|
|
44
|
+
top: 'flex-start',
|
|
45
|
+
center: 'center',
|
|
46
|
+
bottom: 'flex-end'
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const contentFlexBasis = $derived(ratioMap[ratio].content);
|
|
50
|
+
const mediaFlexBasis = $derived(ratioMap[ratio].media);
|
|
51
|
+
const gapValue = $derived(gapMap[gap]);
|
|
52
|
+
const alignValue = $derived(alignMap[verticalAlign]);
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<section
|
|
56
|
+
class="split-section {className}"
|
|
57
|
+
class:reverse
|
|
58
|
+
class:animated
|
|
59
|
+
style:--split-section-bg={background}
|
|
60
|
+
style:--split-section-gap={gapValue}
|
|
61
|
+
style:--content-flex-basis={contentFlexBasis}
|
|
62
|
+
style:--media-flex-basis={mediaFlexBasis}
|
|
63
|
+
style:--vertical-align={alignValue}
|
|
64
|
+
>
|
|
65
|
+
{#if animated}
|
|
66
|
+
<div class="background-decorations" aria-hidden="true">
|
|
67
|
+
<div class="shape shape-1"></div>
|
|
68
|
+
<div class="shape shape-2"></div>
|
|
69
|
+
<div class="shape shape-3"></div>
|
|
70
|
+
</div>
|
|
71
|
+
{/if}
|
|
72
|
+
|
|
73
|
+
<div class="content-wrapper">
|
|
74
|
+
{@render content()}
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div class="media-wrapper">
|
|
78
|
+
{@render media()}
|
|
79
|
+
</div>
|
|
80
|
+
</section>
|
|
81
|
+
|
|
82
|
+
<style>
|
|
83
|
+
.split-section {
|
|
84
|
+
position: relative;
|
|
85
|
+
display: flex;
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
gap: var(--split-section-gap, 2rem);
|
|
88
|
+
padding: var(--split-section-padding, 2rem 1rem);
|
|
89
|
+
background: var(--split-section-bg, transparent);
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Desktop layout */
|
|
94
|
+
@media (min-width: 768px) {
|
|
95
|
+
.split-section {
|
|
96
|
+
flex-direction: row;
|
|
97
|
+
align-items: var(--vertical-align, center);
|
|
98
|
+
padding: var(--split-section-padding, 4rem 2rem);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.split-section.reverse {
|
|
102
|
+
flex-direction: row-reverse;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.content-wrapper {
|
|
106
|
+
flex-basis: var(--content-flex-basis, 50%);
|
|
107
|
+
flex-shrink: 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.media-wrapper {
|
|
111
|
+
flex-basis: var(--media-flex-basis, 50%);
|
|
112
|
+
flex-shrink: 0;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@media (min-width: 1024px) {
|
|
117
|
+
.split-section {
|
|
118
|
+
padding: var(--split-section-padding, 6rem 4rem);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* Mobile: content always first, full width */
|
|
123
|
+
.content-wrapper,
|
|
124
|
+
.media-wrapper {
|
|
125
|
+
width: 100%;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* Background decorations */
|
|
129
|
+
.background-decorations {
|
|
130
|
+
position: absolute;
|
|
131
|
+
inset: 0;
|
|
132
|
+
pointer-events: none;
|
|
133
|
+
z-index: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.shape {
|
|
137
|
+
position: absolute;
|
|
138
|
+
border-radius: 50%;
|
|
139
|
+
background: var(--split-section-animation-color, rgba(99, 102, 241, 0.1));
|
|
140
|
+
filter: blur(60px);
|
|
141
|
+
animation: pulse 4s ease-in-out infinite;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.shape-1 {
|
|
145
|
+
width: 300px;
|
|
146
|
+
height: 300px;
|
|
147
|
+
top: -100px;
|
|
148
|
+
left: -100px;
|
|
149
|
+
animation-delay: 0s;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.shape-2 {
|
|
153
|
+
width: 400px;
|
|
154
|
+
height: 400px;
|
|
155
|
+
bottom: -150px;
|
|
156
|
+
right: -150px;
|
|
157
|
+
animation-delay: 1.5s;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.shape-3 {
|
|
161
|
+
width: 250px;
|
|
162
|
+
height: 250px;
|
|
163
|
+
top: 50%;
|
|
164
|
+
right: 10%;
|
|
165
|
+
animation-delay: 3s;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
@keyframes pulse {
|
|
169
|
+
0%,
|
|
170
|
+
100% {
|
|
171
|
+
opacity: 0.3;
|
|
172
|
+
transform: scale(1);
|
|
173
|
+
}
|
|
174
|
+
50% {
|
|
175
|
+
opacity: 0.6;
|
|
176
|
+
transform: scale(1.1);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/* Respect prefers-reduced-motion */
|
|
181
|
+
@media (prefers-reduced-motion: reduce) {
|
|
182
|
+
.shape {
|
|
183
|
+
animation: none;
|
|
184
|
+
opacity: 0.3;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* Ensure content is above decorations */
|
|
189
|
+
.content-wrapper,
|
|
190
|
+
.media-wrapper {
|
|
191
|
+
position: relative;
|
|
192
|
+
z-index: 1;
|
|
193
|
+
}
|
|
194
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface SplitSectionProps {
|
|
3
|
+
reverse?: boolean;
|
|
4
|
+
ratio?: '1:1' | '1:2' | '2:1' | '3:2' | '2:3';
|
|
5
|
+
background?: string;
|
|
6
|
+
animated?: boolean;
|
|
7
|
+
verticalAlign?: 'top' | 'center' | 'bottom';
|
|
8
|
+
gap?: 'none' | 'sm' | 'md' | 'lg';
|
|
9
|
+
class?: string;
|
|
10
|
+
content: Snippet;
|
|
11
|
+
media: Snippet;
|
|
12
|
+
}
|
|
13
|
+
declare const SplitSection: import("svelte").Component<SplitSectionProps, {}, "">;
|
|
14
|
+
type SplitSection = ReturnType<typeof SplitSection>;
|
|
15
|
+
export default SplitSection;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SplitSection } from './SplitSection.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SplitSection } from './SplitSection.svelte';
|