-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquantum-button.css
More file actions
238 lines (204 loc) · 5.92 KB
/
Copy pathquantum-button.css
File metadata and controls
238 lines (204 loc) · 5.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
/* =====================================================================
* QUANTUM BUTTON - GPU-Optimized Particle System
*
* Replaces 12+ particle objects per frame with pure CSS animations
* using design tokens and GPU acceleration.
* ===================================================================== */
@layer components {
/* Core button styles */
.quantum-button {
position: relative;
overflow: visible;
background: linear-gradient(135deg,
theme('colors.brand.cosmic') 0%,
theme('colors.brand.cosmic-light') 100%);
border: 1px solid theme('colors.brand.emerald-glow-subtle');
border-radius: 8px;
color: theme('colors.brand.emerald');
font-weight: 300;
letter-spacing: 0.05em;
transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
/* GPU optimization */
will-change: transform, box-shadow, background;
transform: translateZ(0);
backface-visibility: hidden;
}
.quantum-button:hover {
border-color: theme('colors.brand.emerald-glow');
box-shadow: 0 0 20px theme('colors.brand.emerald-glow-subtle');
transform: translateZ(0) scale(1.02);
}
/* Quantum field background */
.quantum-field-bg {
background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
theme('colors.brand.emerald-glow-subtle') 0%,
transparent 50%);
opacity: 0;
transition: opacity 0.5s ease;
}
.quantum-button:hover .quantum-field-bg {
opacity: 0.3;
}
/* Orbital rings */
.orbital-ring {
position: absolute;
border: 2px solid theme('colors.brand.emerald-glow');
border-radius: 8px;
pointer-events: none;
transform-origin: center center;
will-change: transform, opacity, top, left, right, bottom;
/* Position using calculated offsets */
top: calc(0px - var(--ring-offset, 0px));
left: calc(0px - var(--ring-offset, 0px));
right: calc(0px - var(--ring-offset, 0px));
bottom: calc(0px - var(--ring-offset, 0px));
/* Smooth transitions */
transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
transition-delay: var(--ring-delay, 0s);
}
/* Ring inactive - completely hidden at button edge */
.ring-inactive {
opacity: 0;
}
/* Ring active - visible and spinning */
.ring-active {
opacity: 0.6 !important;
animation: orbital-spin var(--spin-duration, 8s) linear infinite;
animation-delay: var(--ring-delay);
border-color: theme('colors.brand.emerald-glow') !important;
}
/* Different spin speeds and directions */
.orbital-ring-0 { --spin-duration: 8s; }
.orbital-ring-1 { --spin-duration: 10s; animation-direction: reverse; }
.orbital-ring-2 { --spin-duration: 12s; }
/* Static quantum particles positioned around button */
.quantum-particle-button {
position: absolute;
border-radius: 50%;
background-color: theme('colors.quantum.particle');
opacity: 0;
animation: quantum-particle-float 3s ease-in-out infinite;
will-change: transform, opacity;
}
.quantum-particle-button:nth-child(1) {
width: 3px; height: 3px;
top: 20%; left: 15%;
animation-delay: 0s;
}
.quantum-particle-button:nth-child(2) {
width: 2px; height: 2px;
top: 30%; right: 20%;
animation-delay: 0.5s;
}
.quantum-particle-button:nth-child(3) {
width: 4px; height: 4px;
bottom: 25%; left: 25%;
animation-delay: 1s;
}
.quantum-particle-button:nth-child(4) {
width: 2px; height: 2px;
bottom: 35%; right: 15%;
animation-delay: 1.5s;
}
.quantum-particle-button:nth-child(5) {
width: 3px; height: 3px;
top: 15%; left: 60%;
animation-delay: 2s;
}
.quantum-particle-button:nth-child(6) {
width: 2px; height: 2px;
bottom: 20%; right: 50%;
animation-delay: 2.5s;
}
/* Particles only show on hover */
.quantum-button:hover .quantum-particle-button {
opacity: 0.8;
}
/* Glow effect */
.glow-effect {
background: radial-gradient(circle at 50% 50%,
theme('colors.brand.emerald-glow-subtle') 0%,
transparent 70%);
opacity: 0;
transition: opacity 0.5s ease;
}
.glow-effect-active {
opacity: 0.6;
}
/* Button text effects */
.button-text {
position: relative;
z-index: 10;
color: theme('colors.brand.emerald');
text-shadow: 0 0 10px theme('colors.brand.emerald-glow-subtle');
transition: all 0.5s ease;
}
.button-text-shadow {
position: absolute;
top: 0;
left: 0;
color: theme('colors.brand.emerald-glow');
opacity: 0;
transition: opacity 0.5s ease;
z-index: 9;
}
.quantum-button:hover .button-text-shadow {
opacity: 0.5;
}
/* Arrow animation */
.arrow-path {
stroke: theme('colors.brand.emerald');
stroke-width: 2;
transition: all 0.5s ease;
}
.quantum-button:hover .arrow-path {
stroke: theme('colors.brand.emerald-bright');
filter: drop-shadow(0 0 4px theme('colors.brand.emerald-glow'));
}
/* Pulse effect on click */
.pulse-effect {
background: radial-gradient(circle,
theme('colors.brand.emerald-glow') 0%,
transparent 70%);
opacity: 0;
animation: button-pulse 0.6s ease-out;
}
.quantum-button:active .pulse-effect {
animation: button-pulse 0.6s ease-out;
}
}
/* =====================================================================
* KEYFRAME ANIMATIONS - GPU-Optimized
* ===================================================================== */
@keyframes orbital-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@keyframes quantum-particle-float {
0%, 100% {
transform: translate(0, 0) scale(0.5);
opacity: 0;
}
50% {
transform: translate(var(--float-x, -5px), var(--float-y, -10px)) scale(1);
opacity: 1;
}
}
@keyframes button-pulse {
0% {
opacity: 0;
transform: scale(0.8);
}
50% {
opacity: 0.8;
transform: scale(1.2);
}
100% {
opacity: 0;
transform: scale(1.5);
}
}