nuxt-glorious 1.2.3-1 → 1.2.3-2
Sign up to get free protection for your applications and to get access to all the features.
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
@@ -0,0 +1,52 @@
|
|
1
|
+
/* From Uiverse.io by namecho */
|
2
|
+
.switch {
|
3
|
+
direction: ltr;
|
4
|
+
--button-width: 3.5em;
|
5
|
+
--button-height: 2em;
|
6
|
+
--toggle-diameter: 1.5em;
|
7
|
+
--button-toggle-offset: calc(
|
8
|
+
(var(--button-height) - var(--toggle-diameter)) / 2
|
9
|
+
);
|
10
|
+
--toggle-shadow-offset: 10px;
|
11
|
+
--toggle-wider: 3em;
|
12
|
+
--color-grey: #cccccc;
|
13
|
+
--color-green: #4296f4;
|
14
|
+
}
|
15
|
+
.switch-slider {
|
16
|
+
display: inline-block;
|
17
|
+
width: var(--button-width);
|
18
|
+
height: var(--button-height);
|
19
|
+
background-color: var(--color-grey);
|
20
|
+
border-radius: calc(var(--button-height) / 2);
|
21
|
+
position: relative;
|
22
|
+
transition: 0.3s all ease-in-out;
|
23
|
+
}
|
24
|
+
.switch-slider::after {
|
25
|
+
content: "";
|
26
|
+
display: inline-block;
|
27
|
+
width: var(--toggle-diameter);
|
28
|
+
height: var(--toggle-diameter);
|
29
|
+
background-color: #fff;
|
30
|
+
border-radius: calc(var(--toggle-diameter) / 2);
|
31
|
+
position: absolute;
|
32
|
+
top: var(--button-toggle-offset);
|
33
|
+
transform: translateX(var(--button-toggle-offset));
|
34
|
+
box-shadow: var(--toggle-shadow-offset) 0 calc(var(--toggle-shadow-offset) * 4) rgba(0, 0, 0, 0.1);
|
35
|
+
transition: 0.3s all ease-in-out;
|
36
|
+
}
|
37
|
+
.switch input[type=checkbox]:checked + .switch-slider {
|
38
|
+
background-color: var(--color-green);
|
39
|
+
}
|
40
|
+
.switch input[type=checkbox]:checked + .switch-slider::after {
|
41
|
+
transform: translateX(calc(var(--button-width) - var(--toggle-diameter) - var(--button-toggle-offset)));
|
42
|
+
box-shadow: calc(var(--toggle-shadow-offset) * -1) 0 calc(var(--toggle-shadow-offset) * 4) rgba(0, 0, 0, 0.1);
|
43
|
+
}
|
44
|
+
.switch input[type=checkbox] {
|
45
|
+
display: none;
|
46
|
+
}
|
47
|
+
.switch input[type=checkbox]:active + .switch-slider::after {
|
48
|
+
width: var(--toggle-wider);
|
49
|
+
}
|
50
|
+
.switch input[type=checkbox]:checked:active + .switch-slider::after {
|
51
|
+
transform: translateX(calc(var(--button-width) - var(--toggle-wider) - var(--button-toggle-offset)));
|
52
|
+
}
|
@@ -0,0 +1,88 @@
|
|
1
|
+
<script lang="ts" setup>
|
2
|
+
const props = defineProps({
|
3
|
+
modelValue: {
|
4
|
+
required: false,
|
5
|
+
default: true,
|
6
|
+
type: Boolean,
|
7
|
+
},
|
8
|
+
checked: {
|
9
|
+
required: false,
|
10
|
+
default: false,
|
11
|
+
type: Boolean,
|
12
|
+
},
|
13
|
+
})
|
14
|
+
|
15
|
+
const emits = defineEmits(['update:modelValue'])
|
16
|
+
const input = (e: Event) => {
|
17
|
+
const target = e.target as HTMLInputElement
|
18
|
+
emits('update:modelValue', target.checked)
|
19
|
+
}
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<template>
|
23
|
+
<div>
|
24
|
+
<label class="switch">
|
25
|
+
<input
|
26
|
+
type="checkbox"
|
27
|
+
@input="input"
|
28
|
+
:checked="props.checked"
|
29
|
+
/>
|
30
|
+
<span class="switch-slider"></span>
|
31
|
+
</label>
|
32
|
+
</div>
|
33
|
+
</template>
|
34
|
+
|
35
|
+
<style>
|
36
|
+
/* From Uiverse.io by namecho */
|
37
|
+
.switch {
|
38
|
+
direction: ltr;
|
39
|
+
--button-width: 3.5em;
|
40
|
+
--button-height: 2em;
|
41
|
+
--toggle-diameter: 1.5em;
|
42
|
+
--button-toggle-offset: calc(
|
43
|
+
(var(--button-height) - var(--toggle-diameter)) / 2
|
44
|
+
);
|
45
|
+
--toggle-shadow-offset: 10px;
|
46
|
+
--toggle-wider: 3em;
|
47
|
+
--color-grey: #cccccc;
|
48
|
+
--color-green: #4296f4;
|
49
|
+
}
|
50
|
+
.switch-slider {
|
51
|
+
display: inline-block;
|
52
|
+
width: var(--button-width);
|
53
|
+
height: var(--button-height);
|
54
|
+
background-color: var(--color-grey);
|
55
|
+
border-radius: calc(var(--button-height) / 2);
|
56
|
+
position: relative;
|
57
|
+
transition: 0.3s all ease-in-out;
|
58
|
+
}
|
59
|
+
.switch-slider::after {
|
60
|
+
content: "";
|
61
|
+
display: inline-block;
|
62
|
+
width: var(--toggle-diameter);
|
63
|
+
height: var(--toggle-diameter);
|
64
|
+
background-color: #fff;
|
65
|
+
border-radius: calc(var(--toggle-diameter) / 2);
|
66
|
+
position: absolute;
|
67
|
+
top: var(--button-toggle-offset);
|
68
|
+
transform: translateX(var(--button-toggle-offset));
|
69
|
+
box-shadow: var(--toggle-shadow-offset) 0 calc(var(--toggle-shadow-offset) * 4) rgba(0, 0, 0, 0.1);
|
70
|
+
transition: 0.3s all ease-in-out;
|
71
|
+
}
|
72
|
+
.switch input[type=checkbox]:checked + .switch-slider {
|
73
|
+
background-color: var(--color-green);
|
74
|
+
}
|
75
|
+
.switch input[type=checkbox]:checked + .switch-slider::after {
|
76
|
+
transform: translateX(calc(var(--button-width) - var(--toggle-diameter) - var(--button-toggle-offset)));
|
77
|
+
box-shadow: calc(var(--toggle-shadow-offset) * -1) 0 calc(var(--toggle-shadow-offset) * 4) rgba(0, 0, 0, 0.1);
|
78
|
+
}
|
79
|
+
.switch input[type=checkbox] {
|
80
|
+
display: none;
|
81
|
+
}
|
82
|
+
.switch input[type=checkbox]:active + .switch-slider::after {
|
83
|
+
width: var(--toggle-wider);
|
84
|
+
}
|
85
|
+
.switch input[type=checkbox]:checked:active + .switch-slider::after {
|
86
|
+
transform: translateX(calc(var(--button-width) - var(--toggle-wider) - var(--button-toggle-offset)));
|
87
|
+
}
|
88
|
+
</style>
|
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"version": "1.2.3-
|
2
|
+
"version": "1.2.3-2",
|
3
3
|
"name": "nuxt-glorious",
|
4
4
|
"description": "This package provides many things needed by a project, including server requests and authentication, SEO and other requirements of a project.",
|
5
5
|
"repository": "sajadhzj/nuxt-glorious",
|