@lightspeed/crane 1.1.1 → 1.1.3
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/app.d.mts +76 -8
- package/dist/app.d.ts +76 -8
- package/dist/app.mjs +1 -1
- package/dist/cli.mjs +10 -23
- package/package.json +6 -5
- package/template/footers/example-footer/ExampleFooter.vue +12 -2
- package/template/footers/example-footer/assets/cart.svg +19 -0
- package/template/footers/example-footer/component/LegalLinks.vue +20 -0
- package/template/footers/example-footer/component/MadeWith.vue +23 -0
- package/template/footers/example-footer/component/ReportAbuse.vue +4 -3
- package/template/footers/example-footer/showcases/1.ts +1 -1
- package/template/headers/example-header/ExampleHeader.vue +38 -4
- package/template/headers/example-header/assets/account_icon.svg +11 -0
- package/template/headers/example-header/assets/lightspeed_logo.png +0 -0
- package/template/headers/example-header/component/Account.vue +20 -0
- package/template/headers/example-header/component/Cart.vue +14 -33
- package/template/headers/example-header/component/Logo.vue +95 -0
- package/template/headers/example-header/component/NavigationMenu.vue +53 -0
- package/template/headers/example-header/settings/translations.ts +6 -2
- package/template/headers/example-header/showcases/1.ts +32 -3
- package/template/headers/example-header/showcases/2.ts +42 -0
- package/template/headers/example-header/showcases/translations.ts +14 -2
- package/template/package.json +1 -1
- package/template/reference/sections/about-us/AboutUs.vue +73 -0
- package/template/reference/sections/about-us/assets/our_company_in_numbers.jpg +0 -0
- package/template/reference/sections/about-us/assets/our_company_in_numbers_preview.jpg +0 -0
- package/template/reference/sections/about-us/assets/our_team.jpg +0 -0
- package/template/reference/sections/about-us/assets/our_team_preview.jpg +0 -0
- package/template/reference/sections/about-us/client.ts +6 -0
- package/template/reference/sections/about-us/component/Image.vue +94 -0
- package/template/reference/sections/about-us/component/Stats.vue +155 -0
- package/template/reference/sections/about-us/component/Title.vue +32 -0
- package/template/reference/sections/about-us/server.ts +6 -0
- package/template/reference/sections/about-us/settings/content.ts +64 -0
- package/template/reference/sections/about-us/settings/design.ts +74 -0
- package/template/reference/sections/about-us/settings/layout.ts +12 -0
- package/template/reference/sections/about-us/settings/translations.ts +151 -0
- package/template/reference/sections/about-us/showcases/1.ts +176 -0
- package/template/reference/sections/about-us/showcases/2.ts +160 -0
- package/template/reference/sections/about-us/showcases/translations.ts +259 -0
- package/template/reference/sections/about-us/type.ts +5 -0
- package/template/reference/sections/about-us/util/visibility-provider.ts +27 -0
- package/template/reference/sections/intro-slider/IntroSlider.vue +77 -0
- package/template/reference/sections/intro-slider/assets/bike_1.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_1@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_2.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_2@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_3.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_3@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_4.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_4@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_5.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_5@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_6.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/bike_6@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_1.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_1@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_2.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_2@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_3.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_3@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_5.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_5@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_6.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/category_6@2x.jpg +0 -0
- package/template/reference/sections/intro-slider/assets/custom_section_showcase_1_preview.png +0 -0
- package/template/reference/sections/intro-slider/assets/custom_section_showcase_2_preview.png +0 -0
- package/template/reference/sections/intro-slider/client.ts +5 -0
- package/template/reference/sections/intro-slider/component/Slider.vue +235 -0
- package/template/reference/sections/intro-slider/component/Title.vue +106 -0
- package/template/reference/sections/intro-slider/entity/color.ts +4 -0
- package/template/reference/sections/intro-slider/server.ts +5 -0
- package/template/reference/sections/intro-slider/settings/content.ts +43 -0
- package/template/reference/sections/intro-slider/settings/design.ts +88 -0
- package/template/reference/sections/intro-slider/settings/layout.ts +12 -0
- package/template/reference/sections/intro-slider/settings/translations.ts +53 -0
- package/template/reference/sections/intro-slider/showcases/1.ts +274 -0
- package/template/reference/sections/intro-slider/showcases/2.ts +270 -0
- package/template/reference/sections/intro-slider/showcases/translations.ts +88 -0
- package/template/reference/sections/intro-slider/type.ts +5 -0
- package/template/reference/sections/tag-lines/TagLines.vue +158 -0
- package/template/reference/sections/tag-lines/assets/explore_our_holiday_gift_guide.jpg +0 -0
- package/template/reference/sections/tag-lines/assets/fall_is_here.jpg +0 -0
- package/template/reference/sections/tag-lines/assets/fall_is_here_preview.jpg +0 -0
- package/template/reference/sections/tag-lines/assets/folding_bikes.jpg +0 -0
- package/template/reference/sections/tag-lines/assets/hybrid_bikes.jpg +0 -0
- package/template/reference/sections/tag-lines/assets/mountain_and_road_bikes.jpg +0 -0
- package/template/reference/sections/tag-lines/assets/shop_chelsea_boots.jpg +0 -0
- package/template/reference/sections/tag-lines/assets/sweater_weather.jpg +0 -0
- package/template/reference/sections/tag-lines/assets/what_we_sell.jpg +0 -0
- package/template/reference/sections/tag-lines/assets/what_we_sell_preview.jpg +0 -0
- package/template/reference/sections/tag-lines/client.ts +5 -0
- package/template/reference/sections/tag-lines/component/HighlightedText.vue +50 -0
- package/template/reference/sections/tag-lines/component/SectionImage.vue +78 -0
- package/template/reference/sections/tag-lines/component/Title.vue +51 -0
- package/template/reference/sections/tag-lines/composables/highlighted-text-image-list.ts +34 -0
- package/template/reference/sections/tag-lines/server.ts +5 -0
- package/template/reference/sections/tag-lines/settings/content.ts +37 -0
- package/template/reference/sections/tag-lines/settings/design.ts +81 -0
- package/template/reference/sections/tag-lines/settings/layout.ts +12 -0
- package/template/reference/sections/tag-lines/settings/translations.ts +61 -0
- package/template/reference/sections/tag-lines/showcases/1.ts +190 -0
- package/template/reference/sections/tag-lines/showcases/2.ts +190 -0
- package/template/reference/sections/tag-lines/showcases/translations.ts +49 -0
- package/template/reference/sections/tag-lines/type.ts +5 -0
- package/template/reference/shared/components/Button.vue +151 -0
- package/template/reference/shared/components/SectionWrapper.vue +26 -0
- package/template/reference/shared/components/Tagline.vue +45 -0
- package/template/reference/shared/utils/color.ts +16 -0
- package/template/reference/shared/utils/styles.ts +12 -0
- package/template/reference/templates/assets/reference_template_apparel_cover_image.jpg +0 -0
- package/template/reference/templates/assets/reference_template_bike_cover_image.jpg +0 -0
- package/template/reference/templates/reference-template-apparel.ts +44 -0
- package/template/reference/templates/reference-template-bike.ts +44 -0
- package/template/sections/example-section/ExampleSection.vue +8 -19
- package/template/sections/example-section/assets/bike_accessories_high.jpg +0 -0
- package/template/sections/example-section/assets/bike_accessories_low.jpg +0 -0
- package/template/sections/example-section/assets/bike_new_arrivals_high.jpg +0 -0
- package/template/sections/example-section/assets/bike_new_arrivals_low.jpg +0 -0
- package/template/sections/example-section/assets/custom_section_showcase_3_preview.jpg +0 -0
- package/template/sections/example-section/assets/fixed_gears_high.jpg +0 -0
- package/template/sections/example-section/assets/fixed_gears_low.jpg +0 -0
- package/template/sections/example-section/assets/repair_service_high.jpg +0 -0
- package/template/sections/example-section/assets/repair_service_low.jpg +0 -0
- package/template/sections/example-section/settings/translations.ts +39 -7
- package/template/sections/example-section/showcases/3.ts +198 -0
- package/template/sections/example-section/showcases/translations.ts +49 -1
- package/template/shared/components/LanguageSelector.vue +75 -0
- package/template/shared/components/SectionWrapper.vue +26 -0
- package/template/templates/template.ts +28 -43
- package/types.d.ts +264 -141
- package/template/headers/example-header/component/SampleComponent.vue +0 -11
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<SectionWrapper
|
|
3
|
+
class="tag-lines-section"
|
|
4
|
+
:style="backgroundStyle"
|
|
5
|
+
>
|
|
6
|
+
<div class="tag-lines-section__wrapper">
|
|
7
|
+
<div class="tag-lines-section__info">
|
|
8
|
+
<Tagline
|
|
9
|
+
v-if="isTaglineVisible"
|
|
10
|
+
class="tag-lines-section__tagline"
|
|
11
|
+
:design="taglineDesign"
|
|
12
|
+
>
|
|
13
|
+
{{ taglineContent.value }}
|
|
14
|
+
</Tagline>
|
|
15
|
+
|
|
16
|
+
<Title
|
|
17
|
+
v-if="isTitleVisible"
|
|
18
|
+
class="tag-lines-section__title"
|
|
19
|
+
/>
|
|
20
|
+
|
|
21
|
+
<div class="tag-lines-section__highlighted-texts">
|
|
22
|
+
<template
|
|
23
|
+
v-for="(element, index) in highlightedTextElements"
|
|
24
|
+
>
|
|
25
|
+
<HighlightedText
|
|
26
|
+
v-if="element.design.visible"
|
|
27
|
+
:key="`${element.text?.value}__${index}`"
|
|
28
|
+
:class="[
|
|
29
|
+
'tag-lines-section__highlighted-text',
|
|
30
|
+
`tag-lines-section__highlighted-text--${index + 1}`,
|
|
31
|
+
]"
|
|
32
|
+
:design="element.design"
|
|
33
|
+
>
|
|
34
|
+
{{ element.text?.value }}
|
|
35
|
+
</HighlightedText>
|
|
36
|
+
</template>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<SectionImage
|
|
41
|
+
class="tag-lines-section__image"
|
|
42
|
+
:highlights="highlightedTextElements"
|
|
43
|
+
:section-image="sectionImageContent"
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
</SectionWrapper>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script setup lang="ts">
|
|
50
|
+
import {
|
|
51
|
+
useBackgroundElementDesign,
|
|
52
|
+
useImageElementContent,
|
|
53
|
+
useTextElementDesign,
|
|
54
|
+
useInputboxElementContent,
|
|
55
|
+
} from '@lightspeed/crane';
|
|
56
|
+
import { computed } from 'vue';
|
|
57
|
+
import { Content, Design } from './type.ts';
|
|
58
|
+
import Tagline from '../../shared/components/Tagline.vue';
|
|
59
|
+
import Title from './component/Title.vue';
|
|
60
|
+
import SectionImage from './component/SectionImage.vue';
|
|
61
|
+
import HighlightedText from './component/HighlightedText.vue';
|
|
62
|
+
import { useHighlightedTextElementList } from './composables/highlighted-text-image-list.ts';
|
|
63
|
+
import SectionWrapper from '../../shared/components/SectionWrapper.vue';
|
|
64
|
+
|
|
65
|
+
const backgroundDesign = useBackgroundElementDesign<Design>('background');
|
|
66
|
+
const background = computed(() => ({
|
|
67
|
+
type: backgroundDesign.background?.type,
|
|
68
|
+
solidColor: backgroundDesign.background?.solid?.color as Color,
|
|
69
|
+
fromColor: backgroundDesign.background?.gradient?.fromColor as Color,
|
|
70
|
+
toColor: backgroundDesign.background?.gradient?.toColor as Color,
|
|
71
|
+
}));
|
|
72
|
+
|
|
73
|
+
const backgroundStyle = computed(() => {
|
|
74
|
+
if (background.value.type === 'gradient') {
|
|
75
|
+
return { 'background-image': `linear-gradient(to right, ${background.value.fromColor.hex}, ${background.value.toColor.hex})` };
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return { 'background-color': background.value.solidColor.hex };
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const taglineContent = useInputboxElementContent<Content>('section_tagline');
|
|
82
|
+
const taglineDesign = useTextElementDesign<Design>('section_tagline') as TextDesignData;
|
|
83
|
+
const isTaglineVisible = computed<boolean>(() => !!taglineDesign.visible && taglineContent.hasContent);
|
|
84
|
+
|
|
85
|
+
const titleContent = useInputboxElementContent<Content>('section_title');
|
|
86
|
+
const titleDesign = useTextElementDesign<Design>('section_title');
|
|
87
|
+
const isTitleVisible = computed<boolean>(() => !!titleDesign.visible && titleContent.hasContent);
|
|
88
|
+
|
|
89
|
+
const sectionImageContent = useImageElementContent<Content>('section_image');
|
|
90
|
+
|
|
91
|
+
const {
|
|
92
|
+
highlightedTextElements,
|
|
93
|
+
} = useHighlightedTextElementList();
|
|
94
|
+
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<style lang="scss" scoped>
|
|
98
|
+
.tag-lines-section {
|
|
99
|
+
&__wrapper {
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
align-items: center;
|
|
103
|
+
gap: 24px;
|
|
104
|
+
|
|
105
|
+
@media screen and (min-width: 900px) {
|
|
106
|
+
flex-direction: row;
|
|
107
|
+
justify-content: space-between;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&__info {
|
|
112
|
+
width: 100%;
|
|
113
|
+
|
|
114
|
+
@media screen and (min-width: 900px) {
|
|
115
|
+
width: unset;
|
|
116
|
+
max-width: 530px;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&__tagline {
|
|
121
|
+
margin-bottom: 24px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&__image {
|
|
125
|
+
width: 100%;
|
|
126
|
+
|
|
127
|
+
@media screen and (min-width: 900px) {
|
|
128
|
+
max-width: 479px;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&::v-deep(.tag-lines-section__highlighted-texts:has(.tag-lines-section__highlighted-text:hover)) {
|
|
133
|
+
& .tag-lines-section__highlighted-text {
|
|
134
|
+
opacity: 0.2;
|
|
135
|
+
|
|
136
|
+
&:hover {
|
|
137
|
+
opacity: 1;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&__highlighted-text {
|
|
143
|
+
transition: opacity ease-in-out 0.3s;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&:has(.tag-lines-section__highlighted-text:hover) {
|
|
147
|
+
&::v-deep(.section-image__element) {
|
|
148
|
+
opacity: 0;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&:has(.tag-lines-section__highlighted-text--1:hover)::v-deep(.section-image__element--1),
|
|
153
|
+
&:has(.tag-lines-section__highlighted-text--2:hover)::v-deep(.section-image__element--2),
|
|
154
|
+
&:has(.tag-lines-section__highlighted-text--3:hover)::v-deep(.section-image__element--3) {
|
|
155
|
+
opacity: 1;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
</style>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="highlighted-text">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { computed, CSSProperties } from 'vue';
|
|
9
|
+
|
|
10
|
+
const props = defineProps<{
|
|
11
|
+
design: TextDesignData
|
|
12
|
+
}>();
|
|
13
|
+
|
|
14
|
+
const textStyle = computed<CSSProperties>(() => ({
|
|
15
|
+
fontSize: props.design.size ? `${props.design.size}px` : undefined,
|
|
16
|
+
fontFamily: props.design.font,
|
|
17
|
+
color: props.design.color ? (props.design.color as Color).hex : undefined,
|
|
18
|
+
fontStyle: props.design.italic ? 'italic' : 'normal',
|
|
19
|
+
fontWeight: props.design.bold ? 'bold' : 'normal',
|
|
20
|
+
}));
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<style lang="scss" scoped>
|
|
24
|
+
.highlighted-text {
|
|
25
|
+
--font-size: v-bind(textStyle.fontSize);
|
|
26
|
+
--font-family: v-bind(textStyle.fontFamily);
|
|
27
|
+
--color: v-bind(textStyle.color);
|
|
28
|
+
--font-style: v-bind(textStyle.fontStyle);
|
|
29
|
+
--font-weight: v-bind(textStyle.fontWeight);
|
|
30
|
+
|
|
31
|
+
--font-size-multiplier: calc(2/3);
|
|
32
|
+
|
|
33
|
+
font-size: calc(var(--font-size) * var(--font-size-multiplier));
|
|
34
|
+
font-family: var(--font-family);
|
|
35
|
+
color: var(--color);
|
|
36
|
+
font-style: var(--font-style);
|
|
37
|
+
font-weight: var(--font-weight);
|
|
38
|
+
line-height: 1.5;
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
text-decoration: underline;
|
|
41
|
+
|
|
42
|
+
@media screen and (min-width: 700px) {
|
|
43
|
+
--font-size-multiplier: 0.75;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@media screen and (min-width: 1200px) {
|
|
47
|
+
--font-size-multiplier: 1;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="imageClass">
|
|
3
|
+
<img
|
|
4
|
+
v-if="sectionImage?.hasContent"
|
|
5
|
+
class="section-image__element"
|
|
6
|
+
:src="sectionImage.highResolutionDesktopImage"
|
|
7
|
+
loading="lazy"
|
|
8
|
+
alt=""
|
|
9
|
+
/>
|
|
10
|
+
|
|
11
|
+
<template v-for="(element, index) in highlights" :key="`${element.text?.value}__${index}`">
|
|
12
|
+
<img
|
|
13
|
+
v-if="element.design.visible"
|
|
14
|
+
:class="[
|
|
15
|
+
'section-image__element',
|
|
16
|
+
'section-image__element--highlighted',
|
|
17
|
+
`section-image__element--${index + 1}`,
|
|
18
|
+
]"
|
|
19
|
+
:src="element.image?.highResolutionDesktopImage"
|
|
20
|
+
loading="lazy"
|
|
21
|
+
alt=""
|
|
22
|
+
/>
|
|
23
|
+
</template>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script setup lang="ts">
|
|
28
|
+
import {
|
|
29
|
+
ImageContent,
|
|
30
|
+
useLayoutElementDesign,
|
|
31
|
+
} from '@lightspeed/crane';
|
|
32
|
+
import { computed } from 'vue';
|
|
33
|
+
import { Highlight } from '../composables/highlighted-text-image-list.ts';
|
|
34
|
+
|
|
35
|
+
defineProps<{
|
|
36
|
+
sectionImage: ImageContent;
|
|
37
|
+
highlights: Highlight[];
|
|
38
|
+
}>();
|
|
39
|
+
|
|
40
|
+
const layoutDesign = useLayoutElementDesign();
|
|
41
|
+
|
|
42
|
+
const imageClass = computed(() => [
|
|
43
|
+
'section-image',
|
|
44
|
+
{
|
|
45
|
+
'section-image--with-border-radius': layoutDesign.layout === 'Image_With_Border_Radius',
|
|
46
|
+
},
|
|
47
|
+
]);
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<style lang="scss" scoped>
|
|
51
|
+
.section-image {
|
|
52
|
+
position: relative;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
aspect-ratio: 0.785;
|
|
55
|
+
|
|
56
|
+
&--with-border-radius {
|
|
57
|
+
border-radius: 24px;
|
|
58
|
+
|
|
59
|
+
@media screen and (min-width: 1200px) {
|
|
60
|
+
border-radius: 32px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&__element {
|
|
65
|
+
position: absolute;
|
|
66
|
+
top: 0;
|
|
67
|
+
left: 0;
|
|
68
|
+
width: 100%;
|
|
69
|
+
height: 100%;
|
|
70
|
+
object-fit: cover;
|
|
71
|
+
transition: opacity 0.3s ease-in-out;
|
|
72
|
+
|
|
73
|
+
&--highlighted {
|
|
74
|
+
opacity: 0;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<h1 class="title">
|
|
3
|
+
{{ titleContent.value }}
|
|
4
|
+
</h1>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { computed, CSSProperties } from 'vue';
|
|
9
|
+
import {
|
|
10
|
+
useInputboxElementContent,
|
|
11
|
+
useTextElementDesign,
|
|
12
|
+
} from '@lightspeed/crane';
|
|
13
|
+
import { Content, Design } from '../type.ts';
|
|
14
|
+
|
|
15
|
+
const titleContent = useInputboxElementContent<Content>('section_title');
|
|
16
|
+
const titleDesign = useTextElementDesign<Design>('section_title');
|
|
17
|
+
|
|
18
|
+
const titleStyle = computed<CSSProperties>(() => ({
|
|
19
|
+
fontSize: `${titleDesign.size}px`,
|
|
20
|
+
fontFamily: titleDesign.font,
|
|
21
|
+
color: (titleDesign.color as Color).hex,
|
|
22
|
+
fontStyle: titleDesign.italic ? 'italic' : 'normal',
|
|
23
|
+
fontWeigh: titleDesign.bold ? 'bold' : 'normal',
|
|
24
|
+
}));
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<style lang="scss" scoped>
|
|
28
|
+
.title {
|
|
29
|
+
--font-size: v-bind(titleStyle.fontSize);
|
|
30
|
+
--font-family: v-bind(titleStyle.fontFamily);
|
|
31
|
+
--color: v-bind(titleStyle.color);
|
|
32
|
+
--font-style: v-bind(titleStyle.fontStyle);
|
|
33
|
+
--font-weight: v-bind(titleStyle.fontWeigh);
|
|
34
|
+
|
|
35
|
+
--font-size-multiplier: calc(2/3);
|
|
36
|
+
|
|
37
|
+
font-size: calc(var(--font-size) * var(--font-size-multiplier));
|
|
38
|
+
font-family: var(--font-family);
|
|
39
|
+
color: var(--color);
|
|
40
|
+
font-style: var(--font-style);
|
|
41
|
+
font-weight: var(--font-weight);
|
|
42
|
+
|
|
43
|
+
@media screen and (min-width: 700px) {
|
|
44
|
+
--font-size-multiplier: 0.75;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@media screen and (min-width: 1200px) {
|
|
48
|
+
--font-size-multiplier: 1;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
import {
|
|
3
|
+
EditorTypes,
|
|
4
|
+
ImageContent,
|
|
5
|
+
TextAreaContent,
|
|
6
|
+
useDeckElementContent,
|
|
7
|
+
useTextElementDesign,
|
|
8
|
+
} from '@lightspeed/crane';
|
|
9
|
+
import { Content, Design } from '../type.ts';
|
|
10
|
+
|
|
11
|
+
export type Highlight = {
|
|
12
|
+
text?: TextAreaContent;
|
|
13
|
+
image?: ImageContent;
|
|
14
|
+
design: TextDesignData;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function useHighlightedTextElementList() {
|
|
18
|
+
const design = computed<TextDesignData[]>(() => [
|
|
19
|
+
useTextElementDesign<Design>('highlighted_text_1') as TextDesignData,
|
|
20
|
+
useTextElementDesign<Design>('highlighted_text_2') as TextDesignData,
|
|
21
|
+
useTextElementDesign<Design>('highlighted_text_3') as TextDesignData,
|
|
22
|
+
]);
|
|
23
|
+
const content = useDeckElementContent<Content>('highlighted_text');
|
|
24
|
+
|
|
25
|
+
const highlightedTextElements = computed<Highlight[]>(() => content.cards?.map((card, index) => ({
|
|
26
|
+
text: content.getReactiveRef(card, EditorTypes.INPUTBOX, 'text') as unknown as TextAreaContent | undefined,
|
|
27
|
+
image: content.getReactiveRef(card, EditorTypes.IMAGE, 'image_content') as ImageContent,
|
|
28
|
+
design: design.value[index],
|
|
29
|
+
})) ?? []);
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
highlightedTextElements,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
section_tagline: {
|
|
3
|
+
type: 'INPUTBOX',
|
|
4
|
+
label: '$label.content.tagline.label',
|
|
5
|
+
placeholder: '$label.content.tagline.placeholder',
|
|
6
|
+
},
|
|
7
|
+
section_title: {
|
|
8
|
+
type: 'INPUTBOX',
|
|
9
|
+
label: '$label.content.section_title.label',
|
|
10
|
+
placeholder: '$label.content.section_title.placeholder',
|
|
11
|
+
},
|
|
12
|
+
highlighted_text: {
|
|
13
|
+
type: 'DECK',
|
|
14
|
+
label: '$label.content.highlighted_text_title.label',
|
|
15
|
+
addButtonLabel: '$label.content.deck.highlighted_text.add_button',
|
|
16
|
+
maxCards: 3,
|
|
17
|
+
cards: {
|
|
18
|
+
defaultCardContent: {
|
|
19
|
+
label: '$label.content.highlighted_text.label',
|
|
20
|
+
settings: {
|
|
21
|
+
text: {
|
|
22
|
+
type: 'INPUTBOX',
|
|
23
|
+
label: '$label.content.deck.highlighted_text.label',
|
|
24
|
+
},
|
|
25
|
+
image_content: {
|
|
26
|
+
type: 'IMAGE',
|
|
27
|
+
label: '$label.content.deck.highlighted_text_image_on_hover.label',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
section_image: {
|
|
34
|
+
type: 'IMAGE',
|
|
35
|
+
label: '$label.content.image_title.label',
|
|
36
|
+
},
|
|
37
|
+
} as const;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
background: {
|
|
3
|
+
type: 'BACKGROUND',
|
|
4
|
+
label: '$label.design.background.label',
|
|
5
|
+
colors: ['#FFFFFF', '#000000', '#F4EFE3', '#FFBF24', '#6281C5', '#C5629A', '#BAA33E', '#8A91D0', '#C3455C'],
|
|
6
|
+
defaults: {
|
|
7
|
+
style: 'COLOR',
|
|
8
|
+
color: '#FFFFFF',
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
section_tagline: {
|
|
12
|
+
type: 'TEXT',
|
|
13
|
+
label: '$label.design.tagline.label',
|
|
14
|
+
colors: ['#FFFFFF', '#000000', '#F4EFE3', '#FFBF24', '#6281C5', '#C5629A', '#BAA33E', '#8A91D0', '#C3455C'],
|
|
15
|
+
sizes: [12, 13, 14, 15, 16, 17, 18, 20],
|
|
16
|
+
defaults: {
|
|
17
|
+
font: 'noto_serif',
|
|
18
|
+
size: 16,
|
|
19
|
+
bold: true,
|
|
20
|
+
italic: false,
|
|
21
|
+
color: '#F4EFE3',
|
|
22
|
+
visible: true,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
section_title: {
|
|
26
|
+
type: 'TEXT',
|
|
27
|
+
label: '$label.design.section_title.label',
|
|
28
|
+
colors: ['#FFFFFF', '#000000', '#F4EFE3', '#FFBF24', '#6281C5', '#C5629A', '#BAA33E', '#8A91D0', '#C3455C'],
|
|
29
|
+
sizes: [18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60],
|
|
30
|
+
defaults: {
|
|
31
|
+
font: 'noto_serif',
|
|
32
|
+
size: 48,
|
|
33
|
+
bold: true,
|
|
34
|
+
italic: false,
|
|
35
|
+
color: '#000000',
|
|
36
|
+
visible: true,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
highlighted_text_1: {
|
|
40
|
+
type: 'TEXT',
|
|
41
|
+
label: '$label.design.highlighted_text_1.label',
|
|
42
|
+
colors: ['#FFFFFF', '#000000', '#F4EFE3', '#FFBF24', '#6281C5', '#C5629A', '#BAA33E', '#8A91D0', '#C3455C'],
|
|
43
|
+
sizes: [18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60],
|
|
44
|
+
defaults: {
|
|
45
|
+
font: 'noto_serif',
|
|
46
|
+
size: 48,
|
|
47
|
+
bold: true,
|
|
48
|
+
italic: false,
|
|
49
|
+
color: '#FFBF24',
|
|
50
|
+
visible: true,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
highlighted_text_2: {
|
|
54
|
+
type: 'TEXT',
|
|
55
|
+
label: '$label.design.highlighted_text_2.label',
|
|
56
|
+
colors: ['#FFFFFF', '#000000', '#F4EFE3', '#FFBF24', '#6281C5', '#C5629A', '#BAA33E', '#8A91D0', '#C3455C'],
|
|
57
|
+
sizes: [18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60],
|
|
58
|
+
defaults: {
|
|
59
|
+
font: 'noto_serif',
|
|
60
|
+
size: 48,
|
|
61
|
+
bold: true,
|
|
62
|
+
italic: false,
|
|
63
|
+
color: '#6281C5',
|
|
64
|
+
visible: true,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
highlighted_text_3: {
|
|
68
|
+
type: 'TEXT',
|
|
69
|
+
label: '$label.design.highlighted_text_3.label',
|
|
70
|
+
colors: ['#FFFFFF', '#000000', '#F4EFE3', '#FFBF24', '#6281C5', '#C5629A', '#BAA33E', '#8A91D0', '#C3455C'],
|
|
71
|
+
sizes: [18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60],
|
|
72
|
+
defaults: {
|
|
73
|
+
font: 'noto_serif',
|
|
74
|
+
size: 48,
|
|
75
|
+
bold: true,
|
|
76
|
+
italic: false,
|
|
77
|
+
color: '#C5629A',
|
|
78
|
+
visible: true,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
} as const;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
en: {
|
|
3
|
+
'$label.content.tagline.label': 'Tagline',
|
|
4
|
+
'$label.content.section_title.label': 'Title',
|
|
5
|
+
'$label.content.highlighted_text_title.label': 'Highlighted text',
|
|
6
|
+
'$label.content.image_title.label': 'Section Image',
|
|
7
|
+
'$label.content.highlighted_text.label': 'Highlighted text',
|
|
8
|
+
'$label.content.deck.highlighted_text.title': 'Highlighted text',
|
|
9
|
+
'$label.content.deck.highlighted_text.label': 'Text',
|
|
10
|
+
'$label.content.deck.highlighted_text_image_on_hover.label': 'Image on hover',
|
|
11
|
+
'$label.content.deck.highlighted_text.add_button': 'Add new highlighted text',
|
|
12
|
+
|
|
13
|
+
'$label.design.background.label': 'Background color',
|
|
14
|
+
'$label.design.background.placeholder': 'Background color',
|
|
15
|
+
'$label.design.tagline.label': 'Tagline',
|
|
16
|
+
'$label.design.section_title.label': 'Title',
|
|
17
|
+
'$label.design.highlighted_text_1.label': 'Highlighted text 1',
|
|
18
|
+
'$label.design.highlighted_text_2.label': 'Highlighted text 2',
|
|
19
|
+
'$label.design.highlighted_text_3.label': 'Highlighted text 3',
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
nl: {
|
|
23
|
+
'$label.content.tagline.label': 'Slogan',
|
|
24
|
+
'$label.content.section_title.label': 'Titel',
|
|
25
|
+
'$label.content.highlighted_text_title.label': 'Gemarkeerde tekst',
|
|
26
|
+
'$label.content.image_title.label': 'Sectie afbeelding',
|
|
27
|
+
'$label.content.highlighted_text.label': 'Gemarkeerde tekst',
|
|
28
|
+
'$label.content.deck.highlighted_text.title': 'Gemarkeerde tekst',
|
|
29
|
+
'$label.content.deck.highlighted_text.label': 'Tekst',
|
|
30
|
+
'$label.content.deck.highlighted_text_image_on_hover.label': 'Afbeelding bij hover',
|
|
31
|
+
'$label.content.deck.highlighted_text.add_button': 'Nieuwe gemarkeerde tekst toevoegen',
|
|
32
|
+
|
|
33
|
+
'$label.design.background.label': 'Achtergrondkleur',
|
|
34
|
+
'$label.design.background.placeholder': 'Achtergrondkleur',
|
|
35
|
+
'$label.design.tagline.label': 'Slogan',
|
|
36
|
+
'$label.design.section_title.label': 'Titel',
|
|
37
|
+
'$label.design.highlighted_text_1.label': 'Gemarkeerde tekst 1',
|
|
38
|
+
'$label.design.highlighted_text_2.label': 'Gemarkeerde tekst 2',
|
|
39
|
+
'$label.design.highlighted_text_3.label': 'Gemarkeerde tekst 3',
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
fr: {
|
|
43
|
+
'$label.content.tagline.label': 'Slogan',
|
|
44
|
+
'$label.content.section_title.label': 'Titre',
|
|
45
|
+
'$label.content.highlighted_text_title.label': 'Texte en surbrillance',
|
|
46
|
+
'$label.content.image_title.label': 'Image de la section',
|
|
47
|
+
'$label.content.highlighted_text.label': 'Texte en surbrillance',
|
|
48
|
+
'$label.content.deck.highlighted_text.title': 'Texte en surbrillance',
|
|
49
|
+
'$label.content.deck.highlighted_text.label': 'Texte',
|
|
50
|
+
'$label.content.deck.highlighted_text_image_on_hover.label': 'Image au survol',
|
|
51
|
+
'$label.content.deck.highlighted_text.add_button': 'Ajouter un nouveau texte en surbrillance',
|
|
52
|
+
|
|
53
|
+
'$label.design.background.label': 'Couleur de fond',
|
|
54
|
+
'$label.design.background.placeholder': 'Couleur de fond',
|
|
55
|
+
'$label.design.tagline.label': 'Slogan',
|
|
56
|
+
'$label.design.section_title.label': 'Titre',
|
|
57
|
+
'$label.design.highlighted_text_1.label': 'Texte en surbrillance 1',
|
|
58
|
+
'$label.design.highlighted_text_2.label': 'Texte en surbrillance 2',
|
|
59
|
+
'$label.design.highlighted_text_3.label': 'Texte en surbrillance 3',
|
|
60
|
+
},
|
|
61
|
+
} as const;
|