spoko-design-system 1.1.1 → 1.1.2
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/.claude/settings.local.json +2 -1
- package/.github/workflows/code-quality.yml +3 -3
- package/.prettierrc +1 -0
- package/CHANGELOG.md +6 -0
- package/package.json +8 -2
- package/src/MyComponent.astro +1 -1
- package/src/components/Badge.vue +2 -2
- package/src/components/Badges.vue +17 -7
- package/src/components/Breadcrumbs.vue +47 -39
- package/src/components/Button.vue +31 -30
- package/src/components/ButtonCopy.astro +12 -17
- package/src/components/ButtonCopy.vue +26 -25
- package/src/components/Card.astro +4 -6
- package/src/components/Carousel.astro +4 -4
- package/src/components/Category/CategoriesCarousel.astro +75 -75
- package/src/components/Category/CategoryDetails.astro +75 -79
- package/src/components/Category/CategoryLink.vue +8 -12
- package/src/components/Category/CategorySidebarToggler.vue +2 -7
- package/src/components/Category/CategoryTile.astro +3 -3
- package/src/components/Category/CategoryViewToggler.astro +18 -18
- package/src/components/Category/SubCategoryLink.vue +13 -13
- package/src/components/Faq.astro +16 -17
- package/src/components/FaqItem.astro +27 -27
- package/src/components/FeaturesList.vue +19 -29
- package/src/components/FuckRussia.vue +40 -27
- package/src/components/HandDrive.astro +11 -15
- package/src/components/Header/Header.astro +165 -166
- package/src/components/Header/SkipToContent.astro +1 -1
- package/src/components/Headline.vue +44 -27
- package/src/components/Image.astro +5 -7
- package/src/components/Input.vue +143 -153
- package/src/components/Jumbotron/index.astro +143 -156
- package/src/components/Jumbotron/types.ts +28 -29
- package/src/components/Jumbotron/variants/Default.astro +44 -40
- package/src/components/Jumbotron/variants/Hero.astro +45 -53
- package/src/components/Jumbotron/variants/Post.astro +68 -64
- package/src/components/Jumbotron/variants/PostSplit.astro +89 -81
- package/src/components/Jumbotron.astro +12 -12
- package/src/components/LanguageSuggestion.astro +66 -69
- package/src/components/LeftSidebar.astro +10 -10
- package/src/components/MainColors.vue +2 -2
- package/src/components/MainInput.vue +6 -3
- package/src/components/Modal.astro +2 -2
- package/src/components/PartNumber.vue +2 -3
- package/src/components/Post/PostCategories.astro +2 -4
- package/src/components/Post/PostCategories.vue +2 -2
- package/src/components/PostHeader.astro +4 -6
- package/src/components/PrCode.vue +20 -19
- package/src/components/Product/ProductButton.vue +2 -5
- package/src/components/Product/ProductCarousel.astro +38 -27
- package/src/components/Product/ProductColors.vue +46 -42
- package/src/components/Product/ProductDetailName.vue +22 -22
- package/src/components/Product/ProductDetails.vue +115 -99
- package/src/components/Product/ProductDoc.vue +27 -25
- package/src/components/Product/ProductEngineType.vue +13 -10
- package/src/components/Product/ProductImage.astro +18 -19
- package/src/components/Product/ProductLink.vue +55 -58
- package/src/components/Product/ProductLinkInfo.astro +15 -18
- package/src/components/Product/ProductModel.vue +25 -24
- package/src/components/Product/ProductModels.vue +29 -33
- package/src/components/Product/ProductName.vue +15 -15
- package/src/components/Product/ProductNumber.astro +23 -31
- package/src/components/Product/ProductPositions.vue +32 -34
- package/src/components/ProductCarousel.astro +5 -5
- package/src/components/ProductCodes.vue +12 -14
- package/src/components/ProductDetailName.vue +18 -20
- package/src/components/ProductDetailsList.vue +48 -27
- package/src/components/Quote.vue +8 -6
- package/src/components/ReloadPrompt.astro +39 -47
- package/src/components/SlimBanner.vue +44 -19
- package/src/components/Table.vue +4 -6
- package/src/components/Translations.vue +17 -8
- package/src/components/flags/FlagPL.vue +4 -3
- package/src/components/flags/FlagUA.vue +2 -2
- package/src/components/layout/CallToAction.astro +17 -12
- package/src/components/layout/Container.astro +3 -1
- package/src/components/layout/Header.astro +12 -21
- package/src/config.ts +43 -43
- package/src/design.config.ts +63 -63
- package/src/env.d.ts +4 -4
- package/src/layouts/Layout.astro +10 -19
- package/src/layouts/MainLayout.astro +13 -19
- package/src/layouts/partials/FooterCommon.astro +2 -2
- package/src/layouts/partials/HeadCommon.astro +9 -9
- package/src/layouts/partials/HeadSEO.astro +12 -5
- package/src/pages/components/icons.astro +130 -121
- package/src/pages/core/shadows.astro +18 -11
- package/src/pages/index.astro +178 -75
- package/src/pwa.ts +4 -4
- package/src/styles/base/base.css +14 -19
- package/src/styles/base/grid.css +54 -58
- package/src/styles/base/typography.css +40 -40
- package/src/styles/content.css +25 -23
- package/src/styles/main.css +5 -6
- package/src/types/Product.ts +31 -31
- package/src/types/astro.d.ts +1 -1
- package/src/types/index.ts +234 -237
- package/src/utils/api/getCategories.ts +9 -9
- package/src/utils/category/getMainCategoryList.ts +22 -22
- package/src/utils/category/getSortedCategories.ts +7 -11
- package/src/utils/product/getPriceFormatted.ts +14 -11
- package/src/utils/product/getProductChecklist.ts +10 -11
- package/src/utils/product/useFormatProductNumber.ts +18 -9
- package/src/utils/seo/getShorterDescription.ts +6 -4
- package/src/utils/text/formatDate.ts +2 -3
- package/src/utils/text/formatLocaleNumber.ts +2 -2
- package/src/utils/text/formatPad.ts +2 -2
- package/src/utils/text/getNumberFormatted.ts +10 -10
- package/src/utils/text/getTranslatedLink.ts +3 -3
- package/src/utils/text.ts +11 -8
|
@@ -1,156 +1,143 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { Author, Category } from './types';
|
|
3
|
-
import DefaultVariant from './variants/Default.astro';
|
|
4
|
-
import HeroVariant from './variants/Hero.astro';
|
|
5
|
-
import PostVariant from './variants/Post.astro';
|
|
6
|
-
import PostSplitVariant from './variants/PostSplit.astro';
|
|
7
|
-
|
|
8
|
-
interface Props {
|
|
9
|
-
variant?:
|
|
10
|
-
title?: string;
|
|
11
|
-
image?: string;
|
|
12
|
-
small?: boolean;
|
|
13
|
-
description?: string;
|
|
14
|
-
info?: string;
|
|
15
|
-
date?: string;
|
|
16
|
-
author?: Author;
|
|
17
|
-
categories?: Category[];
|
|
18
|
-
backgroundClass?: string;
|
|
19
|
-
lang?: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const {
|
|
23
|
-
variant =
|
|
24
|
-
title =
|
|
25
|
-
image,
|
|
26
|
-
small = false,
|
|
27
|
-
description,
|
|
28
|
-
info,
|
|
29
|
-
date,
|
|
30
|
-
author,
|
|
31
|
-
categories = [],
|
|
32
|
-
backgroundClass = 'bg-blue-darker',
|
|
33
|
-
lang = 'en'
|
|
34
|
-
} = Astro.props;
|
|
35
|
-
|
|
36
|
-
// Helper (function to check if a slot has content)
|
|
37
|
-
const hasSlotContent = async
|
|
38
|
-
const slot = await Astro.slots.render(slotName);
|
|
39
|
-
return slot?.trim().length > 0;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
// Get content status
|
|
43
|
-
const hasIntroContent = await hasSlotContent('intro');
|
|
44
|
-
const hasSubtitleContent = await hasSlotContent('subtitle');
|
|
45
|
-
const hasCtaContent = await hasSlotContent('cta-content');
|
|
46
|
-
|
|
47
|
-
// Content helpers
|
|
48
|
-
const hasMetadata = author || date;
|
|
49
|
-
const hasCategories = categories.length > 0;
|
|
50
|
-
|
|
51
|
-
// Props to pass to variants
|
|
52
|
-
const commonProps = {
|
|
53
|
-
title,
|
|
54
|
-
image,
|
|
55
|
-
hasIntroContent,
|
|
56
|
-
hasSubtitleContent,
|
|
57
|
-
hasCtaContent,
|
|
58
|
-
hasMetadata,
|
|
59
|
-
hasCategories,
|
|
60
|
-
backgroundClass,
|
|
61
|
-
lang,
|
|
62
|
-
};
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
{
|
|
66
|
-
|
|
67
|
-
{...commonProps}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
)
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
h1 {
|
|
146
|
-
b {
|
|
147
|
-
@apply font-headregular whitespace-nowrap;
|
|
148
|
-
}
|
|
149
|
-
small {
|
|
150
|
-
@apply text-6 whitespace-nowrap;
|
|
151
|
-
}
|
|
152
|
-
span {
|
|
153
|
-
@apply text-accent-light;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
</style>
|
|
1
|
+
---
|
|
2
|
+
import type { Author, Category } from './types';
|
|
3
|
+
import DefaultVariant from './variants/Default.astro';
|
|
4
|
+
import HeroVariant from './variants/Hero.astro';
|
|
5
|
+
import PostVariant from './variants/Post.astro';
|
|
6
|
+
import PostSplitVariant from './variants/PostSplit.astro';
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
variant?: 'default' | 'hero' | 'post' | 'post-split';
|
|
10
|
+
title?: string;
|
|
11
|
+
image?: string;
|
|
12
|
+
small?: boolean;
|
|
13
|
+
description?: string;
|
|
14
|
+
info?: string;
|
|
15
|
+
date?: string;
|
|
16
|
+
author?: Author;
|
|
17
|
+
categories?: Category[];
|
|
18
|
+
backgroundClass?: string;
|
|
19
|
+
lang?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
variant = 'default',
|
|
24
|
+
title = '',
|
|
25
|
+
image,
|
|
26
|
+
small = false,
|
|
27
|
+
description,
|
|
28
|
+
info,
|
|
29
|
+
date,
|
|
30
|
+
author,
|
|
31
|
+
categories = [],
|
|
32
|
+
backgroundClass = 'bg-blue-darker',
|
|
33
|
+
lang = 'en',
|
|
34
|
+
} = Astro.props;
|
|
35
|
+
|
|
36
|
+
// Helper (function to check if a slot has content)
|
|
37
|
+
const hasSlotContent = async slotName => {
|
|
38
|
+
const slot = await Astro.slots.render(slotName);
|
|
39
|
+
return slot?.trim().length > 0;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// Get content status
|
|
43
|
+
const hasIntroContent = await hasSlotContent('intro');
|
|
44
|
+
const hasSubtitleContent = await hasSlotContent('subtitle');
|
|
45
|
+
const hasCtaContent = await hasSlotContent('cta-content');
|
|
46
|
+
|
|
47
|
+
// Content helpers
|
|
48
|
+
const hasMetadata = author || date;
|
|
49
|
+
const hasCategories = categories.length > 0;
|
|
50
|
+
|
|
51
|
+
// Props to pass to variants
|
|
52
|
+
const commonProps = {
|
|
53
|
+
title,
|
|
54
|
+
image,
|
|
55
|
+
hasIntroContent,
|
|
56
|
+
hasSubtitleContent,
|
|
57
|
+
hasCtaContent,
|
|
58
|
+
hasMetadata,
|
|
59
|
+
hasCategories,
|
|
60
|
+
backgroundClass,
|
|
61
|
+
lang,
|
|
62
|
+
};
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
{
|
|
66
|
+
variant === 'default' && (
|
|
67
|
+
<DefaultVariant {...commonProps} small={small}>
|
|
68
|
+
<slot name="intro" slot="intro" />
|
|
69
|
+
<slot name="subtitle" slot="subtitle" />
|
|
70
|
+
<slot name="cta-content" slot="cta-content" />
|
|
71
|
+
</DefaultVariant>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
{variant === 'hero' && <HeroVariant {...commonProps} description={description} info={info} />}
|
|
76
|
+
|
|
77
|
+
{
|
|
78
|
+
variant === 'post' && (
|
|
79
|
+
<PostVariant {...commonProps} author={author} date={date} categories={categories} />
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
{
|
|
84
|
+
variant === 'post-split' && (
|
|
85
|
+
<PostSplitVariant {...commonProps} author={author} date={date} categories={categories} />
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
<style>
|
|
90
|
+
.bg-vw {
|
|
91
|
+
background: radial-gradient(circle at 50% 85%, #00437a 0%, #001e50 100%);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.featured-image-overlay {
|
|
95
|
+
@apply absolute top-0 bottom-0 left-0 right-0 overflow-hidden w-full bg-gray-100 z-1;
|
|
96
|
+
|
|
97
|
+
&:before,
|
|
98
|
+
&:after {
|
|
99
|
+
@apply content-empty top-0 bottom-0 left-0 right-0 absolute;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&:before {
|
|
103
|
+
z-index: 5;
|
|
104
|
+
background: linear-gradient(
|
|
105
|
+
0deg,
|
|
106
|
+
rgba(0, 0, 0, 0.95),
|
|
107
|
+
transparent 30%,
|
|
108
|
+
transparent 70%,
|
|
109
|
+
rgba(0, 0, 0, 0.95)
|
|
110
|
+
);
|
|
111
|
+
opacity: 0.5;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&:after {
|
|
115
|
+
background: radial-gradient(circle at 50% 85%, #00437a 0, #001e50 100%);
|
|
116
|
+
opacity: 0.8;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.featured-image {
|
|
121
|
+
width: 100%;
|
|
122
|
+
@apply bg-blue-900;
|
|
123
|
+
|
|
124
|
+
img {
|
|
125
|
+
width: 100%;
|
|
126
|
+
object-fit: cover;
|
|
127
|
+
max-width: 100%;
|
|
128
|
+
display: block;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
h1 {
|
|
133
|
+
b {
|
|
134
|
+
@apply font-headregular whitespace-nowrap;
|
|
135
|
+
}
|
|
136
|
+
small {
|
|
137
|
+
@apply text-6 whitespace-nowrap;
|
|
138
|
+
}
|
|
139
|
+
span {
|
|
140
|
+
@apply text-accent-light;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
</style>
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
// types.ts
|
|
2
|
-
export interface Author {
|
|
3
|
-
firstName?: string;
|
|
4
|
-
name: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface Category {
|
|
8
|
-
name: string;
|
|
9
|
-
uri: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface Props {
|
|
13
|
-
// Common props
|
|
14
|
-
variant?:
|
|
15
|
-
title?: string;
|
|
16
|
-
image?: string;
|
|
17
|
-
backgroundClass?: string;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
1
|
+
// types.ts
|
|
2
|
+
export interface Author {
|
|
3
|
+
firstName?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface Category {
|
|
8
|
+
name: string;
|
|
9
|
+
uri: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface Props {
|
|
13
|
+
// Common props
|
|
14
|
+
variant?: 'default' | 'hero' | 'post' | 'post-split';
|
|
15
|
+
title?: string;
|
|
16
|
+
image?: string;
|
|
17
|
+
backgroundClass?: string;
|
|
18
|
+
|
|
19
|
+
// Default & Hero variant props
|
|
20
|
+
small?: boolean;
|
|
21
|
+
description?: string;
|
|
22
|
+
info?: string;
|
|
23
|
+
|
|
24
|
+
// Post variants props
|
|
25
|
+
date?: string;
|
|
26
|
+
author?: Author;
|
|
27
|
+
categories?: Category[];
|
|
28
|
+
}
|
|
@@ -1,40 +1,44 @@
|
|
|
1
|
-
---
|
|
2
|
-
// variants/Default.astro
|
|
3
|
-
interface Props {
|
|
4
|
-
title?: string;
|
|
5
|
-
small?: boolean;
|
|
6
|
-
hasIntroContent: boolean;
|
|
7
|
-
hasSubtitleContent: boolean;
|
|
8
|
-
hasCtaContent: boolean;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const {
|
|
12
|
-
title =
|
|
13
|
-
small = false,
|
|
14
|
-
hasIntroContent,
|
|
15
|
-
hasSubtitleContent,
|
|
16
|
-
hasCtaContent,
|
|
17
|
-
} = Astro.props;
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
<header
|
|
21
|
-
class:list={[
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
small ?
|
|
25
|
-
]}
|
|
26
|
-
>
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
---
|
|
2
|
+
// variants/Default.astro
|
|
3
|
+
interface Props {
|
|
4
|
+
title?: string;
|
|
5
|
+
small?: boolean;
|
|
6
|
+
hasIntroContent: boolean;
|
|
7
|
+
hasSubtitleContent: boolean;
|
|
8
|
+
hasCtaContent: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
title = '',
|
|
13
|
+
small = false,
|
|
14
|
+
hasIntroContent,
|
|
15
|
+
hasSubtitleContent,
|
|
16
|
+
hasCtaContent,
|
|
17
|
+
} = Astro.props;
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
<header
|
|
21
|
+
class:list={[
|
|
22
|
+
'flow content-grid', // globalne klasy
|
|
23
|
+
'jumbotron-header-base bg-vw', // klasy bazowe i tło
|
|
24
|
+
small ? 'jumbotron-container-small' : 'jumbotron-container-large', // wariant rozmiaru
|
|
25
|
+
]}
|
|
26
|
+
>
|
|
27
|
+
{
|
|
28
|
+
hasIntroContent ? (
|
|
29
|
+
<slot name="intro" />
|
|
30
|
+
) : (
|
|
31
|
+
<h1 class="jumbotron-title-default" set:html={title} />
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
{hasSubtitleContent && <slot name="subtitle" />}
|
|
36
|
+
|
|
37
|
+
{
|
|
38
|
+
hasCtaContent && (
|
|
39
|
+
<div class="jumbotron-cta-wrapper">
|
|
40
|
+
<slot name="cta-content" />
|
|
41
|
+
</div>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
</header>
|
|
@@ -1,53 +1,45 @@
|
|
|
1
|
-
---
|
|
2
|
-
// variants/Hero.astro
|
|
3
|
-
interface Props {
|
|
4
|
-
title?: string;
|
|
5
|
-
image?: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
info?: string;
|
|
8
|
-
backgroundClass?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
/>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<div
|
|
47
|
-
class="font-medium mb-4 line-clamp-1 text-base sm:text-lg mt-2"
|
|
48
|
-
set:html={info}
|
|
49
|
-
/>
|
|
50
|
-
)}
|
|
51
|
-
</header>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
1
|
+
---
|
|
2
|
+
// variants/Hero.astro
|
|
3
|
+
interface Props {
|
|
4
|
+
title?: string;
|
|
5
|
+
image?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
info?: string;
|
|
8
|
+
backgroundClass?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const { title = '', image, description, info, backgroundClass } = Astro.props;
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<div class={`relative w-full ${backgroundClass}`}>
|
|
15
|
+
{
|
|
16
|
+
image && (
|
|
17
|
+
<div class="absolute inset-0 w-full h-full">
|
|
18
|
+
<div class="absolute inset-0 bg-gradient-to-r from-blue-900 to-transparent opacity-90 z-1" />
|
|
19
|
+
<img class="w-full h-full object-cover" src={image} alt={title} />
|
|
20
|
+
</div>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
<div class="xl:container mx-auto px-3.5 md:px-8 py-8 h-56 sm:h-72 md:max-h-72 items-center flex">
|
|
25
|
+
<header class="relative z-10 text-white">
|
|
26
|
+
<h1
|
|
27
|
+
class="font-headlight text-3xl sm:text-4xl md:text-5xl xl:text-6xl mt-1 line-clamp-3 leading-tight"
|
|
28
|
+
set:html={title}
|
|
29
|
+
/>
|
|
30
|
+
{
|
|
31
|
+
description && (
|
|
32
|
+
<div
|
|
33
|
+
class="mb-1 line-clamp-3 text-base sm:text-lg leading-none mt-4"
|
|
34
|
+
set:html={description}
|
|
35
|
+
/>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
{
|
|
39
|
+
info && (
|
|
40
|
+
<div class="font-medium mb-4 line-clamp-1 text-base sm:text-lg mt-2" set:html={info} />
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
</header>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|