@sierra-95/svelte-scaffold 1.0.9 → 1.0.10
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 +8 -8
- package/dist/Hooks/preview.d.ts +2 -1
- package/dist/Hooks/preview.js +4 -4
- package/dist/components/Core/Alerts/Backdrop/backdrop.svelte +26 -26
- package/dist/components/Core/Alerts/Modal/modal.svelte +40 -40
- package/dist/components/Core/Alerts/Toast/toast.css +38 -38
- package/dist/components/Core/Alerts/Toast/toast.svelte +32 -32
- package/dist/components/Core/Alerts/Wrapper/wrapper.svelte +18 -18
- package/dist/components/Core/Alerts/site-under-maintenance/site-under-maintenance.svelte +33 -33
- package/dist/components/Core/Form/Hr/hr.svelte +10 -10
- package/dist/components/Core/Form/Input/FileInput/fileInput.svelte +158 -158
- package/dist/components/Core/Form/Input/FileInput/preview.svelte +50 -50
- package/dist/components/Core/Form/Input/SearchBar/search.svelte +68 -68
- package/dist/components/Core/Form/Input/input/input.svelte +16 -16
- package/dist/components/Core/Form/Input/password/password.svelte +26 -26
- package/dist/components/Core/Menus/DropdownContainer/dropdown.svelte +94 -94
- package/dist/components/Core/Menus/MenuItem/menuItem.svelte +43 -43
- package/dist/components/Core/Menus/UserMenu/profile.svelte +34 -34
- package/dist/components/Core/others/Button/Flip/button.css +50 -50
- package/dist/components/Core/others/Button/Flip/button.svelte +79 -79
- package/dist/components/Core/others/Button/Marquee/button.css +36 -36
- package/dist/components/Core/others/Button/Marquee/button.svelte +58 -58
- package/dist/components/Core/others/Button/Swipe/button.css +32 -32
- package/dist/components/Core/others/Button/Swipe/button.svelte +57 -57
- package/dist/components/Core/others/Button/default/button.css +60 -60
- package/dist/components/Core/others/Button/default/button.svelte +124 -124
- package/dist/components/Core/others/Button/select/select.svelte +28 -28
- package/dist/components/Core/others/Button/theme/theme.css +121 -121
- package/dist/components/Core/others/Button/theme/theme.svelte +67 -67
- package/dist/components/Core/others/Button/times/times.svelte +24 -24
- package/dist/components/Core/others/Clock/Date/date.svelte +25 -25
- package/dist/components/Core/others/Clock/Time/time.svelte +35 -35
- package/dist/components/Core/others/Previews/Audio/audio.svelte +61 -61
- package/dist/components/Core/others/Previews/Document/documents.svelte +36 -36
- package/dist/components/Core/others/Previews/GenericFile/genericFile.svelte +25 -25
- package/dist/components/Core/others/Previews/Image/image.svelte +26 -26
- package/dist/components/Core/others/Previews/Video/video.svelte +28 -28
- package/dist/components/Core/others/Progress/CircularProgress/CircularProgress.svelte +55 -55
- package/dist/components/Core/others/Progress/CustomProgress/customProgress.svelte +64 -64
- package/dist/components/Core/others/Progress/LinearProgress/LinearProgress.css +60 -60
- package/dist/components/Core/others/Progress/LinearProgress/LinearProgress.svelte +86 -86
- package/dist/components/Modules/Editor/Hooks/extractContent.js +14 -14
- package/dist/components/Modules/Editor/Hooks/extractImage.js +30 -30
- package/dist/components/Modules/Editor/Hooks/insertImage.js +26 -26
- package/dist/components/Modules/Editor/Hooks/insertYoutube.js +34 -34
- package/dist/components/Modules/Editor/Marks/Links/links.svelte +78 -78
- package/dist/components/Modules/Editor/Marks/TextFormatting/textFormatting.svelte +32 -32
- package/dist/components/Modules/Editor/Nodes/Headings/heading.svelte +58 -58
- package/dist/components/Modules/Editor/Nodes/History/history.svelte +21 -21
- package/dist/components/Modules/Editor/Nodes/Images/images.svelte +85 -85
- package/dist/components/Modules/Editor/Nodes/Lists/lists.svelte +30 -30
- package/dist/components/Modules/Editor/Nodes/TextAlign/textAlign.svelte +55 -55
- package/dist/components/Modules/Editor/Nodes/TextColor/styles.css +18 -18
- package/dist/components/Modules/Editor/Nodes/TextColor/textColor.svelte +88 -88
- package/dist/components/Modules/Editor/Nodes/Youtube/youtube.svelte +32 -32
- package/dist/components/Modules/Editor/colors.js +21 -21
- package/dist/components/Modules/Editor/controls.svelte +71 -71
- package/dist/components/Modules/Editor/extensions.js +59 -59
- package/dist/components/Modules/Editor/main.svelte +41 -41
- package/dist/components/Modules/Editor/save.svelte +28 -28
- package/dist/components/Modules/Editor/styles/controls.css +68 -68
- package/dist/components/Modules/Editor/styles/main.css +42 -42
- package/dist/components/Modules/Editor/tools.js +22 -22
- package/dist/components/Modules/FilePicker/cloudStore.svelte +101 -98
- package/dist/components/Modules/FilePicker/controls.svelte +167 -141
- package/dist/components/Modules/FilePicker/controls.svelte.d.ts +4 -19
- package/dist/components/Modules/FilePicker/filePicker.svelte +59 -59
- package/dist/components/Modules/FilePicker/file_properties.svelte +33 -0
- package/dist/components/Modules/FilePicker/file_properties.svelte.d.ts +11 -0
- package/dist/components/Modules/FilePicker/previews.svelte +22 -22
- package/dist/components/Modules/Layout/Header/header.css +37 -37
- package/dist/components/Modules/Layout/Header/header.svelte +31 -31
- package/dist/components/Modules/Layout/Menu/menu.css +53 -53
- package/dist/components/Modules/Layout/Menu/menu.svelte +129 -129
- package/dist/components/Modules/Layout/background.svelte +28 -28
- package/dist/components/Modules/Layout/collapse.svelte +24 -24
- package/dist/components/Modules/Layout/main.css +31 -31
- package/dist/components/Modules/Layout/main.svelte +110 -110
- package/dist/global.css +246 -246
- package/dist/index.d.ts +1 -0
- package/dist/stores/core/general.js +4 -4
- package/dist/stores/core/ismobile.js +14 -14
- package/dist/stores/core/modal.js +35 -35
- package/dist/stores/modules/fileInput.d.ts +11 -4
- package/dist/stores/modules/fileInput.js +1 -1
- package/package.json +75 -75
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { browser } from '$app/environment';
|
|
3
|
-
import { onMount, onDestroy } from 'svelte';
|
|
4
|
-
import { scale } from 'svelte/transition';
|
|
5
|
-
import { quintOut } from 'svelte/easing';
|
|
6
|
-
|
|
7
|
-
let {
|
|
8
|
-
top = '130%',
|
|
9
|
-
width = 'auto',
|
|
10
|
-
open = $bindable(true),
|
|
11
|
-
dropdownTrigger = null,
|
|
12
|
-
children = null,
|
|
13
|
-
} = $props();
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
let dropdown = $state<HTMLElement | null>(null);
|
|
17
|
-
let dropdownStyle = $state({ left: '0', right: 'auto' });
|
|
18
|
-
|
|
19
|
-
const adjustDropdownPosition = () => {
|
|
20
|
-
if (!container || !dropdown) return;
|
|
21
|
-
const rect = container.getBoundingClientRect();
|
|
22
|
-
const dropdownWidth = dropdown.offsetWidth;
|
|
23
|
-
const viewportWidth = window.innerWidth;
|
|
24
|
-
|
|
25
|
-
// Check if dropdown would overflow right
|
|
26
|
-
if (rect.left + dropdownWidth > viewportWidth) {
|
|
27
|
-
dropdownStyle = { left: 'auto', right: '0' };
|
|
28
|
-
} else {
|
|
29
|
-
dropdownStyle = { left: '0', right: 'auto' };
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
$effect(() => {
|
|
34
|
-
if (open) {
|
|
35
|
-
adjustDropdownPosition();
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
// Close dropdown on outside click
|
|
40
|
-
let container = $state<HTMLElement | null>(null);
|
|
41
|
-
|
|
42
|
-
const handleClose = () => {
|
|
43
|
-
open = false;
|
|
44
|
-
};
|
|
45
|
-
const handleDocumentClick = (event: MouseEvent) => {
|
|
46
|
-
if (open && container && !container.contains(event.target as Node)) {
|
|
47
|
-
handleClose();
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
if (browser) {
|
|
51
|
-
onMount(() => {
|
|
52
|
-
document.addEventListener('
|
|
53
|
-
});
|
|
54
|
-
onDestroy(() => {
|
|
55
|
-
document.removeEventListener('
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
</script>
|
|
59
|
-
|
|
60
|
-
<style>
|
|
61
|
-
#sierra-dropdown {
|
|
62
|
-
position: relative;
|
|
63
|
-
}
|
|
64
|
-
#sierra-dropdown .dropdown-paper {
|
|
65
|
-
position: absolute;
|
|
66
|
-
background-color: var(--background-secondary);
|
|
67
|
-
border-radius: 5px;
|
|
68
|
-
box-shadow: var(--box-shadow);
|
|
69
|
-
min-width: 5px;
|
|
70
|
-
min-height: 5px;
|
|
71
|
-
z-index: 5;
|
|
72
|
-
}
|
|
73
|
-
</style>
|
|
74
|
-
|
|
75
|
-
<main id="sierra-dropdown" bind:this={container}>
|
|
76
|
-
{@render dropdownTrigger?.()}
|
|
77
|
-
{#if open}
|
|
78
|
-
<div
|
|
79
|
-
bind:this={dropdown}
|
|
80
|
-
class="dropdown-paper"
|
|
81
|
-
transition:scale={{
|
|
82
|
-
start: 0.9,
|
|
83
|
-
duration: 180,
|
|
84
|
-
easing: quintOut,
|
|
85
|
-
opacity: 0
|
|
86
|
-
}}
|
|
87
|
-
style="
|
|
88
|
-
transform-origin: top; top: {top}; width: {width};
|
|
89
|
-
left: {dropdownStyle.left}; right: {dropdownStyle.right};
|
|
90
|
-
"
|
|
91
|
-
>{@render children?.()}
|
|
92
|
-
</div>
|
|
93
|
-
{/if}
|
|
94
|
-
</main>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { browser } from '$app/environment';
|
|
3
|
+
import { onMount, onDestroy } from 'svelte';
|
|
4
|
+
import { scale } from 'svelte/transition';
|
|
5
|
+
import { quintOut } from 'svelte/easing';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
top = '130%',
|
|
9
|
+
width = 'auto',
|
|
10
|
+
open = $bindable(true),
|
|
11
|
+
dropdownTrigger = null,
|
|
12
|
+
children = null,
|
|
13
|
+
} = $props();
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
let dropdown = $state<HTMLElement | null>(null);
|
|
17
|
+
let dropdownStyle = $state({ left: '0', right: 'auto' });
|
|
18
|
+
|
|
19
|
+
const adjustDropdownPosition = () => {
|
|
20
|
+
if (!container || !dropdown) return;
|
|
21
|
+
const rect = container.getBoundingClientRect();
|
|
22
|
+
const dropdownWidth = dropdown.offsetWidth;
|
|
23
|
+
const viewportWidth = window.innerWidth;
|
|
24
|
+
|
|
25
|
+
// Check if dropdown would overflow right
|
|
26
|
+
if (rect.left + dropdownWidth > viewportWidth) {
|
|
27
|
+
dropdownStyle = { left: 'auto', right: '0' };
|
|
28
|
+
} else {
|
|
29
|
+
dropdownStyle = { left: '0', right: 'auto' };
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
$effect(() => {
|
|
34
|
+
if (open) {
|
|
35
|
+
adjustDropdownPosition();
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// Close dropdown on outside click
|
|
40
|
+
let container = $state<HTMLElement | null>(null);
|
|
41
|
+
|
|
42
|
+
const handleClose = () => {
|
|
43
|
+
open = false;
|
|
44
|
+
};
|
|
45
|
+
const handleDocumentClick = (event: MouseEvent) => {
|
|
46
|
+
if (open && container && !container.contains(event.target as Node)) {
|
|
47
|
+
handleClose();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
if (browser) {
|
|
51
|
+
onMount(() => {
|
|
52
|
+
document.addEventListener('pointerdown', handleDocumentClick, true);
|
|
53
|
+
});
|
|
54
|
+
onDestroy(() => {
|
|
55
|
+
document.removeEventListener('pointerdown', handleDocumentClick, true);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<style>
|
|
61
|
+
#sierra-dropdown {
|
|
62
|
+
position: relative;
|
|
63
|
+
}
|
|
64
|
+
#sierra-dropdown .dropdown-paper {
|
|
65
|
+
position: absolute;
|
|
66
|
+
background-color: var(--background-secondary);
|
|
67
|
+
border-radius: 5px;
|
|
68
|
+
box-shadow: var(--box-shadow);
|
|
69
|
+
min-width: 5px;
|
|
70
|
+
min-height: 5px;
|
|
71
|
+
z-index: 5;
|
|
72
|
+
}
|
|
73
|
+
</style>
|
|
74
|
+
|
|
75
|
+
<main id="sierra-dropdown" bind:this={container}>
|
|
76
|
+
{@render dropdownTrigger?.()}
|
|
77
|
+
{#if open}
|
|
78
|
+
<div
|
|
79
|
+
bind:this={dropdown}
|
|
80
|
+
class="dropdown-paper"
|
|
81
|
+
transition:scale={{
|
|
82
|
+
start: 0.9,
|
|
83
|
+
duration: 180,
|
|
84
|
+
easing: quintOut,
|
|
85
|
+
opacity: 0
|
|
86
|
+
}}
|
|
87
|
+
style="
|
|
88
|
+
transform-origin: top; top: {top}; width: {width};
|
|
89
|
+
left: {dropdownStyle.left}; right: {dropdownStyle.right};
|
|
90
|
+
"
|
|
91
|
+
>{@render children?.()}
|
|
92
|
+
</div>
|
|
93
|
+
{/if}
|
|
94
|
+
</main>
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
const {
|
|
3
|
-
icon = '',
|
|
4
|
-
active = false,
|
|
5
|
-
disabled = false,
|
|
6
|
-
iconSize = '20px',
|
|
7
|
-
iconBg: iconBg = 'var(--primary-bg)',
|
|
8
|
-
children = null,
|
|
9
|
-
...rest
|
|
10
|
-
} = $props();
|
|
11
|
-
</script>
|
|
12
|
-
<style>
|
|
13
|
-
#sierra-menu-item {
|
|
14
|
-
display: flex;
|
|
15
|
-
align-items: center;
|
|
16
|
-
padding: 10px 16px;
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
transition: background-color 0.2s ease;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
#sierra-menu-item:hover {
|
|
22
|
-
background-color: var(--menu-item-hover);
|
|
23
|
-
}
|
|
24
|
-
#sierra-menu-item.disabled {
|
|
25
|
-
cursor: not-allowed;
|
|
26
|
-
opacity: 0.6;
|
|
27
|
-
}
|
|
28
|
-
</style>
|
|
29
|
-
<div
|
|
30
|
-
id="sierra-menu-item"
|
|
31
|
-
role="none"
|
|
32
|
-
style="background-color: {active ? 'var(--menu-item-active)' : ''}"
|
|
33
|
-
class="{disabled? 'disabled':''}"
|
|
34
|
-
{...rest}
|
|
35
|
-
onclick={(e: MouseEvent) => {
|
|
36
|
-
rest.onclick?.(e);
|
|
37
|
-
}}
|
|
38
|
-
>
|
|
39
|
-
{#if icon}
|
|
40
|
-
<i style="font-size: {iconSize}; color: {iconBg}"
|
|
41
|
-
class="fa {icon}"></i>
|
|
42
|
-
{/if}
|
|
43
|
-
<h4 style="margin-left: {icon ? '20px' : '0'};">{@render children?.()}</h4>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
const {
|
|
3
|
+
icon = '',
|
|
4
|
+
active = false,
|
|
5
|
+
disabled = false,
|
|
6
|
+
iconSize = '20px',
|
|
7
|
+
iconBg: iconBg = 'var(--primary-bg)',
|
|
8
|
+
children = null,
|
|
9
|
+
...rest
|
|
10
|
+
} = $props();
|
|
11
|
+
</script>
|
|
12
|
+
<style>
|
|
13
|
+
#sierra-menu-item {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
padding: 10px 16px;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
transition: background-color 0.2s ease;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
#sierra-menu-item:hover {
|
|
22
|
+
background-color: var(--menu-item-hover);
|
|
23
|
+
}
|
|
24
|
+
#sierra-menu-item.disabled {
|
|
25
|
+
cursor: not-allowed;
|
|
26
|
+
opacity: 0.6;
|
|
27
|
+
}
|
|
28
|
+
</style>
|
|
29
|
+
<div
|
|
30
|
+
id="sierra-menu-item"
|
|
31
|
+
role="none"
|
|
32
|
+
style="background-color: {active ? 'var(--menu-item-active)' : ''}"
|
|
33
|
+
class="{disabled? 'disabled':''}"
|
|
34
|
+
{...rest}
|
|
35
|
+
onclick={(e: MouseEvent) => {
|
|
36
|
+
rest.onclick?.(e);
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
{#if icon}
|
|
40
|
+
<i style="font-size: {iconSize}; color: {iconBg}"
|
|
41
|
+
class="fa {icon}"></i>
|
|
42
|
+
{/if}
|
|
43
|
+
<h4 style="margin-left: {icon ? '20px' : '0'};">{@render children?.()}</h4>
|
|
44
44
|
</div>
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import {DropdownContainer} from '../../../../index.js';
|
|
3
|
-
|
|
4
|
-
let {
|
|
5
|
-
top = '150%',
|
|
6
|
-
width = '300px',
|
|
7
|
-
iconSize = '30px',
|
|
8
|
-
iconBg = 'var(--primary-bg)',
|
|
9
|
-
user = $bindable({}),
|
|
10
|
-
open = $bindable(false),
|
|
11
|
-
children = null,
|
|
12
|
-
} = $props();
|
|
13
|
-
|
|
14
|
-
const handleClick = () => {
|
|
15
|
-
open = !open;
|
|
16
|
-
};
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<DropdownContainer bind:open {top} {width}>
|
|
20
|
-
{#snippet dropdownTrigger()}
|
|
21
|
-
<button aria-label="none" onclick={handleClick}>
|
|
22
|
-
<i style="font-size: {iconSize}; color: {iconBg}" class="fa-solid fa-user"></i>
|
|
23
|
-
</button>
|
|
24
|
-
{/snippet}
|
|
25
|
-
<div style="padding:15px; border-bottom:1px solid var(--border);">
|
|
26
|
-
{#if Object.keys(user).length > 0}
|
|
27
|
-
{#each Object.entries(user) as [key, value], i}
|
|
28
|
-
<p>{value}</p>
|
|
29
|
-
{/each}
|
|
30
|
-
{:else}
|
|
31
|
-
<p>No user info</p>
|
|
32
|
-
{/if}
|
|
33
|
-
</div>
|
|
34
|
-
{@render children?.()}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {DropdownContainer} from '../../../../index.js';
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
top = '150%',
|
|
6
|
+
width = '300px',
|
|
7
|
+
iconSize = '30px',
|
|
8
|
+
iconBg = 'var(--primary-bg)',
|
|
9
|
+
user = $bindable({}),
|
|
10
|
+
open = $bindable(false),
|
|
11
|
+
children = null,
|
|
12
|
+
} = $props();
|
|
13
|
+
|
|
14
|
+
const handleClick = () => {
|
|
15
|
+
open = !open;
|
|
16
|
+
};
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<DropdownContainer bind:open {top} {width}>
|
|
20
|
+
{#snippet dropdownTrigger()}
|
|
21
|
+
<button aria-label="none" onclick={handleClick}>
|
|
22
|
+
<i style="font-size: {iconSize}; color: {iconBg}" class="fa-solid fa-user"></i>
|
|
23
|
+
</button>
|
|
24
|
+
{/snippet}
|
|
25
|
+
<div style="padding:15px; border-bottom:1px solid var(--border);">
|
|
26
|
+
{#if Object.keys(user).length > 0}
|
|
27
|
+
{#each Object.entries(user) as [key, value], i}
|
|
28
|
+
<p>{value}</p>
|
|
29
|
+
{/each}
|
|
30
|
+
{:else}
|
|
31
|
+
<p>No user info</p>
|
|
32
|
+
{/if}
|
|
33
|
+
</div>
|
|
34
|
+
{@render children?.()}
|
|
35
35
|
</DropdownContainer>
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
.btn-flip {
|
|
2
|
-
position: relative;
|
|
3
|
-
display: inline-block;
|
|
4
|
-
width: 150px; /* you can fix width if needed */
|
|
5
|
-
height: 40px;
|
|
6
|
-
text-align: center;
|
|
7
|
-
perspective: 1000px;
|
|
8
|
-
color: var(--text-color);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.btn-flip::before,
|
|
12
|
-
.btn-flip::after {
|
|
13
|
-
content: attr(data-front);
|
|
14
|
-
position: absolute;
|
|
15
|
-
top: 0;
|
|
16
|
-
left: 0;
|
|
17
|
-
width: 100%;
|
|
18
|
-
height: 100%;
|
|
19
|
-
display: flex;
|
|
20
|
-
align-items: center;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
padding: 0 30px;
|
|
23
|
-
line-height: 40px;
|
|
24
|
-
transition: 0.5s;
|
|
25
|
-
backface-visibility: hidden;
|
|
26
|
-
box-sizing: border-box;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.btn-flip::before {
|
|
30
|
-
content: attr(data-front);
|
|
31
|
-
background: var(--bg-front);
|
|
32
|
-
transform: translateY(0) rotateX(0);
|
|
33
|
-
opacity: 1;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.btn-flip::after {
|
|
37
|
-
content: attr(data-back);
|
|
38
|
-
background: var(--bg-back);
|
|
39
|
-
transform: translateY(-50%) rotateX(90deg);
|
|
40
|
-
opacity: 0;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.btn-flip:hover::before {
|
|
44
|
-
opacity: 0;
|
|
45
|
-
transform: translateY(50%) rotateX(90deg);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.btn-flip:hover::after {
|
|
49
|
-
opacity: 1;
|
|
50
|
-
transform: translateY(0) rotateX(0);
|
|
1
|
+
.btn-flip {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-block;
|
|
4
|
+
width: 150px; /* you can fix width if needed */
|
|
5
|
+
height: 40px;
|
|
6
|
+
text-align: center;
|
|
7
|
+
perspective: 1000px;
|
|
8
|
+
color: var(--text-color);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.btn-flip::before,
|
|
12
|
+
.btn-flip::after {
|
|
13
|
+
content: attr(data-front);
|
|
14
|
+
position: absolute;
|
|
15
|
+
top: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
padding: 0 30px;
|
|
23
|
+
line-height: 40px;
|
|
24
|
+
transition: 0.5s;
|
|
25
|
+
backface-visibility: hidden;
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.btn-flip::before {
|
|
30
|
+
content: attr(data-front);
|
|
31
|
+
background: var(--bg-front);
|
|
32
|
+
transform: translateY(0) rotateX(0);
|
|
33
|
+
opacity: 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.btn-flip::after {
|
|
37
|
+
content: attr(data-back);
|
|
38
|
+
background: var(--bg-back);
|
|
39
|
+
transform: translateY(-50%) rotateX(90deg);
|
|
40
|
+
opacity: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.btn-flip:hover::before {
|
|
44
|
+
opacity: 0;
|
|
45
|
+
transform: translateY(50%) rotateX(90deg);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.btn-flip:hover::after {
|
|
49
|
+
opacity: 1;
|
|
50
|
+
transform: translateY(0) rotateX(0);
|
|
51
51
|
}
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
type _buttonType = 'button' | 'submit' | 'reset';
|
|
3
|
-
const {
|
|
4
|
-
back = "back",
|
|
5
|
-
front = "front",
|
|
6
|
-
bgFront = "var(--primary-bg)",
|
|
7
|
-
bgBack = "var(--primary-bg)",
|
|
8
|
-
color = "var(--button-text)",
|
|
9
|
-
title = "",
|
|
10
|
-
type = 'button' as _buttonType,
|
|
11
|
-
disabled = false,
|
|
12
|
-
...rest
|
|
13
|
-
} = $props();
|
|
14
|
-
</script>
|
|
15
|
-
<button
|
|
16
|
-
type={type}
|
|
17
|
-
title={title}
|
|
18
|
-
disabled={disabled}
|
|
19
|
-
aria-label="Flip button"
|
|
20
|
-
class="btn-flip"
|
|
21
|
-
data-back={back}
|
|
22
|
-
data-front={front}
|
|
23
|
-
style="--bg-front: {bgFront}; --bg-back: {bgBack}; --text-color: {color}"
|
|
24
|
-
onclick={(e: MouseEvent) => {
|
|
25
|
-
rest.onclick?.(e);
|
|
26
|
-
}}
|
|
27
|
-
></button>
|
|
28
|
-
<style>.btn-flip {
|
|
29
|
-
position: relative;
|
|
30
|
-
display: inline-block;
|
|
31
|
-
width: 150px; /* you can fix width if needed */
|
|
32
|
-
height: 40px;
|
|
33
|
-
text-align: center;
|
|
34
|
-
perspective: 1000px;
|
|
35
|
-
color: var(--text-color);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.btn-flip::before,
|
|
39
|
-
.btn-flip::after {
|
|
40
|
-
content: attr(data-front);
|
|
41
|
-
position: absolute;
|
|
42
|
-
top: 0;
|
|
43
|
-
left: 0;
|
|
44
|
-
width: 100%;
|
|
45
|
-
height: 100%;
|
|
46
|
-
display: flex;
|
|
47
|
-
align-items: center;
|
|
48
|
-
justify-content: center;
|
|
49
|
-
padding: 0 30px;
|
|
50
|
-
line-height: 40px;
|
|
51
|
-
transition: 0.5s;
|
|
52
|
-
backface-visibility: hidden;
|
|
53
|
-
box-sizing: border-box;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.btn-flip::before {
|
|
57
|
-
content: attr(data-front);
|
|
58
|
-
background: var(--bg-front);
|
|
59
|
-
transform: translateY(0) rotateX(0);
|
|
60
|
-
opacity: 1;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.btn-flip::after {
|
|
64
|
-
content: attr(data-back);
|
|
65
|
-
background: var(--bg-back);
|
|
66
|
-
transform: translateY(-50%) rotateX(90deg);
|
|
67
|
-
opacity: 0;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.btn-flip:hover::before {
|
|
71
|
-
opacity: 0;
|
|
72
|
-
transform: translateY(50%) rotateX(90deg);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.btn-flip:hover::after {
|
|
76
|
-
opacity: 1;
|
|
77
|
-
transform: translateY(0) rotateX(0);
|
|
78
|
-
}
|
|
79
|
-
</style>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
type _buttonType = 'button' | 'submit' | 'reset';
|
|
3
|
+
const {
|
|
4
|
+
back = "back",
|
|
5
|
+
front = "front",
|
|
6
|
+
bgFront = "var(--primary-bg)",
|
|
7
|
+
bgBack = "var(--primary-bg)",
|
|
8
|
+
color = "var(--button-text)",
|
|
9
|
+
title = "",
|
|
10
|
+
type = 'button' as _buttonType,
|
|
11
|
+
disabled = false,
|
|
12
|
+
...rest
|
|
13
|
+
} = $props();
|
|
14
|
+
</script>
|
|
15
|
+
<button
|
|
16
|
+
type={type}
|
|
17
|
+
title={title}
|
|
18
|
+
disabled={disabled}
|
|
19
|
+
aria-label="Flip button"
|
|
20
|
+
class="btn-flip"
|
|
21
|
+
data-back={back}
|
|
22
|
+
data-front={front}
|
|
23
|
+
style="--bg-front: {bgFront}; --bg-back: {bgBack}; --text-color: {color}"
|
|
24
|
+
onclick={(e: MouseEvent) => {
|
|
25
|
+
rest.onclick?.(e);
|
|
26
|
+
}}
|
|
27
|
+
></button>
|
|
28
|
+
<style>.btn-flip {
|
|
29
|
+
position: relative;
|
|
30
|
+
display: inline-block;
|
|
31
|
+
width: 150px; /* you can fix width if needed */
|
|
32
|
+
height: 40px;
|
|
33
|
+
text-align: center;
|
|
34
|
+
perspective: 1000px;
|
|
35
|
+
color: var(--text-color);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.btn-flip::before,
|
|
39
|
+
.btn-flip::after {
|
|
40
|
+
content: attr(data-front);
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 0;
|
|
43
|
+
left: 0;
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
padding: 0 30px;
|
|
50
|
+
line-height: 40px;
|
|
51
|
+
transition: 0.5s;
|
|
52
|
+
backface-visibility: hidden;
|
|
53
|
+
box-sizing: border-box;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.btn-flip::before {
|
|
57
|
+
content: attr(data-front);
|
|
58
|
+
background: var(--bg-front);
|
|
59
|
+
transform: translateY(0) rotateX(0);
|
|
60
|
+
opacity: 1;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.btn-flip::after {
|
|
64
|
+
content: attr(data-back);
|
|
65
|
+
background: var(--bg-back);
|
|
66
|
+
transform: translateY(-50%) rotateX(90deg);
|
|
67
|
+
opacity: 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.btn-flip:hover::before {
|
|
71
|
+
opacity: 0;
|
|
72
|
+
transform: translateY(50%) rotateX(90deg);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.btn-flip:hover::after {
|
|
76
|
+
opacity: 1;
|
|
77
|
+
transform: translateY(0) rotateX(0);
|
|
78
|
+
}
|
|
79
|
+
</style>
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
.marquee-container {
|
|
2
|
-
overflow: hidden;
|
|
3
|
-
white-space: nowrap;
|
|
4
|
-
position: relative;
|
|
5
|
-
font-size: 1rem;
|
|
6
|
-
padding: 0.2rem 10px;
|
|
7
|
-
cursor: pointer;
|
|
8
|
-
border: 1px solid var(--border-color);
|
|
9
|
-
color: var(--text-color);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.marquee {
|
|
13
|
-
display: inline-block;
|
|
14
|
-
white-space: nowrap;
|
|
15
|
-
transition: none;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/* scrolling animation only active when hovered */
|
|
19
|
-
.scrolling {
|
|
20
|
-
animation: scroll 2s linear infinite;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@keyframes scroll {
|
|
24
|
-
0% {
|
|
25
|
-
transform: translateX(0%);
|
|
26
|
-
}
|
|
27
|
-
100% {
|
|
28
|
-
transform: translateX(-66.66%);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
.marquee:not(.scrolling) span:not(:first-child) {
|
|
32
|
-
visibility: hidden;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.marquee span {
|
|
36
|
-
margin-right: 2rem;
|
|
1
|
+
.marquee-container {
|
|
2
|
+
overflow: hidden;
|
|
3
|
+
white-space: nowrap;
|
|
4
|
+
position: relative;
|
|
5
|
+
font-size: 1rem;
|
|
6
|
+
padding: 0.2rem 10px;
|
|
7
|
+
cursor: pointer;
|
|
8
|
+
border: 1px solid var(--border-color);
|
|
9
|
+
color: var(--text-color);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.marquee {
|
|
13
|
+
display: inline-block;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
transition: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* scrolling animation only active when hovered */
|
|
19
|
+
.scrolling {
|
|
20
|
+
animation: scroll 2s linear infinite;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@keyframes scroll {
|
|
24
|
+
0% {
|
|
25
|
+
transform: translateX(0%);
|
|
26
|
+
}
|
|
27
|
+
100% {
|
|
28
|
+
transform: translateX(-66.66%);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
.marquee:not(.scrolling) span:not(:first-child) {
|
|
32
|
+
visibility: hidden;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.marquee span {
|
|
36
|
+
margin-right: 2rem;
|
|
37
37
|
}
|