/
index.html
191 lines (184 loc) · 4.95 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" />
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
<meta name="msapplication-TileColor" content="#2a4365" />
<meta name="theme-color" content="#2a4365" />
<meta
name="description"
content="A React Hook to help you build inputs with separate boxes for each digit of a pass code."
/>
<link rel="apple-touch-icon" href="logo192.png" />
<meta name="twitter:card" content="summary_large_image" />
<meta property="og:image:height" content="1257" />
<meta property="og:image:width" content="2400" />
<meta property="og:type" content="website" />
<meta property="og:title" content="React Digit Input" />
<meta
property="og:description"
content="React Hook to help you build accessible pass code inputs with separate boxes for each digit."
/>
<meta
property="og:url"
content="https://react-digit-input.forbeslindesay.co.uk/"
/>
<meta
property="og:image"
content="https://react-digit-input.forbeslindesay.co.uk/og-image.jpg"
/>
<title>React Digit Input</title>
<style>
body {
font-size: 3em;
background: #2a4365;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
@media (min-width: 800px) {
body {
font-size: 5em;
}
}
pre {
text-align: center;
}
.input-group {
display: flex;
align-items: center;
}
.input-group > label,
.input-group > span {
margin-right: 0.1em;
}
.input-group > label:last-child,
.input-group > span:last-child {
margin-right: 0;
}
@media (min-width: 800px) {
.input-group > label,
.input-group > span {
margin-right: 0.2em;
}
.input-group > label:last-child,
.input-group > span:last-child {
margin-right: 0;
}
}
.hyphen {
background: black;
height: 0.1em;
width: 0.25em;
display: inline-block;
}
@media (min-width: 800px) {
.hyphen {
background: black;
height: 0.1em;
width: 0.5em;
display: inline-block;
}
}
label {
width: 50px;
height: 60px;
position: relative;
}
input {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 50px;
height: 60px;
opacity: 0;
}
label > div {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 50px;
height: 60px;
display: flex;
justify-content: center;
align-items: center;
border: none;
border-radius: 3px;
background-color: #3182ce;
font-family: 'Gordita', 'Inter UI', 'San Francisco', -apple-system,
system-ui, sans-serif;
font-size: 18px;
font-weight: 300;
font-style: normal;
font-stretch: normal;
line-height: normal;
letter-spacing: 1px;
color: white;
}
label:focus-within > div {
box-shadow: inset 0 2px 5px 0 rgba(9, 30, 66, 0.2);
background-color: white;
color: black;
outline: none;
}
hr {
border: none;
position: absolute;
bottom: 10px;
right: 10px;
left: 10px;
width: 30px;
height: 3px;
opacity: 0.6;
background-color: white;
margin: 0;
padding: 0;
}
@keyframes blink {
0% {
opacity: 0;
}
49% {
opacity: 0;
}
50% {
opacity: 1;
}
}
label:focus-within > hr {
animation: blink 1s infinite reverse;
animation-timing-function: linear;
background-color: #3182ce;
}
a {
display: block;
color: #90cdf4;
font-size: 0.5em;
font-family: 'Gordita', 'Inter UI', 'San Francisco', -apple-system,
system-ui, sans-serif;
text-decoration: none;
border-bottom: 4px solid #3182ce;
}
</style>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<a href="https://github.com/ForbesLindesay/react-digit-input"
>Source code on GitHub</a
>
<script src="index.js"></script>
</body>
</html>