srcdev-nuxt-components 5.0.3 → 6.0.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 -8
- package/nuxt.config.ts +5 -2
- package/package.json +11 -12
- package/assets/styles/extends-layer/srcdev-components/display-prompt-core/index.css +0 -70
- package/assets/styles/extends-layer/srcdev-components/index.css +0 -2
- package/assets/styles/extends-layer/srcdev-components/themes/_error.css +0 -15
- package/assets/styles/extends-layer/srcdev-components/themes/_info.css +0 -15
- package/assets/styles/extends-layer/srcdev-components/themes/_success.css +0 -15
- package/assets/styles/extends-layer/srcdev-components/themes/_warning.css +0 -15
- package/assets/styles/extends-layer/srcdev-components/themes/index.css +0 -4
- package/assets/styles/main.css +0 -2
- package/assets/styles/setup/_head.css +0 -5
- package/assets/styles/setup/a11y/_utils.css +0 -20
- package/assets/styles/setup/a11y/_variables.css +0 -10
- package/assets/styles/setup/a11y/index.css +0 -2
- package/assets/styles/setup/index.css +0 -5
- package/assets/styles/setup/typography/index.css +0 -2
- package/assets/styles/setup/typography/utility-classes/_generic-font-classes.css +0 -192
- package/assets/styles/setup/typography/utility-classes/_generic-font-variation-settings.css +0 -29
- package/assets/styles/setup/typography/utility-classes/_generic-font-weights.css +0 -41
- package/assets/styles/setup/typography/utility-classes/index.css +0 -3
- package/assets/styles/setup/typography/vars/_reponsive-font-sizes.css +0 -10
- package/assets/styles/setup/typography/vars/index.css +0 -1
- package/assets/styles/setup/utility-classes/_margin-helpers.css +0 -334
- package/assets/styles/setup/utility-classes/_padding-helpers.css +0 -308
- package/assets/styles/setup/utility-classes/_page.css +0 -50
- package/assets/styles/setup/utility-classes/index.css +0 -3
- package/assets/styles/setup/variables/colors/_blue.css +0 -15
- package/assets/styles/setup/variables/colors/_gray.css +0 -16
- package/assets/styles/setup/variables/colors/_green.css +0 -15
- package/assets/styles/setup/variables/colors/_orange.css +0 -15
- package/assets/styles/setup/variables/colors/_red.css +0 -15
- package/assets/styles/setup/variables/colors/_yellow.css +0 -15
- package/assets/styles/setup/variables/colors/index.css +0 -6
- package/assets/styles/setup/variables/index.css +0 -1
- package/components/accordian/AccordianCore.vue +0 -46
- package/components/animated-svg-text/AnimatedSvgText.vue +0 -87
- package/components/canvas-switcher/CanvasSwitcher.vue +0 -77
- package/components/carousel-basic/CarouselBasic.vue +0 -291
- package/components/carousel-basic/CarouselFlip.vue +0 -461
- package/components/carousel-basic/CarouselInfinite.vue +0 -325
- package/components/clip-element/ClipElement.vue +0 -73
- package/components/clipped-panels/ClippedPanel.vue +0 -73
- package/components/container-glow/ContainerGlowCore.vue +0 -211
- package/components/content-grid/ContentGrid.vue +0 -85
- package/components/deep-expanding-menu/DeepExpandingMenu.vue +0 -214
- package/components/deep-expanding-menu/DeepExpandingMenuOld.vue +0 -218
- package/components/display-banner/DisplayBanner.vue +0 -63
- package/components/display-details/DisplayDetailsCore.vue +0 -301
- package/components/display-dialog/DisplayDialogCore.vue +0 -255
- package/components/display-dialog/variants/DisplayDialogConfirm.vue +0 -45
- package/components/display-dialog/variants/DisplayDialogScrollableContent.vue +0 -49
- package/components/display-grid/DisplayGridCore.vue +0 -22
- package/components/display-prompt/DisplayPromptCore.vue +0 -187
- package/components/display-prompt/variants/DisplayPromptError.vue +0 -53
- package/components/expanding-panel/ExpandingPanel.vue +0 -124
- package/components/image-galleries/SliderGallery.vue +0 -784
- package/components/layout-grids/LayoutGridA.vue +0 -103
- package/components/layout-grids/LayoutGridB.vue +0 -132
- package/components/layout-row/LayoutRow.vue +0 -165
- package/components/masonry-grid/MasonryGrid.vue +0 -62
- package/components/masonry-grid-ordered/MasonryGridOrdered.vue +0 -158
- package/components/masonry-grid-sorted/MasonryGridSorted.vue +0 -115
- package/components/pop-over/PopOver.vue +0 -88
- package/components/responsive-header/NavigationItems.vue +0 -169
- package/components/responsive-header/ResponsiveHeader.vue +0 -686
- package/components/rotating-carousel/RotatingCarouselImage.vue +0 -200
- package/components/skip-links/SkipLinks.vue +0 -92
- package/components/tabs/TabsCore.vue +0 -277
- package/composables/useDialogControls.ts +0 -44
- package/composables/useStyleClassPassthrough.ts +0 -35
- package/composables/useTabs.ts +0 -201
- package/types/gallery-data.ts +0 -13
- package/types/responsiveHeader.ts +0 -38
- package/types/types.carousel-basic.ts +0 -19
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--orange-0: #fff4e6;
|
|
3
|
-
--orange-1: #ffe8cc;
|
|
4
|
-
--orange-2: #ffd8a8;
|
|
5
|
-
--orange-3: #ffc078;
|
|
6
|
-
--orange-4: #ffa94d;
|
|
7
|
-
--orange-5: #ff922b;
|
|
8
|
-
--orange-6: #ff7400;
|
|
9
|
-
--orange-7: #f76707;
|
|
10
|
-
--orange-8: #e8590c;
|
|
11
|
-
--orange-9: #d9480f;
|
|
12
|
-
--orange-10: #bf400d;
|
|
13
|
-
--orange-11: #99330b;
|
|
14
|
-
--orange-12: #c23903;
|
|
15
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--red-0: #fff5f5;
|
|
3
|
-
--red-1: #ffe3e3;
|
|
4
|
-
--red-2: #ffc9c9;
|
|
5
|
-
--red-3: #ffa8a8;
|
|
6
|
-
--red-4: #ff8787;
|
|
7
|
-
--red-5: #ff6b6b;
|
|
8
|
-
--red-6: #fa5252;
|
|
9
|
-
--red-7: #f03e3e;
|
|
10
|
-
--red-8: #e03131;
|
|
11
|
-
--red-9: #ff0b0b;
|
|
12
|
-
--red-10: #b02525;
|
|
13
|
-
--red-11: #962020;
|
|
14
|
-
--red-12: #cc0000;
|
|
15
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--yellow-0: #fff9db;
|
|
3
|
-
--yellow-1: #fff3bf;
|
|
4
|
-
--yellow-2: #ffec99;
|
|
5
|
-
--yellow-3: #ffe066;
|
|
6
|
-
--yellow-4: #ffd43b;
|
|
7
|
-
--yellow-5: #fcc419;
|
|
8
|
-
--yellow-6: #fab005;
|
|
9
|
-
--yellow-7: #f59f00;
|
|
10
|
-
--yellow-8: #f08c00;
|
|
11
|
-
--yellow-9: #e67700;
|
|
12
|
-
--yellow-10: #b35c00;
|
|
13
|
-
--yellow-11: #804200;
|
|
14
|
-
--yellow-12: #663500;
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import './colors/';
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="display-accordian" :class="[elementClasses]">
|
|
3
|
-
<ExpandingPanel v-for="(item, key) in itemCount" :key="key" :name :animation-duration="300" icon-size="medium" :style-class-passthrough="['accordian-item']">
|
|
4
|
-
<template #summary>
|
|
5
|
-
<slot :name="`accordian-${key}-summary`"></slot>
|
|
6
|
-
</template>
|
|
7
|
-
<template #icon>
|
|
8
|
-
<slot :name="`accordian-${key}-icon`"></slot>
|
|
9
|
-
</template>
|
|
10
|
-
<template #content>
|
|
11
|
-
<slot :name="`accordian-${key}-content`"></slot>
|
|
12
|
-
</template>
|
|
13
|
-
</ExpandingPanel>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script setup lang="ts">
|
|
18
|
-
const props = defineProps({
|
|
19
|
-
name: {
|
|
20
|
-
type: String,
|
|
21
|
-
default: null,
|
|
22
|
-
},
|
|
23
|
-
itemCount: {
|
|
24
|
-
type: Number as PropType<number>,
|
|
25
|
-
default: 0,
|
|
26
|
-
},
|
|
27
|
-
animationDuration: {
|
|
28
|
-
type: Number,
|
|
29
|
-
default: 400,
|
|
30
|
-
},
|
|
31
|
-
styleClassPassthrough: {
|
|
32
|
-
type: Array as PropType<string[]>,
|
|
33
|
-
default: () => [],
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
38
|
-
const animationDurationStr = computed(() => `${props.animationDuration}ms`);
|
|
39
|
-
</script>
|
|
40
|
-
|
|
41
|
-
<style lang="css">
|
|
42
|
-
.display-accordian {
|
|
43
|
-
max-width: 600px;
|
|
44
|
-
margin: 0 auto;
|
|
45
|
-
}
|
|
46
|
-
</style>
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="animated-svg-text" :class="[elementClasses]">
|
|
3
|
-
<slot name="text"></slot>
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup lang="ts">
|
|
8
|
-
const props = defineProps({
|
|
9
|
-
styleClassPassthrough: {
|
|
10
|
-
type: Array as PropType<string[]>,
|
|
11
|
-
default: () => [],
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
16
|
-
|
|
17
|
-
watch(
|
|
18
|
-
() => props.styleClassPassthrough,
|
|
19
|
-
() => {
|
|
20
|
-
resetElementClasses(props.styleClassPassthrough);
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<style lang="css">
|
|
26
|
-
|
|
27
|
-
@keyframes animatedSvgText {
|
|
28
|
-
0% {
|
|
29
|
-
fill: transparent;
|
|
30
|
-
stroke-dashoffset: var(--_animated-svg-text-stroke-dasharray);
|
|
31
|
-
stroke-width: 0.3;
|
|
32
|
-
}
|
|
33
|
-
70% {
|
|
34
|
-
fill: transparent;
|
|
35
|
-
stroke-width: 0.3;
|
|
36
|
-
}
|
|
37
|
-
100% {
|
|
38
|
-
fill: var(--_animated-svg-fill-color);
|
|
39
|
-
stroke-dashoffset: 0;
|
|
40
|
-
stroke-width: 0;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
html {
|
|
45
|
-
|
|
46
|
-
&[data-color-scheme='light'] {
|
|
47
|
-
.animated-svg-text {
|
|
48
|
-
--_animated-svg-text-color: var(--_animated-svg-text-stroke-light);
|
|
49
|
-
--_animated-svg-fill-color: var(--_animated-svg-text-fill-light);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
&[data-color-scheme='dark'] {
|
|
53
|
-
.animated-svg-text {
|
|
54
|
-
--_animated-svg-text-color: var(--_animated-svg-text-stroke-dark);
|
|
55
|
-
--_animated-svg-fill-color: var(--_animated-svg-text-fill-dark);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
&[data-color-scheme='auto'] {
|
|
59
|
-
.animated-svg-text {
|
|
60
|
-
@media (prefers-color-scheme: light) {
|
|
61
|
-
--_animated-svg-text-color: var(--_animated-svg-text-stroke-light);
|
|
62
|
-
--_animated-svg-fill-color: var(--_animated-svg-text-fill-light);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
@media (prefers-color-scheme: dark) {
|
|
66
|
-
--_animated-svg-text-color: var(--_animated-svg-text-stroke-dark);
|
|
67
|
-
--_animated-svg-fill-color: var(--_animated-svg-text-fill-dark);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.animated-svg-text {
|
|
73
|
-
|
|
74
|
-
--_animated-svg-text-color: var(--_animated-svg-text-stroke-light):
|
|
75
|
-
--_animated-svg-fill-color: var(--_animated-svg-text-fill-light);
|
|
76
|
-
|
|
77
|
-
svg path {
|
|
78
|
-
stroke: var(--_animated-svg-text-color);
|
|
79
|
-
stroke-width: 0.3;
|
|
80
|
-
stroke-dasharray: var(--_animated-svg-text-stroke-dasharray);
|
|
81
|
-
stroke-dashoffset: var(--_animated-svg-text-stroke-dasharray);
|
|
82
|
-
animation: animatedSvgText var(--_animated-svg-animation-duration) linear 1 forwards;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
</style>
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="canvas-switcher">
|
|
3
|
-
<p>Canvas switcher</p>
|
|
4
|
-
<ul class="canvas-switcher mbe-20">
|
|
5
|
-
<li>
|
|
6
|
-
<button type="button" @click.stop.prevent="updateCanvas('mobileCanvas')">
|
|
7
|
-
<Icon name="ic:baseline-phone-iphone" class="icon" :class="[{ current: canvasName === 'mobileCanvas' }]" />
|
|
8
|
-
</button>
|
|
9
|
-
</li>
|
|
10
|
-
<li>
|
|
11
|
-
<button type="button" @click.stop.prevent="updateCanvas('tabletCanvas')">
|
|
12
|
-
<Icon name="ic:baseline-tablet-mac" class="icon" :class="[{ current: canvasName === 'tabletCanvas' }]" />
|
|
13
|
-
</button>
|
|
14
|
-
</li>
|
|
15
|
-
<li>
|
|
16
|
-
<button type="button" @click.stop.prevent="updateCanvas('laptopCanvas')">
|
|
17
|
-
<Icon name="ic:baseline-laptop-mac" class="icon" :class="[{ current: canvasName === 'laptopCanvas' }]" />
|
|
18
|
-
</button>
|
|
19
|
-
</li>
|
|
20
|
-
<li>
|
|
21
|
-
<button type="button" @click.stop.prevent="updateCanvas('desktopCanvas')">
|
|
22
|
-
<Icon name="ic:outline-desktop-mac" class="icon" :class="[{ current: canvasName === 'desktopCanvas' }]" />
|
|
23
|
-
</button>
|
|
24
|
-
</li>
|
|
25
|
-
</ul>
|
|
26
|
-
</div>
|
|
27
|
-
</template>
|
|
28
|
-
|
|
29
|
-
<script setup lang="ts">
|
|
30
|
-
import type { MediaCanvas } from '@/types/types.canvasName';
|
|
31
|
-
|
|
32
|
-
const canvasName = defineModel<MediaCanvas>('canvasName');
|
|
33
|
-
|
|
34
|
-
const updateCanvas = (setCanvas: MediaCanvas) => {
|
|
35
|
-
canvasName.value = setCanvas;
|
|
36
|
-
};
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
<style lang="css">
|
|
40
|
-
.canvas-switcher {
|
|
41
|
-
display: flex;
|
|
42
|
-
align-items: center;
|
|
43
|
-
gap: 20px;
|
|
44
|
-
|
|
45
|
-
ul {
|
|
46
|
-
display: flex;
|
|
47
|
-
gap: 10px;
|
|
48
|
-
list-style-type: none;
|
|
49
|
-
margin: 0;
|
|
50
|
-
padding: 0;
|
|
51
|
-
|
|
52
|
-
li {
|
|
53
|
-
button {
|
|
54
|
-
all: unset;
|
|
55
|
-
display: flex;
|
|
56
|
-
align-items: center;
|
|
57
|
-
justify-content: center;
|
|
58
|
-
padding: 5px;
|
|
59
|
-
border: 0px solid light-dark(var(--gray-10), var(--gray-2));
|
|
60
|
-
border-radius: 4px;
|
|
61
|
-
cursor: pointer;
|
|
62
|
-
|
|
63
|
-
.icon {
|
|
64
|
-
color: light-dark(var(--gray-10), var(--gray-2));
|
|
65
|
-
|
|
66
|
-
width: 24px;
|
|
67
|
-
height: 24px;
|
|
68
|
-
|
|
69
|
-
&.current {
|
|
70
|
-
color: light-dark(var(--green-10), var(--green-4));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
</style>
|
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section class="carousel-basic" :class="[elementClasses]" ref="carouselWrapperRef" role="region" aria-label="Image carousel">
|
|
3
|
-
<!-- Screen reader announcement for current item -->
|
|
4
|
-
<div aria-live="polite" aria-atomic="true" class="sr-only">Item {{ currentIndex + 1 }} of {{ itemCount }}</div>
|
|
5
|
-
|
|
6
|
-
<LayoutRow tag="div" variant="full-width" :style-class-passthrough="['mbe-20']">
|
|
7
|
-
<div tabindex="0" class="item-container" :class="{ 'allow-overflow': allowCarouselOverflow }" ref="carouselContainerRef" role="group" aria-label="Carousel items">
|
|
8
|
-
<div v-for="(item, index) in carouselDataIds" :key="index" class="item" ref="carouselItems" :aria-current="currentIndex === index ? 'true' : 'false'">
|
|
9
|
-
<slot :name="item"></slot>
|
|
10
|
-
</div>
|
|
11
|
-
</div>
|
|
12
|
-
</LayoutRow>
|
|
13
|
-
|
|
14
|
-
<LayoutRow tag="div" variant="full-width" :style-class-passthrough="['mbe-20']">
|
|
15
|
-
<div class="timeline-container">
|
|
16
|
-
<div v-for="index in itemCount" :key="index" class="timeline-item">
|
|
17
|
-
<div class="count">Step {{ index }}</div>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
</LayoutRow>
|
|
21
|
-
|
|
22
|
-
<LayoutRow tag="div" variant="full-width" :style-class-passthrough="['mbe-20']">
|
|
23
|
-
<div tabindex="0" class="controls-container" ref="controlsContainerRef">
|
|
24
|
-
<div class="markers-container">
|
|
25
|
-
<ul class="markers-list">
|
|
26
|
-
<li v-for="index in itemCount" :key="index" class="markers-item">
|
|
27
|
-
<button @click.prevent="jumpToFrame(index - 1)" class="btn-marker" :class="[{ active: currentIndex === index - 1 }]" :aria-label="`Jump to item ${Math.floor(index + 1)}`"></button>
|
|
28
|
-
</li>
|
|
29
|
-
</ul>
|
|
30
|
-
</div>
|
|
31
|
-
<div class="buttons-container">
|
|
32
|
-
<button type="button" @click.prevent="actionPrevious()" class="btn-action" aria-label="Go to previous item">
|
|
33
|
-
<Icon name="ic:outline-keyboard-arrow-left" class="arrows-icon" />
|
|
34
|
-
</button>
|
|
35
|
-
<button type="button" @click.prevent="actionNext()" class="btn-action" aria-label="Go to next item">
|
|
36
|
-
<Icon name="ic:outline-keyboard-arrow-right" class="arrows-icon" />
|
|
37
|
-
</button>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
</LayoutRow>
|
|
41
|
-
</section>
|
|
42
|
-
</template>
|
|
43
|
-
|
|
44
|
-
<script setup lang="ts">
|
|
45
|
-
import { useEventListener, useResizeObserver, useSwipe } from '@vueuse/core';
|
|
46
|
-
|
|
47
|
-
const props = defineProps({
|
|
48
|
-
carouselDataIds: {
|
|
49
|
-
type: Array as PropType<string[]>,
|
|
50
|
-
default: () => [],
|
|
51
|
-
},
|
|
52
|
-
styleClassPassthrough: {
|
|
53
|
-
type: Array as PropType<string[]>,
|
|
54
|
-
default: () => [],
|
|
55
|
-
},
|
|
56
|
-
transitionSpeed: {
|
|
57
|
-
type: Number,
|
|
58
|
-
default: 200,
|
|
59
|
-
},
|
|
60
|
-
allowCarouselOverflow: {
|
|
61
|
-
type: Boolean,
|
|
62
|
-
default: false,
|
|
63
|
-
},
|
|
64
|
-
returnToStart: {
|
|
65
|
-
type: Boolean,
|
|
66
|
-
default: false,
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
71
|
-
|
|
72
|
-
const carouselWrapperRef = ref<HTMLDivElement | null>(null);
|
|
73
|
-
const carouselContainerRef = ref<HTMLDivElement | null>(null);
|
|
74
|
-
const carouselItemsRef = useTemplateRef<HTMLDivElement[]>('carouselItems');
|
|
75
|
-
const controlsContainerRef = ref<HTMLDivElement | null>(null);
|
|
76
|
-
const carouselInitComplete = ref(false);
|
|
77
|
-
|
|
78
|
-
const currentIndex = ref(0);
|
|
79
|
-
const itemCount = ref(props.carouselDataIds.length);
|
|
80
|
-
const offset = ref(0);
|
|
81
|
-
const transitionSpeedStr = props.transitionSpeed + 'ms';
|
|
82
|
-
const itemTransform = computed(() => {
|
|
83
|
-
return `translateX(calc(${offset.value} * (${itemWidth.value} + var(--_carousel-item-track-gap))))`;
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
const itemWidth = ref('0px');
|
|
87
|
-
|
|
88
|
-
const actionPrevious = () => {
|
|
89
|
-
if (props.returnToStart && currentIndex.value === 0) {
|
|
90
|
-
offset.value = -itemCount.value;
|
|
91
|
-
doAction();
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (offset.value >= 0) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
offset.value = Math.min(offset.value + 1);
|
|
99
|
-
doAction();
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const actionNext = () => {
|
|
103
|
-
if (props.returnToStart && offset.value <= -1 * (itemCount.value - 1)) {
|
|
104
|
-
offset.value = 0;
|
|
105
|
-
doAction();
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (offset.value <= -1 * (itemCount.value - 1)) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
offset.value = Math.min(offset.value - 1);
|
|
114
|
-
doAction();
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
const doAction = () => {
|
|
118
|
-
currentIndex.value = Math.abs(offset.value);
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
const jumpToFrame = (index: number) => {
|
|
122
|
-
if (index >= 0 && index < itemCount.value) {
|
|
123
|
-
offset.value = -index;
|
|
124
|
-
doAction();
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
const initialSetup = () => {
|
|
129
|
-
if (carouselItemsRef?.value && carouselItemsRef.value.length > 0 && carouselItemsRef.value[0]) {
|
|
130
|
-
itemWidth.value = carouselItemsRef.value[0].offsetWidth + 'px';
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
carouselInitComplete.value = true;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const { direction } = useSwipe(carouselContainerRef, {
|
|
137
|
-
passive: false,
|
|
138
|
-
onSwipeEnd() {
|
|
139
|
-
if (direction.value === 'left') {
|
|
140
|
-
actionNext();
|
|
141
|
-
} else if (direction.value === 'right') {
|
|
142
|
-
actionPrevious();
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
useEventListener(carouselContainerRef, 'keydown', (event: KeyboardEvent) => {
|
|
148
|
-
if (event.key === 'ArrowLeft') {
|
|
149
|
-
actionPrevious();
|
|
150
|
-
} else if (event.key === 'ArrowRight') {
|
|
151
|
-
actionNext();
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
useEventListener(controlsContainerRef, 'keydown', (event: KeyboardEvent) => {
|
|
156
|
-
if (event.key === 'ArrowLeft') {
|
|
157
|
-
actionPrevious();
|
|
158
|
-
} else if (event.key === 'ArrowRight') {
|
|
159
|
-
actionNext();
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
useResizeObserver(carouselWrapperRef, async () => {
|
|
164
|
-
initialSetup();
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
onMounted(() => {
|
|
168
|
-
initialSetup();
|
|
169
|
-
});
|
|
170
|
-
</script>
|
|
171
|
-
|
|
172
|
-
<style lang="css">
|
|
173
|
-
.carousel-basic {
|
|
174
|
-
--_carousel-item-track-gap: 10px;
|
|
175
|
-
|
|
176
|
-
display: grid;
|
|
177
|
-
grid-template-columns: 1fr;
|
|
178
|
-
gap: 10px;
|
|
179
|
-
|
|
180
|
-
.sr-only {
|
|
181
|
-
position: absolute;
|
|
182
|
-
width: 1px;
|
|
183
|
-
height: 1px;
|
|
184
|
-
padding: 0;
|
|
185
|
-
margin: -1px;
|
|
186
|
-
overflow: hidden;
|
|
187
|
-
clip: rect(0, 0, 0, 0);
|
|
188
|
-
white-space: nowrap;
|
|
189
|
-
border: 0;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.timeline-container {
|
|
193
|
-
display: flex;
|
|
194
|
-
gap: var(--_carousel-item-track-gap);
|
|
195
|
-
overflow-x: hidden;
|
|
196
|
-
|
|
197
|
-
.timeline-item {
|
|
198
|
-
display: flex;
|
|
199
|
-
flex: 0 0 100%;
|
|
200
|
-
max-inline-size: 800px;
|
|
201
|
-
align-items: center;
|
|
202
|
-
transform: v-bind(itemTransform);
|
|
203
|
-
position: relative;
|
|
204
|
-
|
|
205
|
-
&::before {
|
|
206
|
-
content: '';
|
|
207
|
-
position: absolute;
|
|
208
|
-
height: 2px;
|
|
209
|
-
background-color: #fff;
|
|
210
|
-
left: 70px;
|
|
211
|
-
right: 0;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.count {
|
|
215
|
-
width: fit-content;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.item-container {
|
|
221
|
-
display: flex;
|
|
222
|
-
gap: var(--_carousel-item-track-gap);
|
|
223
|
-
overflow-x: hidden;
|
|
224
|
-
position: relative;
|
|
225
|
-
|
|
226
|
-
&.allow-overflow {
|
|
227
|
-
overflow-x: initial;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.item {
|
|
231
|
-
display: flex;
|
|
232
|
-
flex: 0 0 100%;
|
|
233
|
-
max-inline-size: 800px;
|
|
234
|
-
transition: transform v-bind(transitionSpeedStr) ease;
|
|
235
|
-
transform: v-bind(itemTransform);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
.controls-container {
|
|
240
|
-
display: flex;
|
|
241
|
-
align-items: center;
|
|
242
|
-
justify-content: flex-end;
|
|
243
|
-
|
|
244
|
-
.markers-container {
|
|
245
|
-
.markers-list {
|
|
246
|
-
display: flex;
|
|
247
|
-
flex-direction: row;
|
|
248
|
-
gap: 10px;
|
|
249
|
-
list-style-type: none;
|
|
250
|
-
margin: unset;
|
|
251
|
-
padding: unset;
|
|
252
|
-
|
|
253
|
-
.markers-item {
|
|
254
|
-
.btn-marker {
|
|
255
|
-
border: none;
|
|
256
|
-
outline: none;
|
|
257
|
-
box-shadow: none;
|
|
258
|
-
cursor: pointer;
|
|
259
|
-
transition: background-color v-bind(transitionSpeedStr) linear;
|
|
260
|
-
|
|
261
|
-
&.active {
|
|
262
|
-
background-color: red;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.buttons-container {
|
|
270
|
-
display: flex;
|
|
271
|
-
align-items: center;
|
|
272
|
-
justify-content: end;
|
|
273
|
-
gap: 20px;
|
|
274
|
-
|
|
275
|
-
.btn-action {
|
|
276
|
-
display: flex;
|
|
277
|
-
align-items: center;
|
|
278
|
-
justify-content: center;
|
|
279
|
-
|
|
280
|
-
cursor: pointer;
|
|
281
|
-
height: fit-content;
|
|
282
|
-
|
|
283
|
-
.arrows-icon {
|
|
284
|
-
width: 24px;
|
|
285
|
-
height: 24px;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
</style>
|