@sierra-95/svelte-scaffold 1.0.67 → 1.0.69
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/Core/components/Form/Form/form.svelte +4 -86
- package/dist/Core/components/Form/Form/form.svelte.d.ts +2 -1
- package/dist/Core/components/others/Carousel/carousel.svelte +93 -0
- package/dist/Core/components/others/Carousel/carousel.svelte.d.ts +7 -0
- package/dist/Core/components/others/Hr/HrSplit/hrsplit.svelte +36 -0
- package/dist/Core/components/others/Hr/HrSplit/hrsplit.svelte.d.ts +21 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/package.json +1 -1
- /package/dist/Core/components/others/Hr/{hr.svelte → Hr/hr.svelte} +0 -0
- /package/dist/Core/components/others/Hr/{hr.svelte.d.ts → Hr/hr.svelte.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { onMount, onDestroy } from 'svelte';
|
|
3
2
|
import { enhance } from '$app/forms';
|
|
3
|
+
import {Carousel} from '../../../../index.js';
|
|
4
4
|
|
|
5
5
|
type _method = 'dialog' |'get' | 'post' | 'DIALOG' | 'GET' | 'POST';
|
|
6
6
|
const {
|
|
@@ -8,48 +8,19 @@
|
|
|
8
8
|
formBackground = 'white',
|
|
9
9
|
pageBackground = 'var(--primary-bg)',
|
|
10
10
|
images = [],
|
|
11
|
-
|
|
11
|
+
period = 5000,
|
|
12
|
+
carouselButtonColor = 'white',
|
|
12
13
|
tailwindCss = '',
|
|
13
14
|
method = 'post' as _method,
|
|
14
15
|
enhanceAction = null,
|
|
15
16
|
...rest
|
|
16
17
|
} = $props();
|
|
17
18
|
|
|
18
|
-
let currentIndex = $state(0);
|
|
19
|
-
let interval: any;
|
|
20
19
|
|
|
21
|
-
const next = () => {
|
|
22
|
-
currentIndex = (currentIndex + 1) % images.length;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const prev = () => {
|
|
26
|
-
currentIndex = (currentIndex - 1 + images.length) % images.length;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
onMount(() => {
|
|
30
|
-
if (images.length > 0) {
|
|
31
|
-
interval = setInterval(next, imagePlayInterval);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
onDestroy(() => {
|
|
36
|
-
clearInterval(interval);
|
|
37
|
-
});
|
|
38
20
|
</script>
|
|
39
21
|
|
|
40
22
|
<main id="karakal-form" style="background-color: {pageBackground};">
|
|
41
|
-
|
|
42
|
-
<div class="carousel">
|
|
43
|
-
{#each images as img, i}
|
|
44
|
-
<div class="slide {i === currentIndex ? 'active' : ''}"
|
|
45
|
-
style="background-image: url('{img}')"
|
|
46
|
-
></div>
|
|
47
|
-
{/each}
|
|
48
|
-
|
|
49
|
-
<button class="nav prev" onclick={prev}>‹</button>
|
|
50
|
-
<button class="nav next" onclick={next}>›</button>
|
|
51
|
-
</div>
|
|
52
|
-
{/if}
|
|
23
|
+
<Carousel images={images} period={period} buttonColor={carouselButtonColor}/>
|
|
53
24
|
<form use:enhance={enhanceAction} method={method} {...rest} class={tailwindCss} style="background-color: {formBackground};">
|
|
54
25
|
{@render children()}
|
|
55
26
|
</form>
|
|
@@ -82,57 +53,4 @@
|
|
|
82
53
|
padding: 20px;
|
|
83
54
|
}
|
|
84
55
|
}
|
|
85
|
-
|
|
86
|
-
#karakal-form .carousel{
|
|
87
|
-
position: absolute;
|
|
88
|
-
inset: 0;
|
|
89
|
-
overflow: hidden;
|
|
90
|
-
z-index: 0;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
#karakal-form .slide{
|
|
94
|
-
position: absolute;
|
|
95
|
-
inset: 0;
|
|
96
|
-
background-size: cover;
|
|
97
|
-
background-position: center;
|
|
98
|
-
opacity: 0;
|
|
99
|
-
transform: scale(1.05);
|
|
100
|
-
transition: opacity 1.2s ease, transform 6s ease;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/* active slide */
|
|
104
|
-
#karakal-form .slide.active{
|
|
105
|
-
opacity: 1;
|
|
106
|
-
transform: scale(1);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/* subtle dark overlay so form is readable */
|
|
110
|
-
#karakal-form .carousel::after{
|
|
111
|
-
content: '';
|
|
112
|
-
position: absolute;
|
|
113
|
-
inset: 0;
|
|
114
|
-
background: rgba(0,0,0,0.35);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/* nav buttons */
|
|
118
|
-
#karakal-form .nav{
|
|
119
|
-
position: absolute;
|
|
120
|
-
top: 50%;
|
|
121
|
-
transform: translateY(-50%);
|
|
122
|
-
z-index: 1;
|
|
123
|
-
background: rgba(0,0,0,0.4);
|
|
124
|
-
color: white;
|
|
125
|
-
border: none;
|
|
126
|
-
padding: 10px 14px;
|
|
127
|
-
cursor: pointer;
|
|
128
|
-
border-radius: 4px;
|
|
129
|
-
backdrop-filter: blur(4px);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
#karakal-form .nav.prev{ left: 15px; }
|
|
133
|
-
#karakal-form .nav.next{ right: 15px; }
|
|
134
|
-
|
|
135
|
-
#karakal-form .nav:hover{
|
|
136
|
-
background: rgba(0,0,0,0.6);
|
|
137
|
-
}
|
|
138
56
|
</style>
|
|
@@ -3,7 +3,8 @@ declare const Form: import("svelte").Component<{
|
|
|
3
3
|
formBackground?: string;
|
|
4
4
|
pageBackground?: string;
|
|
5
5
|
images?: any[];
|
|
6
|
-
|
|
6
|
+
period?: number;
|
|
7
|
+
carouselButtonColor?: string;
|
|
7
8
|
tailwindCss?: string;
|
|
8
9
|
method?: "dialog" | "get" | "post" | "DIALOG" | "GET" | "POST";
|
|
9
10
|
enhanceAction?: any;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount, onDestroy } from 'svelte';
|
|
3
|
+
const {
|
|
4
|
+
images = [],
|
|
5
|
+
period = 5000,
|
|
6
|
+
buttonColor = 'white',
|
|
7
|
+
} = $props();
|
|
8
|
+
|
|
9
|
+
let currentIndex = $state(0);
|
|
10
|
+
let interval: any;
|
|
11
|
+
|
|
12
|
+
const next = () => {
|
|
13
|
+
currentIndex = (currentIndex + 1) % images.length;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const prev = () => {
|
|
17
|
+
currentIndex = (currentIndex - 1 + images.length) % images.length;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
onMount(() => {
|
|
21
|
+
if (images.length > 0) {
|
|
22
|
+
interval = setInterval(next, period);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
onDestroy(() => {
|
|
27
|
+
clearInterval(interval);
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
30
|
+
{#if images.length > 0}
|
|
31
|
+
<div id="sierra-carousel">
|
|
32
|
+
{#each images as img, i}
|
|
33
|
+
<div class="slide {i === currentIndex ? 'active' : ''}"
|
|
34
|
+
style="background-image: url('{img}')"
|
|
35
|
+
></div>
|
|
36
|
+
{/each}
|
|
37
|
+
|
|
38
|
+
<button style="color: {buttonColor};" aria-label="left" class="nav prev" onclick={prev}><i class="fa-solid fa-chevron-left"></i></button>
|
|
39
|
+
<button style="color: {buttonColor};" aria-label="right" class="nav next" onclick={next}><i class="fa-solid fa-chevron-right"></i></button>
|
|
40
|
+
</div>
|
|
41
|
+
{/if}
|
|
42
|
+
|
|
43
|
+
<style>
|
|
44
|
+
#sierra-carousel{
|
|
45
|
+
position: absolute;
|
|
46
|
+
inset: 0;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
z-index: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
#sierra-carousel .slide{
|
|
52
|
+
position: absolute;
|
|
53
|
+
inset: 0;
|
|
54
|
+
background-size: cover;
|
|
55
|
+
background-position: center;
|
|
56
|
+
opacity: 0;
|
|
57
|
+
transform: scale(1.05);
|
|
58
|
+
transition: opacity 1.2s ease, transform 6s ease;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* active slide */
|
|
62
|
+
#sierra-carousel .slide.active{
|
|
63
|
+
opacity: 1;
|
|
64
|
+
transform: scale(1);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* subtle dark overlay so form is readable */
|
|
68
|
+
#sierra-carousel::after{
|
|
69
|
+
content: '';
|
|
70
|
+
position: absolute;
|
|
71
|
+
inset: 0;
|
|
72
|
+
background: rgba(0,0,0,0.35);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* nav buttons */
|
|
76
|
+
#sierra-carousel .nav{
|
|
77
|
+
position: absolute;
|
|
78
|
+
top: 50%;
|
|
79
|
+
transform: translateY(-50%);
|
|
80
|
+
z-index: 1;
|
|
81
|
+
background: rgba(0,0,0,0.4);
|
|
82
|
+
padding: 10px 14px;
|
|
83
|
+
border-radius: 4px;
|
|
84
|
+
backdrop-filter: blur(4px);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
#sierra-carousel .nav.prev{ left: 15px; }
|
|
88
|
+
#sierra-carousel .nav.next{ right: 15px; }
|
|
89
|
+
|
|
90
|
+
#sierra-carousel .nav:hover{
|
|
91
|
+
background: rgba(0,0,0,0.6);
|
|
92
|
+
}
|
|
93
|
+
</style>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
let {
|
|
3
|
+
text = '',
|
|
4
|
+
height = '1px',
|
|
5
|
+
color = 'var(--text-color)',
|
|
6
|
+
fontSize = '1rem',
|
|
7
|
+
hrColor = '#ccc',
|
|
8
|
+
margin = '1rem 0'
|
|
9
|
+
} = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<style>
|
|
13
|
+
#sierra-hr-split {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
gap: 0.5rem;
|
|
17
|
+
white-space: nowrap; /* prevents text from breaking */
|
|
18
|
+
}
|
|
19
|
+
#sierra-hr-split hr {
|
|
20
|
+
flex: 1;
|
|
21
|
+
height: var(--hr-height, 1px);
|
|
22
|
+
background-color: var(--hr-color, #ccc);
|
|
23
|
+
border: none;
|
|
24
|
+
margin: 0;
|
|
25
|
+
}
|
|
26
|
+
#sierra-hr-split span {
|
|
27
|
+
color: var(--text-color, #000);
|
|
28
|
+
font-size: var(--font-size, 1rem);
|
|
29
|
+
}
|
|
30
|
+
</style>
|
|
31
|
+
|
|
32
|
+
<div id="sierra-hr-split" style="--hr-color: {hrColor}; --hr-height: {height}; --text-color: {color}; --font-size: {fontSize}; margin: {margin};">
|
|
33
|
+
<hr />
|
|
34
|
+
<span>{text}</span>
|
|
35
|
+
<hr />
|
|
36
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default Hrsplit;
|
|
2
|
+
type Hrsplit = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const Hrsplit: import("svelte").Component<{
|
|
7
|
+
text?: string;
|
|
8
|
+
height?: string;
|
|
9
|
+
color?: string;
|
|
10
|
+
fontSize?: string;
|
|
11
|
+
hrColor?: string;
|
|
12
|
+
margin?: string;
|
|
13
|
+
}, {}, "">;
|
|
14
|
+
type $$ComponentProps = {
|
|
15
|
+
text?: string;
|
|
16
|
+
height?: string;
|
|
17
|
+
color?: string;
|
|
18
|
+
fontSize?: string;
|
|
19
|
+
hrColor?: string;
|
|
20
|
+
margin?: string;
|
|
21
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -31,9 +31,11 @@ export { default as Tabs } from './Core/components/Menus/Tabs/main.svelte';
|
|
|
31
31
|
export { default as HamburgerMenu } from './Core/components/Menus/Hamburger/hamburger.svelte';
|
|
32
32
|
export { default as Time } from './Core/components/others/Calender/Time/time.svelte';
|
|
33
33
|
export { default as Date } from './Core/components/others/Calender/Date/date.svelte';
|
|
34
|
-
export { default as Hr } from './Core/components/others/Hr/hr.svelte';
|
|
34
|
+
export { default as Hr } from './Core/components/others/Hr/Hr/hr.svelte';
|
|
35
|
+
export { default as HrSplit } from './Core/components/others/Hr/HrSplit/hrsplit.svelte';
|
|
35
36
|
export { default as Checkbox } from './Core/components/Form/Checkbox/checkbox.svelte';
|
|
36
37
|
export { default as Form } from './Core/components/Form/Form/form.svelte';
|
|
38
|
+
export { default as Carousel } from './Core/components/others/Carousel/carousel.svelte';
|
|
37
39
|
export { default as GlobalSearch } from './Core/features/GlobalSearch/main.svelte';
|
|
38
40
|
export { default as Editor } from './Modules/Editor/main.svelte';
|
|
39
41
|
export { default as Layout } from './Modules/Layout/main.svelte';
|
package/dist/index.js
CHANGED
|
@@ -39,9 +39,11 @@ export { default as HamburgerMenu } from './Core/components/Menus/Hamburger/hamb
|
|
|
39
39
|
//others
|
|
40
40
|
export { default as Time } from './Core/components/others/Calender/Time/time.svelte';
|
|
41
41
|
export { default as Date } from './Core/components/others/Calender/Date/date.svelte';
|
|
42
|
-
export { default as Hr } from './Core/components/others/Hr/hr.svelte';
|
|
42
|
+
export { default as Hr } from './Core/components/others/Hr/Hr/hr.svelte';
|
|
43
|
+
export { default as HrSplit } from './Core/components/others/Hr/HrSplit/hrsplit.svelte';
|
|
43
44
|
export { default as Checkbox } from './Core/components/Form/Checkbox/checkbox.svelte';
|
|
44
45
|
export { default as Form } from './Core/components/Form/Form/form.svelte';
|
|
46
|
+
export { default as Carousel } from './Core/components/others/Carousel/carousel.svelte';
|
|
45
47
|
//####################Features##################################
|
|
46
48
|
export { default as GlobalSearch } from './Core/features/GlobalSearch/main.svelte';
|
|
47
49
|
//####################MODULES COMPONENTS########################
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|