srcdev-nuxt-components 6.1.19 → 6.1.20

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.
@@ -0,0 +1,160 @@
1
+ <template>
2
+ <component :is="tag" class="magnetic-navigation" :class="[elementClasses]">
3
+ <nav>
4
+ <ul>
5
+ <li><a href="#">Home</a></li>
6
+ <li><a href="#">About</a></li>
7
+ <li><a href="#">Blog</a></li>
8
+ <li><a href="#">Contact</a></li>
9
+ </ul>
10
+ </nav>
11
+ </component>
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ const props = defineProps({
16
+ tag: {
17
+ type: String,
18
+ default: "div",
19
+ validator(value: string) {
20
+ return ["div", "header", "footer", "nav"].includes(value)
21
+ },
22
+ },
23
+ styleClassPassthrough: {
24
+ type: Array as PropType<string[]>,
25
+ default: () => [],
26
+ },
27
+ })
28
+
29
+ const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
30
+
31
+ watch(
32
+ () => props.styleClassPassthrough,
33
+ () => {
34
+ resetElementClasses(props.styleClassPassthrough)
35
+ }
36
+ )
37
+ </script>
38
+
39
+ <style lang="css">
40
+ .magnetic-navigation {
41
+ /*
42
+ --_background-image: url("/images/rotating-carousel/image-3.webp");
43
+
44
+ background-image: var(--_background-image);
45
+ background-size: cover;
46
+ background-position: 0 -400px;
47
+ background-attachment: fixed;
48
+ */
49
+ /* padding-block: 200px 2000px; */
50
+
51
+ nav {
52
+ width: fit-content;
53
+ margin: 3rem auto;
54
+ background: hsl(0 0% 0% / 0.8);
55
+
56
+ padding: 8px;
57
+ border-radius: 8px;
58
+
59
+ isolation: isolate;
60
+
61
+ anchor-name: --hovered-link;
62
+
63
+ li:hover {
64
+ anchor-name: --hovered-link;
65
+ }
66
+
67
+ &::before,
68
+ &::after {
69
+ content: "";
70
+ position: absolute;
71
+ top: calc(anchor(bottom) - 10px);
72
+ left: calc(anchor(left) + 1rem);
73
+ right: calc(anchor(right) + 1rem);
74
+ bottom: calc(anchor(bottom) + 5px);
75
+ border-radius: 10px;
76
+
77
+ position-anchor: --hovered-link;
78
+
79
+ transition: 500ms
80
+ linear(
81
+ 0,
82
+ 0.029 1.6%,
83
+ 0.123 3.5%,
84
+ 0.651 10.6%,
85
+ 0.862 14.1%,
86
+ 1.002 17.7%,
87
+ 1.046 19.6%,
88
+ 1.074 21.6%,
89
+ 1.087 23.9%,
90
+ 1.086 26.6%,
91
+ 1.014 38.5%,
92
+ 0.994 46.3%,
93
+ 1
94
+ );
95
+ }
96
+
97
+ &::before {
98
+ z-index: -1;
99
+ background: rgb(0 0 0 / 0.2);
100
+ backdrop-filter: blur(2px);
101
+ }
102
+
103
+ &::after {
104
+ z-index: -2;
105
+ background-image: var(--_background-image);
106
+ background-size: cover;
107
+ background-position: var(--_background-position);
108
+ background-attachment: fixed;
109
+ }
110
+
111
+ &:has(a:hover)::before,
112
+ &:has(a:hover)::after {
113
+ top: anchor(top);
114
+ left: anchor(left);
115
+ right: anchor(right);
116
+ bottom: anchor(bottom);
117
+
118
+ @supports (corner-shape: squircle) {
119
+ corner-shape: squircle;
120
+ border-radius: 50%;
121
+ }
122
+ }
123
+
124
+ &:has(li:first-of-type a:hover)::before,
125
+ &:has(li:first-of-type a:hover)::after {
126
+ @supports (corner-shape: squircle) {
127
+ border-radius: 32px 50% 50% 32px;
128
+ }
129
+ }
130
+
131
+ &:has(li:last-of-type a:hover)::before,
132
+ &:has(li:last-of-type a:hover)::after {
133
+ @supports (corner-shape: squircle) {
134
+ border-radius: 50% 32px 32px 50%;
135
+ }
136
+ }
137
+
138
+ @supports (corner-shape: squircle) {
139
+ border-radius: 24px;
140
+ corner-shape: squircle;
141
+ }
142
+
143
+ > ul {
144
+ padding: 0;
145
+ margin: 0;
146
+ list-style: none;
147
+ display: flex;
148
+ gap: 24px;
149
+
150
+ a {
151
+ display: block;
152
+ padding: 1rem;
153
+ text-decoration: none;
154
+ color: white;
155
+ font-size: var(--step-7);
156
+ }
157
+ }
158
+ }
159
+ }
160
+ </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srcdev-nuxt-components",
3
3
  "type": "module",
4
- "version": "6.1.19",
4
+ "version": "6.1.20",
5
5
  "main": "nuxt.config.ts",
6
6
  "scripts": {
7
7
  "clean": "rm -rf .nuxt && rm -rf .output && rm -rf .playground/.nuxt && rm -rf .playground/.output",