nuxt-glorious 1.2.3-2 → 1.2.3-3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/module.json +1 -1
- package/dist/runtime/assets/icons/glorious-star-fill.svg +3 -0
- package/dist/runtime/assets/icons/glorious-star-half.svg +3 -0
- package/dist/runtime/assets/icons/glorious-star-line.svg +3 -0
- package/dist/runtime/assets/style/components/rating.css +26 -0
- package/dist/runtime/assets/style/components/switch.css +18 -9
- package/dist/runtime/components/G/Rating.vue +57 -0
- package/dist/runtime/components/G/Switch.vue +27 -10
- package/package.json +1 -1
package/dist/module.json
CHANGED
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg width="20" height="19" viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M9.99999 12.656L12.817 14.376L12.051 11.166L14.558 9.019L11.268 8.755L9.99999 5.708V12.656ZM9.99999 15L4.12199 18.59L5.71999 11.89L0.48999 7.41L7.35499 6.86L9.99999 0.5L12.645 6.86L19.511 7.41L14.28 11.89L15.878 18.59L9.99999 15Z" fill="black"/>
|
3
|
+
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg width="24" height="23" viewBox="0 0 24 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M11.9999 18.26L4.94691 22.208L6.52191 14.28L0.586914 8.792L8.61391 7.84L11.9999 0.5L15.3859 7.84L23.4129 8.792L17.4779 14.28L19.0529 22.208L11.9999 18.26ZM11.9999 15.968L16.2469 18.345L15.2979 13.572L18.8709 10.267L14.0379 9.694L11.9999 5.275L9.96191 9.695L5.12891 10.267L8.70191 13.572L7.75291 18.345L11.9999 15.968Z" fill="black"/>
|
3
|
+
</svg>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
.rating {
|
3
|
+
display: inline-block;
|
4
|
+
}
|
5
|
+
|
6
|
+
.rating input {
|
7
|
+
display: none;
|
8
|
+
}
|
9
|
+
|
10
|
+
.rating label {
|
11
|
+
float: right;
|
12
|
+
cursor: pointer;
|
13
|
+
transition: color 0.3s;
|
14
|
+
}
|
15
|
+
|
16
|
+
.rating label:before {
|
17
|
+
content: "★";
|
18
|
+
font-size: 30px;
|
19
|
+
}
|
20
|
+
|
21
|
+
.rating input:checked ~ label,
|
22
|
+
.rating label:hover,
|
23
|
+
.rating label:hover ~ label {
|
24
|
+
color: #ffd700;
|
25
|
+
transition: color 0.3s;
|
26
|
+
}
|
@@ -1,22 +1,19 @@
|
|
1
|
-
/* From Uiverse.io by namecho */
|
2
1
|
.switch {
|
3
2
|
direction: ltr;
|
4
|
-
--button-width:
|
5
|
-
--button-height:
|
6
|
-
--toggle-diameter:
|
3
|
+
--button-width: 3em;
|
4
|
+
--button-height: 1.5em;
|
5
|
+
--toggle-diameter: 1em;
|
7
6
|
--button-toggle-offset: calc(
|
8
7
|
(var(--button-height) - var(--toggle-diameter)) / 2
|
9
8
|
);
|
10
9
|
--toggle-shadow-offset: 10px;
|
11
10
|
--toggle-wider: 3em;
|
12
|
-
--color-grey: #cccccc;
|
13
|
-
--color-green: #4296f4;
|
14
11
|
}
|
15
12
|
.switch-slider {
|
13
|
+
@apply bg-gray-300;
|
16
14
|
display: inline-block;
|
17
15
|
width: var(--button-width);
|
18
16
|
height: var(--button-height);
|
19
|
-
background-color: var(--color-grey);
|
20
17
|
border-radius: calc(var(--button-height) / 2);
|
21
18
|
position: relative;
|
22
19
|
transition: 0.3s all ease-in-out;
|
@@ -34,8 +31,20 @@
|
|
34
31
|
box-shadow: var(--toggle-shadow-offset) 0 calc(var(--toggle-shadow-offset) * 4) rgba(0, 0, 0, 0.1);
|
35
32
|
transition: 0.3s all ease-in-out;
|
36
33
|
}
|
37
|
-
.switch input[type=checkbox]:checked + .switch-slider {
|
38
|
-
background-color:
|
34
|
+
.switch.color-orange input[type=checkbox]:checked + .switch-slider {
|
35
|
+
background-color: theme("colors.orange.500");
|
36
|
+
}
|
37
|
+
.switch.color-blue input[type=checkbox]:checked + .switch-slider {
|
38
|
+
background-color: theme("colors.blue.500");
|
39
|
+
}
|
40
|
+
.switch.color-gray input[type=checkbox]:checked + .switch-slider {
|
41
|
+
background-color: theme("colors.gray.500");
|
42
|
+
}
|
43
|
+
.switch.color-red input[type=checkbox]:checked + .switch-slider {
|
44
|
+
background-color: theme("colors.red.500");
|
45
|
+
}
|
46
|
+
.switch.color-green input[type=checkbox]:checked + .switch-slider {
|
47
|
+
background-color: theme("colors.green.500");
|
39
48
|
}
|
40
49
|
.switch input[type=checkbox]:checked + .switch-slider::after {
|
41
50
|
transform: translateX(calc(var(--button-width) - var(--toggle-diameter) - var(--button-toggle-offset)));
|
@@ -0,0 +1,57 @@
|
|
1
|
+
<script lang="ts" setup>
|
2
|
+
const emits = defineEmits(['update:modelValue'])
|
3
|
+
const computeModelValue = (event: Event) => {
|
4
|
+
const target = event.target as HTMLInputElement
|
5
|
+
emits('update:modelValue', target.value)
|
6
|
+
}
|
7
|
+
|
8
|
+
const id = useId()
|
9
|
+
const value = [5, 4, 3, 2, 1]
|
10
|
+
</script>
|
11
|
+
|
12
|
+
<template>
|
13
|
+
<div class="rating">
|
14
|
+
<template
|
15
|
+
v-for="(item, index) in 5"
|
16
|
+
:key="index"
|
17
|
+
>
|
18
|
+
<input
|
19
|
+
type="radio"
|
20
|
+
:id="`star${item}-${id}`"
|
21
|
+
:name="`star-name${id}`"
|
22
|
+
:value="value[index]"
|
23
|
+
@input="computeModelValue"
|
24
|
+
/>
|
25
|
+
<label :for="`star${item}-${id}`"></label>
|
26
|
+
</template>
|
27
|
+
</div>
|
28
|
+
</template>
|
29
|
+
|
30
|
+
<style scoped>
|
31
|
+
@charset "UTF-8";
|
32
|
+
.rating {
|
33
|
+
display: inline-block;
|
34
|
+
}
|
35
|
+
|
36
|
+
.rating input {
|
37
|
+
display: none;
|
38
|
+
}
|
39
|
+
|
40
|
+
.rating label {
|
41
|
+
float: right;
|
42
|
+
cursor: pointer;
|
43
|
+
transition: color 0.3s;
|
44
|
+
}
|
45
|
+
|
46
|
+
.rating label:before {
|
47
|
+
content: "★";
|
48
|
+
font-size: 30px;
|
49
|
+
}
|
50
|
+
|
51
|
+
.rating input:checked ~ label,
|
52
|
+
.rating label:hover,
|
53
|
+
.rating label:hover ~ label {
|
54
|
+
color: #ffd700;
|
55
|
+
transition: color 0.3s;
|
56
|
+
}
|
57
|
+
</style>
|
@@ -10,6 +10,11 @@ const props = defineProps({
|
|
10
10
|
default: false,
|
11
11
|
type: Boolean,
|
12
12
|
},
|
13
|
+
color: {
|
14
|
+
required: false,
|
15
|
+
default: 'green',
|
16
|
+
type: String as () => 'orange' | 'blue' | 'gray' | 'red' | 'green',
|
17
|
+
},
|
13
18
|
})
|
14
19
|
|
15
20
|
const emits = defineEmits(['update:modelValue'])
|
@@ -21,7 +26,10 @@ const input = (e: Event) => {
|
|
21
26
|
|
22
27
|
<template>
|
23
28
|
<div>
|
24
|
-
<label
|
29
|
+
<label
|
30
|
+
class="switch"
|
31
|
+
:class="[`color-${props.color}`]"
|
32
|
+
>
|
25
33
|
<input
|
26
34
|
type="checkbox"
|
27
35
|
@input="input"
|
@@ -33,25 +41,22 @@ const input = (e: Event) => {
|
|
33
41
|
</template>
|
34
42
|
|
35
43
|
<style>
|
36
|
-
/* From Uiverse.io by namecho */
|
37
44
|
.switch {
|
38
45
|
direction: ltr;
|
39
|
-
--button-width:
|
40
|
-
--button-height:
|
41
|
-
--toggle-diameter:
|
46
|
+
--button-width: 3em;
|
47
|
+
--button-height: 1.5em;
|
48
|
+
--toggle-diameter: 1em;
|
42
49
|
--button-toggle-offset: calc(
|
43
50
|
(var(--button-height) - var(--toggle-diameter)) / 2
|
44
51
|
);
|
45
52
|
--toggle-shadow-offset: 10px;
|
46
53
|
--toggle-wider: 3em;
|
47
|
-
--color-grey: #cccccc;
|
48
|
-
--color-green: #4296f4;
|
49
54
|
}
|
50
55
|
.switch-slider {
|
56
|
+
@apply bg-gray-300;
|
51
57
|
display: inline-block;
|
52
58
|
width: var(--button-width);
|
53
59
|
height: var(--button-height);
|
54
|
-
background-color: var(--color-grey);
|
55
60
|
border-radius: calc(var(--button-height) / 2);
|
56
61
|
position: relative;
|
57
62
|
transition: 0.3s all ease-in-out;
|
@@ -69,8 +74,20 @@ const input = (e: Event) => {
|
|
69
74
|
box-shadow: var(--toggle-shadow-offset) 0 calc(var(--toggle-shadow-offset) * 4) rgba(0, 0, 0, 0.1);
|
70
75
|
transition: 0.3s all ease-in-out;
|
71
76
|
}
|
72
|
-
.switch input[type=checkbox]:checked + .switch-slider {
|
73
|
-
background-color:
|
77
|
+
.switch.color-orange input[type=checkbox]:checked + .switch-slider {
|
78
|
+
background-color: theme("colors.orange.500");
|
79
|
+
}
|
80
|
+
.switch.color-blue input[type=checkbox]:checked + .switch-slider {
|
81
|
+
background-color: theme("colors.blue.500");
|
82
|
+
}
|
83
|
+
.switch.color-gray input[type=checkbox]:checked + .switch-slider {
|
84
|
+
background-color: theme("colors.gray.500");
|
85
|
+
}
|
86
|
+
.switch.color-red input[type=checkbox]:checked + .switch-slider {
|
87
|
+
background-color: theme("colors.red.500");
|
88
|
+
}
|
89
|
+
.switch.color-green input[type=checkbox]:checked + .switch-slider {
|
90
|
+
background-color: theme("colors.green.500");
|
74
91
|
}
|
75
92
|
.switch input[type=checkbox]:checked + .switch-slider::after {
|
76
93
|
transform: translateX(calc(var(--button-width) - var(--toggle-diameter) - var(--button-toggle-offset)));
|
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"version": "1.2.3-
|
2
|
+
"version": "1.2.3-3",
|
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",
|