forked from stevenlei/spacingjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
191 lines (188 loc) · 4.62 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" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Spacing.js</title>
<link
href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css"
rel="stylesheet"
/>
<script src="./dist/bundle.js" defer></script>
</head>
<body class="bg-gray-50">
<div class="container mx-auto max-w-4xl p-4">
<h1
class="
text-center text-5xl
sm:text-9xl
font-bold
tracking-tight
mt-24
mb-12
sm:mt-32 sm:mb-14
"
>
Spacing.js
</h1>
<p class="text-center text-lg sm:text-2xl max-w-lg mx-auto text-gray-400">
A JavaScript utility for measuring the spacing between elements on
webpage
</p>
<h2 class="text-center text-3xl font-bold mt-24 mb-12">How to use</h2>
<div class="flex">
<div class="w-full bg-white p-8 rounded-md shadow-md text-center">
<span
class="
bg-black
rounded-full
flex
justify-center
items-center
w-8
h-8
text-white text-xl
font-bold
mx-auto
mb-6
"
>1</span
>
Include
<div
class="font-mono text-sm bg-gray-100 p-2 rounded my-2 overflow-auto"
>
<script src="https://unpkg.com/spacingjs"
defer></script>
</div>
in your HTML page.
</div>
</div>
<div class="flex gap-6 flex-wrap mt-6">
<div
class="w-full md:flex-1 bg-white p-8 rounded-md shadow-md text-center"
>
<span
class="
bg-black
rounded-full
flex
justify-center
items-center
w-8
h-8
text-white text-xl
font-bold
mx-auto
mb-6
"
>2</span
>
Move your cursor to an element and press
<kbd
class="
bg-gray-200
py-1
px-2
text-md
rounded
border-b-4 border-gray-300
"
>Alt</kbd
>
on Windows, or
<kbd
class="
bg-gray-200
py-1
px-2
text-md
rounded
border-b-4 border-gray-300
"
>Option</kbd
>
on a Mac.
</div>
<div
class="w-full md:flex-1 bg-white p-8 rounded-md shadow-md text-center"
>
<span
class="
bg-black
rounded-full
flex
justify-center
items-center
w-8
h-8
text-white text-xl
font-bold
mx-auto
mb-6
"
>3</span
>
Move your cursor to another element, the measurement results will be
there.
</div>
</div>
<p class="text-center my-12">
By the way, you can press
<kbd
class="
bg-gray-200
py-1
px-2
text-md
rounded
border-b-4 border-gray-300
"
>Alt</kbd
>
/
<kbd
class="
bg-gray-200
py-1
px-2
text-md
rounded
border-b-4 border-gray-300
"
>Option</kbd
>
now.
</p>
<footer class="text-center py-8 mt-8">
<a
href="https://youtube.com/codingstartup"
class="
text-indigo-600
mt-4
border-b-4 border-indigo-400 border-opacity-25
hover:border-opacity-100
inline-block
mr-2
"
>CodingStartup</a
>
<span class="text-gray-200 text-sm">|</span>
<a
href="https://github.com/stevenlei/spacingjs"
class="
text-indigo-600
mt-4
border-b-4 border-indigo-400 border-opacity-25
hover:border-opacity-100
inline-block
ml-2
"
>GitHub</a
>
<div class="mt-4 text-sm">Made with ❤️ in Macao</div>
</footer>
</div>
</body>
</html>