-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
149 lines (132 loc) · 3.73 KB
/
index.html
File metadata and controls
149 lines (132 loc) · 3.73 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Realistic Button</title>
</head>
<style>
html {
font-family: Helvetica, Arial, sans-serif;
}
body {
background-color: #a49d9c;
margin: 0;
padding: 0;
min-height: 100vh;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
}
h1 {
color: #262626;
font-size: 32px;
margin-bottom: 16px;
text-align: center;
}
h1 a {
color: inherit;
}
.links {
display: flex;
gap: 10px;
font-size: 20px;
margin-bottom: 64px;
font-weight: 600;
}
.links a {
color: color-mix(in oklch, #262626, transparent 40%);
padding: 4px 8px;
border-radius: 6px;
}
.container {
display: grid;
place-items: center;
grid-template-columns: repeat(3, 1fr);
gap: 80px;
margin-bottom: 60px;
}
button {
position: relative;
background-color: #a49d9c;
padding: 14px;
color: rgba(255, 255, 255, 0.6);
border-radius: 6px;
width: 150px;
height: 150px;
display: flex;
align-items: start;
justify-content: start;
font-size: 40px;
border: none;
box-shadow: inset 1px 1px rgba(255, 255, 255, 0.4), inset 0 1px rgba(255, 255, 255, 0.6), inset 0 1px 12px rgba(0, 0, 0, 0.1),
inset 0 -4px 1px rgba(0, 0, 0, 0.2), inset -1px -1px 2px rgba(0, 0, 0, 0.8),
12px 12px 16px rgba(0, 0, 0, 0.4), 24px 24px 32px rgba(0, 0, 0, 0.4);
outline: none;
cursor: pointer;
transition: 0.15s ease;
}
button:active {
box-shadow: inset 1px 1px rgba(255, 255, 255, 0.4), inset 0 1px rgba(255, 255, 255, 0.6), inset 0 1px 12px rgba(0, 0, 0, 0.1),
inset 0 -4px 1px rgba(0, 0, 0, 0.2), inset -1px -1px 2px rgba(0, 0, 0, 0.8);
margin: 2px -2px -2px 2px;
background-color: color-mix(in oklch, #a49d9c, black 6%);
}
button.dark {
background-color: #262626;
box-shadow: inset 1px 1px rgba(255, 255, 255, 0.1), inset 0 1px rgba(255, 255, 255, 0.3), inset 0 1px 12px rgba(0, 0, 0, 0.1),
inset 0 -4px 1px rgba(0, 0, 0, 0.2), inset -1px -1px 2px rgba(0, 0, 0, 0.8),
12px 12px 16px rgba(0, 0, 0, 0.4), 24px 24px 32px rgba(0, 0, 0, 0.4);
}
button.dark:active {
box-shadow: inset 1px 1px rgba(255, 255, 255, 0.15), inset 0 1px rgba(255, 255, 255, 0.3), inset 0 1px 12px rgba(0, 0, 0, 0.1),
inset 0 -4px 1px rgba(0, 0, 0, 0.2), inset -1px -1px 2px rgba(0, 0, 0, 0.8);
background-color: color-mix(in oklch, #262626, black 12%);
}
button::after {
content: '';
position: absolute;
top: -5px;
left: -5px;
width: 100%;
height: 100%;
background-color: black;
padding: 5px 9px 5px 5px;
z-index: -1;
box-shadow: inset -1.2px -1.2px rgba(255, 255, 255, 0.8), 1px 1px 2px rgba(0, 0, 0, 0.2), 4px 12px 24px -6px rgba(0, 0, 0, 0.1);
transition: 0.15s ease;
}
button:active::after {
margin: -2px 2px 2px -2px;
}
/* Mobile responsive styles */
@media (max-width: 768px) {
.container {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 480px) {
.container {
grid-template-columns: repeat(1, 1fr);
}
}
</style>
<body>
<h1>
Inspired by <a href="https://x.com/motomiya333/status/2001730072026452172" target="_blank">this amazing work</a>
</h1>
<div class="links">
<a href="https://github.com/hakadao/realistic-button">GitHub</a>
<a href="https://codepen.io/Hakadao/pen/PwNMEOE">CodePen</a>
</div>
<div class="container">
<button>A</button>
<button>B</button>
<button>C</button>
<button class="dark">1</button>
<button class="dark">2</button>
<button class="dark">3</button>
</div>
</body>
</html>