@lightspeed/crane 1.1.2 → 1.2.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/bin/crane.js +0 -1
- package/dist/app.d.mts +20 -2
- package/dist/app.d.ts +20 -2
- package/dist/app.mjs +1 -1
- package/dist/cli.mjs +10 -23
- package/package.json +10 -5
- package/template/footers/example-footer/ExampleFooter.vue +6 -1
- package/template/footers/example-footer/assets/cart.svg +19 -0
- package/template/footers/example-footer/component/LegalLinks.vue +2 -2
- 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 +17 -2
- package/template/headers/example-header/component/Account.vue +4 -4
- package/template/headers/example-header/component/Cart.vue +14 -33
- package/template/headers/example-header/settings/content.ts +1 -9
- package/template/headers/example-header/settings/design.ts +1 -23
- 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 +155 -0
- package/template/reference/sections/about-us/showcases/2.ts +143 -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 +275 -0
- package/template/reference/sections/intro-slider/showcases/2.ts +271 -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 +21 -24
- package/template/sections/example-section/assets/arrow.svg +3 -0
- 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/component/button/Button.vue +87 -0
- package/template/sections/example-section/component/selectbox/Selectbox.vue +45 -0
- package/template/sections/example-section/component/toggle/Toggle.vue +110 -0
- package/template/sections/example-section/settings/content.ts +45 -0
- package/template/sections/example-section/settings/translations.ts +87 -7
- package/template/sections/example-section/showcases/1.ts +43 -0
- package/template/sections/example-section/showcases/2.ts +43 -0
- package/template/sections/example-section/showcases/3.ts +241 -0
- package/template/sections/example-section/showcases/translations.ts +205 -1
- package/template/shared/{LanguageSelector.vue → components/LanguageSelector.vue} +5 -5
- package/template/shared/components/SectionWrapper.vue +26 -0
- package/template/shared/utils.ts +28 -0
- package/template/templates/template.ts +2 -1
- package/types.d.ts +96 -70
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
en: {
|
|
3
|
+
'$label.showcase_1.blockName': 'Reference Section – Tag lines',
|
|
4
|
+
'$label.showcase_1.section_tagline.text': 'Seasonal',
|
|
5
|
+
'$label.showcase_1.section_title.text': 'Fall is here:',
|
|
6
|
+
'$label.showcase_1.highlighted_text_1.text': 'sweater weather',
|
|
7
|
+
'$label.showcase_1.highlighted_text_2.text': 'shop chelsea boots',
|
|
8
|
+
'$label.showcase_1.highlighted_text_3.text': 'explore our holiday gift guide',
|
|
9
|
+
|
|
10
|
+
'$label.showcase_2.blockName': 'Reference Section – Tag lines',
|
|
11
|
+
'$label.showcase_2.section_tagline.text': 'Our bikes',
|
|
12
|
+
'$label.showcase_2.section_title.text': 'What we sell:',
|
|
13
|
+
'$label.showcase_2.highlighted_text_1.text': 'mountain and road bikes',
|
|
14
|
+
'$label.showcase_2.highlighted_text_2.text': 'hybrid bikes',
|
|
15
|
+
'$label.showcase_2.highlighted_text_3.text': 'folding bikes',
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
nl: {
|
|
19
|
+
'$label.showcase_1.blockName': 'Referentie Sectie – Taglines',
|
|
20
|
+
'$label.showcase_1.section_tagline.text': 'Seizoensgebonden',
|
|
21
|
+
'$label.showcase_1.section_title.text': 'De herfst is hier:',
|
|
22
|
+
'$label.showcase_1.highlighted_text_1.text': 'trui weer',
|
|
23
|
+
'$label.showcase_1.highlighted_text_2.text': 'shop chelsea boots',
|
|
24
|
+
'$label.showcase_1.highlighted_text_3.text': 'ontdek onze vakantiecadeaugids',
|
|
25
|
+
|
|
26
|
+
'$label.showcase_2.blockName': 'Referentie Sectie – Taglines',
|
|
27
|
+
'$label.showcase_2.section_tagline.text': 'Onze fietsen',
|
|
28
|
+
'$label.showcase_2.section_title.text': 'Wat we verkopen:',
|
|
29
|
+
'$label.showcase_2.highlighted_text_1.text': 'mountain- en racefietsen',
|
|
30
|
+
'$label.showcase_2.highlighted_text_2.text': 'hybride fietsen',
|
|
31
|
+
'$label.showcase_2.highlighted_text_3.text': 'vouwfietsen',
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
fr: {
|
|
35
|
+
'$label.showcase_1.blockName': 'Section de référence – Slogans',
|
|
36
|
+
'$label.showcase_1.section_tagline.text': 'Saisonnier',
|
|
37
|
+
'$label.showcase_1.section_title.text': 'L\'automne est là:',
|
|
38
|
+
'$label.showcase_1.highlighted_text_1.text': 'temps des pulls',
|
|
39
|
+
'$label.showcase_1.highlighted_text_2.text': 'achetez des bottes chelsea',
|
|
40
|
+
'$label.showcase_1.highlighted_text_3.text': 'découvrez notre guide des cadeaux de vacances',
|
|
41
|
+
|
|
42
|
+
'$label.showcase_2.blockName': 'Section de référence – Slogans',
|
|
43
|
+
'$label.showcase_2.section_tagline.text': 'Nos vélos',
|
|
44
|
+
'$label.showcase_2.section_title.text': 'Ce que nous vendons:',
|
|
45
|
+
'$label.showcase_2.highlighted_text_1.text': 'vélos de montagne et de route',
|
|
46
|
+
'$label.showcase_2.highlighted_text_2.text': 'vélos hybrides',
|
|
47
|
+
'$label.showcase_2.highlighted_text_3.text': 'vélos pliants',
|
|
48
|
+
},
|
|
49
|
+
} as const;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
type="button"
|
|
4
|
+
:class="buttonClass"
|
|
5
|
+
@click="content.performAction"
|
|
6
|
+
>
|
|
7
|
+
{{ content.title }}
|
|
8
|
+
<div
|
|
9
|
+
v-if="isLink"
|
|
10
|
+
class="button__icon"
|
|
11
|
+
>
|
|
12
|
+
<svg
|
|
13
|
+
width="14"
|
|
14
|
+
height="11"
|
|
15
|
+
viewBox="0 0 14 11"
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
+
>
|
|
18
|
+
<g
|
|
19
|
+
stroke="currentColor"
|
|
20
|
+
stroke-linecap="round"
|
|
21
|
+
fill="none"
|
|
22
|
+
fill-rule="evenodd"
|
|
23
|
+
>
|
|
24
|
+
<path d="M9.5.5l4 5-4 5" stroke-linejoin="round" />
|
|
25
|
+
<path d="M13.5 5.5H.5" />
|
|
26
|
+
</g>
|
|
27
|
+
</svg>
|
|
28
|
+
</div>
|
|
29
|
+
</button>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script setup lang="ts">
|
|
33
|
+
import { computed, CSSProperties } from 'vue';
|
|
34
|
+
import { ButtonContent } from '@lightspeed/crane';
|
|
35
|
+
|
|
36
|
+
import { calculateFontColor } from '../utils/color.ts';
|
|
37
|
+
|
|
38
|
+
const props = defineProps<{
|
|
39
|
+
content: ButtonContent;
|
|
40
|
+
design: ButtonDesignData;
|
|
41
|
+
}>();
|
|
42
|
+
|
|
43
|
+
const color = computed<Color>(() => props.design.color as Color);
|
|
44
|
+
const fontColor = computed<string>(() => calculateFontColor(color.value.rgba));
|
|
45
|
+
|
|
46
|
+
const isLink = computed<boolean>(() => props.design.appearance === 'text-link');
|
|
47
|
+
|
|
48
|
+
const buttonClass = computed(() => ([
|
|
49
|
+
'button',
|
|
50
|
+
{
|
|
51
|
+
small: props.design.size === 'small',
|
|
52
|
+
medium: props.design.size === 'medium',
|
|
53
|
+
large: props.design.size === 'large',
|
|
54
|
+
outline: props.design.appearance === 'outline-button',
|
|
55
|
+
solid: props.design.appearance === 'solid-button',
|
|
56
|
+
link: isLink.value,
|
|
57
|
+
pill: props.design.style === 'pill',
|
|
58
|
+
rectangle: props.design.style === 'rectangle',
|
|
59
|
+
round: props.design.style === 'round-corner',
|
|
60
|
+
},
|
|
61
|
+
]));
|
|
62
|
+
|
|
63
|
+
const buttonStyles = computed<CSSProperties>(() => {
|
|
64
|
+
const style: CSSProperties = {
|
|
65
|
+
fontFamily: props.design.font,
|
|
66
|
+
color: fontColor.value,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
if (props.design.appearance === 'solid-button') {
|
|
70
|
+
style.backgroundColor = color.value.raw;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (props.design.appearance !== 'solid-button') {
|
|
74
|
+
style.color = color.value.raw;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return style;
|
|
78
|
+
});
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<style scoped lang="scss">
|
|
82
|
+
.button {
|
|
83
|
+
--font-family: v-bind(buttonStyles.fontFamily);
|
|
84
|
+
--background-color: v-bind(buttonStyles.backgroundColor);
|
|
85
|
+
--color: v-bind(buttonStyles.color);
|
|
86
|
+
|
|
87
|
+
padding: 0 24px;
|
|
88
|
+
background-color: var(--background-color);
|
|
89
|
+
font-family: var(--font-family);
|
|
90
|
+
font-weight: 700;
|
|
91
|
+
color: var(--color);
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
text-overflow: ellipsis;
|
|
95
|
+
white-space: pre;
|
|
96
|
+
transition: opacity .2s ease-in-out;
|
|
97
|
+
|
|
98
|
+
&:hover {
|
|
99
|
+
opacity: 0.5;
|
|
100
|
+
|
|
101
|
+
.button__icon {
|
|
102
|
+
transform: translateX(4px);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&__icon {
|
|
107
|
+
margin-left: 5px;
|
|
108
|
+
transition: transform 0.3s ease;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&.pill {
|
|
112
|
+
border-radius: 32px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&.round {
|
|
116
|
+
border-radius: 10px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&.small {
|
|
120
|
+
height: 30px;
|
|
121
|
+
font-size: 12px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&.medium {
|
|
125
|
+
height: 48px;
|
|
126
|
+
font-size: 16px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&.large {
|
|
130
|
+
height: 60px;
|
|
131
|
+
font-size: 16px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&.solid {
|
|
135
|
+
border: none;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&.outline {
|
|
139
|
+
border: 2px solid;
|
|
140
|
+
background: none;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&.link {
|
|
144
|
+
background: none;
|
|
145
|
+
border: none;
|
|
146
|
+
display: flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
padding: 0;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="section">
|
|
3
|
+
<div class="section__wrapper">
|
|
4
|
+
<slot />
|
|
5
|
+
</div>
|
|
6
|
+
</section>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<style lang="scss" scoped>
|
|
10
|
+
.section {
|
|
11
|
+
padding: 60px 20px;
|
|
12
|
+
|
|
13
|
+
@media screen and (min-width: 700px) {
|
|
14
|
+
padding: 75px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@media screen and (min-width: 1200px) {
|
|
18
|
+
padding: 100px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&__wrapper {
|
|
22
|
+
max-width: 1120px;
|
|
23
|
+
margin: 0 auto;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
</style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tagline">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { computed, CSSProperties } from 'vue';
|
|
9
|
+
import { getTextStyles } from '../utils/styles.ts';
|
|
10
|
+
|
|
11
|
+
const props = defineProps<{
|
|
12
|
+
design: TextDesignData;
|
|
13
|
+
}>();
|
|
14
|
+
|
|
15
|
+
const backgroundLightness = computed<string>(() => `${(props.design.color as Color).hsl.l * 100}%`);
|
|
16
|
+
const taglineStyles = computed<CSSProperties>(() => getTextStyles(props.design));
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<style lang="scss" scoped>
|
|
20
|
+
@function set-contrast-color($lightness) {
|
|
21
|
+
$threshold: 60%;
|
|
22
|
+
$contrastLightness: clamp(0%, calc((#{$lightness} - #{$threshold}) * -100), 100%);
|
|
23
|
+
|
|
24
|
+
@return hsl(0, 0%, $contrastLightness);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.tagline {
|
|
28
|
+
--font-size: v-bind(taglineStyles.fontSize);
|
|
29
|
+
--font-family: v-bind(taglineStyles.fontFamily);
|
|
30
|
+
--background-color: v-bind(taglineStyles.background);
|
|
31
|
+
--background-color-l: v-bind(backgroundLightness);
|
|
32
|
+
--font-style: v-bind(taglineStyles.fontStyle);
|
|
33
|
+
--font-weight: v-bind(taglineStyles.fontWeight);
|
|
34
|
+
|
|
35
|
+
display: inline-block;
|
|
36
|
+
padding: 8px 16px;
|
|
37
|
+
border-radius: 20px;
|
|
38
|
+
font-size: var(--font-size);
|
|
39
|
+
font-family: var(--font-family);
|
|
40
|
+
background: var(--background-color);
|
|
41
|
+
color: set-contrast-color(var(--background-color-l));
|
|
42
|
+
font-style: var(--font-style);
|
|
43
|
+
font-weight: var(--font-weight);
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function isColor(color: Color | GlobalColorsString): color is Color {
|
|
2
|
+
return typeof color === 'object' && 'hex' in color;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function getColorString(color: Color | GlobalColorsString | string): string {
|
|
6
|
+
if (typeof color !== 'string' && isColor(color)) {
|
|
7
|
+
return color.hex;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return color;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function calculateFontColor(rgbaColor: RGBAColor): string {
|
|
14
|
+
const brightness = (0.299 * rgbaColor.r + 0.587 * rgbaColor.g + 0.114 * rgbaColor.b) / 255;
|
|
15
|
+
return brightness < 0.5 ? '#ffffff' : '#000000';
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CSSProperties } from 'vue';
|
|
2
|
+
import { getColorString } from './color.ts';
|
|
3
|
+
|
|
4
|
+
export function getTextStyles(design: TextDesignData): CSSProperties {
|
|
5
|
+
return {
|
|
6
|
+
fontSize: `${design.size}px`,
|
|
7
|
+
fontFamily: design.font,
|
|
8
|
+
background: design.color ? getColorString(design.color) : undefined,
|
|
9
|
+
fontStyle: design.italic ? 'italic' : 'normal',
|
|
10
|
+
fontWeight: design.bold ? 'bold' : 'normal',
|
|
11
|
+
};
|
|
12
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
metadata: {
|
|
3
|
+
name: 'Reference Template — Apparel',
|
|
4
|
+
description: 'This is a reference template geared towards apparel merchants to aid development and act as a starting point for your custom template.',
|
|
5
|
+
preview_url: 'https://reference-template-apparel.company.site/',
|
|
6
|
+
cover_image: {
|
|
7
|
+
set: {
|
|
8
|
+
ORIGINAL: {
|
|
9
|
+
url: 'reference_template_apparel_cover_image.jpg',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
sections: [
|
|
15
|
+
{
|
|
16
|
+
type: 'default',
|
|
17
|
+
id: 'header',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
type: 'custom',
|
|
21
|
+
id: 'intro-slider',
|
|
22
|
+
showcase_id: '1',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: 'custom',
|
|
26
|
+
id: 'tag-lines',
|
|
27
|
+
showcase_id: '1',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: 'custom',
|
|
31
|
+
id: 'about-us',
|
|
32
|
+
showcase_id: '1',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: 'custom',
|
|
36
|
+
id: 'example-section',
|
|
37
|
+
showcase_id: '1',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
type: 'default',
|
|
41
|
+
id: 'footer',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
metadata: {
|
|
3
|
+
name: 'Reference Template — Bike',
|
|
4
|
+
description: 'This is a reference template geared towards bike shops to aid development and act as a starting point for your custom template.',
|
|
5
|
+
preview_url: 'https://reference-template-bike.company.site/',
|
|
6
|
+
cover_image: {
|
|
7
|
+
set: {
|
|
8
|
+
ORIGINAL: {
|
|
9
|
+
url: 'reference_template_bike_cover_image.jpg',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
sections: [
|
|
15
|
+
{
|
|
16
|
+
type: 'default',
|
|
17
|
+
id: 'header',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
type: 'custom',
|
|
21
|
+
id: 'intro-slider',
|
|
22
|
+
showcase_id: '2',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: 'custom',
|
|
26
|
+
id: 'example-section',
|
|
27
|
+
showcase_id: '3',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: 'custom',
|
|
31
|
+
id: 'tag-lines',
|
|
32
|
+
showcase_id: '2',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: 'custom',
|
|
36
|
+
id: 'about-us',
|
|
37
|
+
showcase_id: '2',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
type: 'default',
|
|
41
|
+
id: 'footer',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
};
|
|
@@ -1,31 +1,38 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
class="
|
|
2
|
+
<SectionWrapper
|
|
3
|
+
class="example-section"
|
|
4
4
|
:style="backgroundStyle"
|
|
5
5
|
>
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
<CustomSectionExampleTitle />
|
|
7
|
+
<div class="example-section__blank_space" />
|
|
8
|
+
<CustomSectionExampleImagesGrid />
|
|
9
|
+
<div class="custom-block__blank_space" />
|
|
10
|
+
<Button />
|
|
11
|
+
<Toggle />
|
|
12
|
+
<Selectbox />
|
|
13
|
+
</SectionWrapper>
|
|
12
14
|
</template>
|
|
13
15
|
|
|
14
16
|
<script setup lang="ts">
|
|
15
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
useBackgroundElementDesign,
|
|
19
|
+
} from '@lightspeed/crane';
|
|
16
20
|
import { computed } from 'vue';
|
|
17
21
|
import { Design } from './type.ts';
|
|
18
22
|
import CustomSectionExampleTitle from './component/title/Title.vue';
|
|
19
23
|
import CustomSectionExampleImagesGrid from './component/image/ImagesGrid.vue';
|
|
24
|
+
import SectionWrapper from '../../shared/components/SectionWrapper.vue';
|
|
25
|
+
import Selectbox from './component/selectbox/Selectbox.vue';
|
|
26
|
+
import Toggle from './component/toggle/Toggle.vue';
|
|
27
|
+
import Button from './component/button/Button.vue';
|
|
20
28
|
|
|
21
29
|
const backgroundDesign = useBackgroundElementDesign<Design>('background');
|
|
22
30
|
const background = computed(() => ({
|
|
23
31
|
type: backgroundDesign.background?.type,
|
|
24
|
-
solidColor: backgroundDesign.background?.solid?.color
|
|
25
|
-
fromColor: backgroundDesign.background?.gradient?.fromColor
|
|
26
|
-
toColor: backgroundDesign.background?.gradient?.toColor
|
|
32
|
+
solidColor: backgroundDesign.background?.solid?.color,
|
|
33
|
+
fromColor: backgroundDesign.background?.gradient?.fromColor,
|
|
34
|
+
toColor: backgroundDesign.background?.gradient?.toColor,
|
|
27
35
|
}));
|
|
28
|
-
|
|
29
36
|
const backgroundStyle = computed(() => {
|
|
30
37
|
if (background.value.type === 'gradient') {
|
|
31
38
|
return { 'background-image': `linear-gradient(to right, ${background.value.fromColor.hex}, ${background.value.toColor.hex})` };
|
|
@@ -35,17 +42,7 @@ const backgroundStyle = computed(() => {
|
|
|
35
42
|
</script>
|
|
36
43
|
|
|
37
44
|
<style lang="scss" scoped>
|
|
38
|
-
.
|
|
39
|
-
padding: 50px;
|
|
40
|
-
|
|
41
|
-
@media screen and (min-width: 700px) {
|
|
42
|
-
padding: 75px;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@media screen and (min-width: 1200px) {
|
|
46
|
-
padding: 100px;
|
|
47
|
-
}
|
|
48
|
-
|
|
45
|
+
.example-section {
|
|
49
46
|
&__blank_space {
|
|
50
47
|
height: 40px;
|
|
51
48
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="22" height="22" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill="currentColor" d="M19.22 1.735c.528.012.97.42 1.037.933l.009.112.09 4.09a.97.97 0 01-1 1 1.08 1.08 0 01-1.037-.934l-.008-.111-.037-1.684-6.809 6.809c-.438.439-.877.47-1.314.095l-.101-.094c-.438-.437-.469-.876-.093-1.314l.094-.101 6.809-6.809-1.684-.037a1.08 1.08 0 01-1.034-.916l-.01-.128a.969.969 0 01.888-.997l.111-.003 4.09.09zM19 14.5a4.5 4.5 0 01-4.288 4.495L14.5 19h-7a4.5 4.5 0 01-4.495-4.288L3 14.5v-7a4.5 4.5 0 014.288-4.495L7.5 3h2.625a1 1 0 01.117 1.993L10.125 5H7.5a2.5 2.5 0 00-2.495 2.336L5 7.5v7a2.5 2.5 0 002.336 2.495L7.5 17h7a2.5 2.5 0 002.495-2.336L17 14.5v-2.625a1 1 0 011.993-.117l.007.117V14.5z" />
|
|
3
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<button
|
|
4
|
+
v-if="button?.hasTitle && button?.hasLink"
|
|
5
|
+
class="pretty-button"
|
|
6
|
+
type="button"
|
|
7
|
+
@click="button.performAction"
|
|
8
|
+
>
|
|
9
|
+
<div class="button-content">
|
|
10
|
+
<img :src="arrowIcon" alt="Arrow Icon" width="22" height="22" />
|
|
11
|
+
<div style="margin-left: 4px">
|
|
12
|
+
{{ button.title }}
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</button>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import {
|
|
21
|
+
useButtonElementContent,
|
|
22
|
+
} from '@lightspeed/crane';
|
|
23
|
+
import { Content } from '../../type.ts';
|
|
24
|
+
import arrowIcon from '../../assets/arrow.svg';
|
|
25
|
+
|
|
26
|
+
const button = useButtonElementContent<Content>('button');
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<style lang="scss" scoped>
|
|
30
|
+
.button-content {
|
|
31
|
+
display: flex;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
align-items: center;
|
|
34
|
+
}
|
|
35
|
+
.pretty-button {
|
|
36
|
+
background-color: #FFFFFF;
|
|
37
|
+
border: 1px solid #222222;
|
|
38
|
+
border-radius: 8px;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
color: #222222;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
display: inline-block;
|
|
43
|
+
font-family: Circular, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
|
|
44
|
+
font-size: 16px;
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
line-height: 20px;
|
|
47
|
+
margin: 0;
|
|
48
|
+
outline: none;
|
|
49
|
+
padding: 12px 20px;
|
|
50
|
+
position: relative;
|
|
51
|
+
text-align: center;
|
|
52
|
+
text-decoration: none;
|
|
53
|
+
transition: box-shadow 0.2s, transform 0.1s ease;
|
|
54
|
+
user-select: none;
|
|
55
|
+
-webkit-user-select: none;
|
|
56
|
+
width: auto;
|
|
57
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
58
|
+
|
|
59
|
+
&:hover {
|
|
60
|
+
background-color: #F7F7F7;
|
|
61
|
+
border-color: #222222;
|
|
62
|
+
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
|
|
63
|
+
transform: translateY(-2px);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&:active {
|
|
67
|
+
background-color: #F7F7F7;
|
|
68
|
+
border-color: #000000;
|
|
69
|
+
transform: scale(0.96);
|
|
70
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&:focus-visible {
|
|
74
|
+
box-shadow: #222222 0 0 0 2px, rgba(255, 255, 255, 0.8) 0 0 0 4px;
|
|
75
|
+
transition: box-shadow 0.2s;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&:disabled {
|
|
79
|
+
background-color: #FFFFFF;
|
|
80
|
+
border-color: #DDDDDD;
|
|
81
|
+
color: #DDDDDD;
|
|
82
|
+
cursor: not-allowed;
|
|
83
|
+
opacity: 1;
|
|
84
|
+
box-shadow: none;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
</style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="selectbox?.hasContent" class="control-item" :style="{ color: textColor }">
|
|
3
|
+
<div>
|
|
4
|
+
<h1>Selected: {{ selectbox.value }}</h1>
|
|
5
|
+
</div>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
import { computed } from 'vue';
|
|
11
|
+
import { useBackgroundElementDesign, useSelectboxElementContent } from '@lightspeed/crane';
|
|
12
|
+
import { Content, Design } from '../../type.ts';
|
|
13
|
+
import { isDark } from '../../../../shared/utils.ts';
|
|
14
|
+
|
|
15
|
+
const selectbox = useSelectboxElementContent<Content>('selectbox');
|
|
16
|
+
const backgroundDesign = useBackgroundElementDesign<Design>('background');
|
|
17
|
+
|
|
18
|
+
const backgroundColor = computed(() => {
|
|
19
|
+
const currentColor = backgroundDesign.background?.type === 'solid' ? backgroundDesign.background?.solid?.color?.hex
|
|
20
|
+
: backgroundDesign.background?.gradient?.fromColor?.hex;
|
|
21
|
+
return currentColor || '#ffffff';
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const textColor = computed(() => (isDark(backgroundColor.value) ? 'white' : 'black'));
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<style lang="scss" scoped>
|
|
28
|
+
.control-item {
|
|
29
|
+
margin: 20px 0;
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: 10px;
|
|
33
|
+
|
|
34
|
+
label {
|
|
35
|
+
font-weight: 500;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
select {
|
|
39
|
+
padding: 8px 12px;
|
|
40
|
+
border: 1px solid #ccc;
|
|
41
|
+
border-radius: 4px;
|
|
42
|
+
font-size: 14px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</style>
|