-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJayButton.css
More file actions
216 lines (196 loc) · 5.4 KB
/
Copy pathJayButton.css
File metadata and controls
216 lines (196 loc) · 5.4 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
/*!
* JayButton by JaydenART
* Released under JaydenART® Inc., JaydenART® Tech Inc., JaydenART® Creatives Inc. for the JaydenART button.
* Designed by Jayden Yoon ZK
* MIT License: use it freely in your own projects and websites, and keep this notice. The brand stays behind the code.
* https://github.com/JaydenART/JaydenART_Realistic_3D_CSS_Button
*/
/* JaydenART Realistic 3D CSS Button v2.5.1 */
.jay-button,
.jay-button-studio {
--jay-cap: #abcf37;
--jay-cap-hover: #b9dc49;
--jay-edge: #718a23;
--jay-ink: #10110d;
--jay-focus: #ffffff;
--jay-travel: 5px;
--jay-radius: 14px;
position: relative;
isolation: isolate;
display: inline-grid;
min-inline-size: 10rem;
padding: 0 0 8px;
border: 0;
border-radius: var(--jay-radius);
color: var(--jay-ink);
background: transparent;
font: 700 1rem/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
cursor: pointer;
touch-action: manipulation;
-webkit-tap-highlight-color: transparent;
appearance: none;
}
.jay-button::before,
.jay-button-studio::before {
content: "";
position: absolute;
z-index: -1;
inset: 5px 0 3px;
border-radius: var(--jay-radius);
background: var(--jay-edge);
box-shadow: inset 0 -1px 0 rgb(0 0 0 / 0.32);
}
.jay-button::after,
.jay-button-studio::after {
content: "";
position: absolute;
z-index: -2;
inset: auto 9% -5px;
height: 16px;
border-radius: 50%;
background: rgb(0 0 0 / 0.34);
filter: blur(7px);
}
.jay-button__cap,
.jay-button-studio__cap {
position: relative;
display: block;
padding: 1rem 1.55rem;
border: 1px solid rgb(0 0 0 / 0.2);
border-radius: var(--jay-radius);
background: var(--jay-cap);
box-shadow:
inset 0 1px 0 rgb(255 255 255 / 0.5),
inset 0 -2px 0 rgb(0 0 0 / 0.13),
0 2px 3px rgb(0 0 0 / 0.16);
transform: translateY(0);
transition: transform 130ms ease, background-color 130ms ease, box-shadow 130ms ease;
}
@media (hover: hover) and (pointer: fine) {
.jay-button:hover .jay-button__cap,
.jay-button-studio:hover .jay-button-studio__cap {
background: var(--jay-cap-hover);
transform: translateY(-1px);
box-shadow:
inset 0 1px 0 rgb(255 255 255 / 0.58),
inset 0 -2px 0 rgb(0 0 0 / 0.13),
0 3px 5px rgb(0 0 0 / 0.18);
}
}
.jay-button:active .jay-button__cap,
.jay-button-studio:active .jay-button-studio__cap {
transform: translateY(var(--jay-travel));
box-shadow:
inset 0 2px 3px rgb(0 0 0 / 0.16),
inset 0 -1px 0 rgb(255 255 255 / 0.28);
}
.jay-button:focus-visible,
.jay-button-studio:focus-visible {
outline: 3px solid var(--jay-focus);
outline-offset: 5px;
}
.jay-button:disabled,
.jay-button-studio:disabled {
cursor: not-allowed;
opacity: 0.48;
}
.jay-button:disabled .jay-button__cap,
.jay-button-studio:disabled .jay-button-studio__cap {
transform: none;
}
.jay-button[data-tone="brown"],
.jay-button-studio[data-tone="brown"] {
--jay-cap: #6c5b54;
--jay-cap-hover: #7b6961;
--jay-edge: #382f2b;
--jay-ink: #ffffff;
}
/* JayButton Classic preserves the original JaydenART signature button. */
.JayBrown,
.jay-button-classic {
display: inline-block;
box-sizing: content-box;
margin: 0 0 15px;
padding: 8px 20px 10px;
border: 1px solid rgb(127 70 34);
border-radius: 10px;
color: rgb(255 255 255);
background:
linear-gradient(0deg, rgb(255 255 255 / 0) 0, rgb(255 255 255 / 0) 1%, rgb(206 133 88 / 0.99) 100%),
rgb(114 71 42);
box-shadow:
inset 0 0 5px 1px rgb(239 159 105 / 0.6),
inset 0 1.5px 0 rgb(229 151 98),
0 6px 0 rgb(89 50 24),
0 8px 3px 1px rgb(0 0 0 / 0.99);
font: 700 14px/1 "Coda", Helvetica, sans-serif;
text-align: center;
text-shadow: 0 -1px 1px rgb(45 22 7);
cursor: pointer;
touch-action: manipulation;
-webkit-tap-highlight-color: transparent;
appearance: none;
}
@media (hover: hover) and (pointer: fine) {
.JayBrown:hover,
.jay-button-classic:hover {
background:
linear-gradient(180deg, rgb(255 255 255 / 0) 0, rgb(211 140 99 / 0.7) 100%),
rgb(137 89 57);
box-shadow:
inset 0 0 5px 1px rgb(239 159 105 / 0.6),
inset 0 1.5px 0 rgb(234 161 112 / 0.96),
0 6px 0 rgb(89 50 24),
0 8px 3px 1px rgb(0 0 0 / 0.99);
text-shadow: 0 -1px 1px rgb(30 45 77);
}
}
.JayBrown:active,
.jay-button-classic:active {
margin: 5px 0 10px;
background:
linear-gradient(0deg, rgb(255 255 255 / 0) 0, rgb(255 255 255 / 0) 1%, rgb(206 133 88 / 0.99) 100%),
rgb(114 71 42);
box-shadow:
inset 0 1px 10px 1px rgb(239 159 105 / 0.6),
inset 0 1.5px 0 rgb(234 171 129),
0 2px 0 rgb(89 50 24),
0 3px 3px 1px rgb(0 0 0 / 0.99);
}
.JayBrown:focus-visible,
.jay-button-classic:focus-visible {
outline: 3px solid #abcf37;
outline-offset: 5px;
}
@media (prefers-reduced-motion: reduce) {
.jay-button__cap,
.jay-button-studio__cap {
transition-duration: 0.01ms;
}
.jay-button:hover .jay-button__cap,
.jay-button:active .jay-button__cap,
.jay-button-studio:hover .jay-button-studio__cap,
.jay-button-studio:active .jay-button-studio__cap {
transform: none;
}
}
@media (forced-colors: active) {
.jay-button,
.jay-button-studio,
.JayBrown,
.jay-button-classic {
forced-color-adjust: none;
}
.jay-button__cap,
.jay-button-studio__cap,
.JayBrown,
.jay-button-classic {
border-color: ButtonText;
color: ButtonText;
background: ButtonFace;
}
.jay-button::before,
.jay-button-studio::before {
background: ButtonText;
}
}