Skip to content

Commit 7d6f576

Browse files
committed
Button Component Update
New .btn-animate classes
1 parent ea4ae88 commit 7d6f576

File tree

1 file changed

+72
-2
lines changed

1 file changed

+72
-2
lines changed

css/components/button.css

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
background: var(--btn-bg, var(--primary));
1818
color: var(--btn-color, #fff);
1919
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
20+
overflow: hidden;
2021
}
2122

23+
/* Hover and Active States */
2224
.btn:hover {
2325
background: var(--btn-bg-hover, var(--primary-hover));
2426
box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
@@ -37,6 +39,73 @@
3739
color: var(--neutral-500);
3840
}
3941

42+
/* Animation Variants */
43+
.btn-animate-pulse:hover, .btn-animate-pulse:active {
44+
animation: btn-pulse 0.6s infinite;
45+
}
46+
47+
@keyframes btn-pulse {
48+
0%, 100% {
49+
transform: scale(1);
50+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
51+
}
52+
50% {
53+
transform: scale(1.05);
54+
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
55+
}
56+
}
57+
58+
.btn-animate-fill::before {
59+
content: '';
60+
position: absolute;
61+
top: 0;
62+
left: 0;
63+
width: 100%;
64+
height: 100%;
65+
background: var(--btn-bg-hover, var(--primary-hover));
66+
border-radius: inherit;
67+
z-index: 0;
68+
transform: scaleX(0);
69+
transform-origin: left;
70+
transition: transform 0.3s ease;
71+
opacity: 0.1;
72+
}
73+
74+
.btn-animate-fill:hover::before, .btn-animate-fill:active::before {
75+
transform: scaleX(1);
76+
}
77+
78+
.btn-animate-fill {
79+
z-index: 1;
80+
color: inherit;
81+
}
82+
83+
.btn-animate-bounce:hover, .btn-animate-bounce:active {
84+
animation: btn-bounce 0.4s;
85+
}
86+
87+
@keyframes btn-bounce {
88+
0%, 100% {
89+
transform: translateY(0);
90+
}
91+
50% {
92+
transform: translateY(-5px);
93+
}
94+
}
95+
96+
.btn-animate-rotate:hover {
97+
animation: btn-rotate 0.5s ease-in-out;
98+
}
99+
100+
@keyframes btn-rotate {
101+
0% {
102+
transform: rotate(0deg);
103+
}
104+
100% {
105+
transform: rotate(360deg);
106+
}
107+
}
108+
40109
/* Button Variants */
41110
.btn-primary {
42111
--btn-bg: var(--primary);
@@ -146,10 +215,10 @@
146215
border: 2px solid var(--btn-color, #fff);
147216
border-right-color: transparent;
148217
border-radius: 50%;
149-
animation: spin 0.6s linear infinite;
218+
animation: btn-spin 0.6s linear infinite;
150219
}
151220

152-
@keyframes spin {
221+
@keyframes btn-spin {
153222
to {
154223
transform: rotate(360deg);
155224
}
@@ -158,6 +227,7 @@
158227
/* Button Group */
159228
.btn-group {
160229
display: inline-flex;
230+
align-items: center;
161231
}
162232

163233
.btn-group .btn {

0 commit comments

Comments
 (0)