-
-
Notifications
You must be signed in to change notification settings - Fork 700
/
demo.html
491 lines (469 loc) · 11.6 KB
/
demo.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
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>Hint.css - A tooltip library in CSS</title>
<meta name="description" content="A CSS only tooltip library" />
<meta name="viewport" content="width=device-width" />
<link
href="https://fonts.googleapis.com/css?family=Lobster&display=swap"
rel="stylesheet"
type="text/css"
/>
<link rel="image_src" href="hint.png" />
<style type="text/css">
body {
text-align: center;
font-family: Arial;
background: #d9623f;
min-height: 100vh;
font-size: 18px;
padding: 0;
margin: 0;
color: white;
}
h1 {
font-size: 6em;
text-shadow: 0 6px 1px rgba(0, 0, 0, 0.2);
font-family: "Lobster", cursive;
}
h2 {
font-size: 4em;
margin: 0.5em 0;
text-shadow: 0 6px 1px rgba(0, 0, 0, 0.2);
font-family: "Lobster", cursive;
}
.version {
font-size: 0.3em;
border-radius: 50%;
padding: 1px 11px;
text-shadow: none;
top: 0px;
position: absolute;
right: -65px;
}
.section {
padding: 3em 0;
position: relative;
}
.section:after {
content: "";
position: absolute;
bottom: -25px;
background: inherit;
left: -4px;
height: 50px;
right: -2px;
z-index: 1;
transform: rotate(2deg);
}
.section:last-of-type {
padding-bottom: 2em;
}
.section:last-of-type:after {
display: none;
}
.section--inverted:after {
left: -4px;
height: 50px;
right: -2px;
z-index: 1;
transform: rotate(-2deg);
}
.hero {
background: #5cc2f1;
background: #81c439;
background: #7d6ec6;
/*text-shadow: 0 3px 7px rgba(0,0,0,0.25);*/
}
.section:nth-child(2) {
background: #9993c1;
background: #8bba66;
background: #5bc0eb;
background: ;
}
.section:nth-child(3) {
background: #d9623f;
background: #e4cc37;
/* #BD3769 */
/* #E18335 */
}
.section:nth-child(4) {
background: #7d6ec6;
}
.section:nth-child(5) {
background: #d9623f;
/*background: ##E18335;*/
/* #BD3769 */
/* #E18335 */
}
.section-inner {
max-width: 600px;
margin: 0 auto;
}
h1,
h3 {
margin: 5px 0;
}
a {
color: #1a5a7a;
color: #fff;
outline: none;
text-decoration: none;
}
.btn {
/*background: rgba(0,0,0,0.2);*/
background: white;
padding: 20px;
display: inline-block;
border-radius: 8px;
text-transform: uppercase;
transition: 0.3s ease;
}
.btn:hover {
transform: scale(1.2);
}
.download-btn {
color: #7d6ec6;
margin-top: 1em;
}
.position-grid {
display: flex;
flex-wrap: wrap;
}
.position-grid__cell {
flex: 1 33.33%;
font-size: 0.8em;
}
.position-grid__cell a {
display: inline-block;
width: 90%;
background: rgba(91, 192, 235, 0.37);
color: white;
margin: 2px 0;
padding: 16px 5px;
}
.status-icon {
background: indianred;
fill: white;
border-radius: 3px;
padding: 5px 6px 2px;
margin: 0 4px;
border: 1px solid rgba(0, 0, 0, 0.2);
}
.features ul {
padding: 0;
list-style: none;
}
.footer {
color: rgba(255, 255, 255, 0.7);
}
.window {
background: #fff;
width: 50vw;
min-width: 450px;
margin: auto;
border: 1px solid #acacac;
border-radius: 6px;
box-shadow: 0px 6px 17px rgba(0, 0, 0, 0.2);
cursor: default;
}
.titlebar {
background: linear-gradient(top, #ebebeb, #d5d5d5);
color: #4d494d;
font-size: 11pt;
line-height: 20px;
text-align: center;
width: 100%;
height: 20px;
border-top: 1px solid #f3f1f3;
border-bottom: 1px solid #b1aeb1;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
.buttons {
padding-left: 8px;
padding-top: 3px;
float: left;
line-height: 0px;
}
.titlebar__btn {
font-size: 9pt;
line-height: 11px;
width: 11px;
height: 11px;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 50%;
display: inline-block;
margin-right: 5px;
cursor: pointer;
}
.close {
background: #ff5c5c;
}
.minimize {
background: #ffbd4c;
}
.zoom {
background: #00ca56;
}
.titlebar__btn:hover {
border-color: rgba(0, 0, 0, 0.3);
}
.content {
padding: 50px 10px;
color: #777;
}
.content a {
color: #444;
}
.content h3 {
text-transform: uppercase;
font-size: 0.8em;
margin: 22px 0 0;
padding: 4px 0;
background: rgba(00, 0, 0, 0.02);
color: rgba(0, 0, 0, 0.9);
border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
pre {
color: #555;
font-size: 1.5em;
}
a svg {
fill: rgba(255, 255, 255, 0.6);
}
a:hover svg {
fill: white;
}
</style>
<link rel="stylesheet" href="hint.css" />
</head>
<body>
<div class="section hero">
<h1 style="display: inline-block; position: relative">
Hint.css <small class="version">3.0</small>
</h1>
<h3>A pure CSS tooltip library for your lovely websites</h3>
<br />
</div>
<div class="section section--inverted">
<h2>Tryout</h2>
<div class="window">
<div class="titlebar">
<div class="buttons">
<a
class="titlebar__btn close hint--bottom-right"
aria-label="Close"
></a>
<a
class="titlebar__btn minimize hint--bottom-right"
aria-label="Minimize"
></a>
<a
class="titlebar__btn zoom hint--bottom-right"
aria-label="Zoom"
></a>
</div>
Try hovering over different things
</div>
<div class="content">
<div class="position-grid">
<div class="position-grid__cell">
<a href="#" aria-label="bottom-right" class="hint--bottom-right"
>bottom-right</a
>
</div>
<div class="position-grid__cell">
<a href="#" aria-label="bottom" class="hint--bottom">bottom</a>
</div>
<div class="position-grid__cell">
<a href="#" aria-label="bottom-left" class="hint--bottom-left"
>bottom-left</a
>
</div>
<div class="position-grid__cell">
<a href="#" aria-label="right" class="hint--right">right</a>
</div>
<div class="position-grid__cell"><a>.</a></div>
<div class="position-grid__cell">
<a href="#" aria-label="left" class="hint--left">left</a>
</div>
<div class="position-grid__cell">
<a href="#" aria-label="top-right" class="hint--top-right"
>top-right</a
>
</div>
<div class="position-grid__cell">
<a href="#" aria-label="top" class="hint--top">top</a>
</div>
<div class="position-grid__cell">
<a href="#" aria-label="top-left" class="hint--top-left"
>top-left</a
>
</div>
</div>
<h3>Color Modifiers</h3>
<p>
<a
class="status-icon hint--bottom-right hint--error"
style="background: indianred"
aria-label="This is an error tooltip"
>
<svg style="width: 24px; height: 24px" viewBox="0 0 24 24">
<path
fill="#ffffff"
d="M8.27,3L3,8.27V15.73L8.27,21H15.73L21,15.73V8.27L15.73,3M8.41,7L12,10.59L15.59,7L17,8.41L13.41,12L17,15.59L15.59,17L12,13.41L8.41,17L7,15.59L10.59,12L7,8.41"
/>
</svg>
</a>
<a
class="status-icon hint--bottom-right hint--warning"
style="background: orange"
aria-label="This is a warning tooltip"
>
<svg style="width: 24px; height: 24px" viewBox="0 0 24 24">
<path
fill="#ffffff"
d="M11,4.5H13V15.5H11V4.5M13,17.5V19.5H11V17.5H13Z"
/>
</svg>
</a>
<a
class="status-icon hint--bottom-left hint--info"
style="background: lightblue"
aria-label="This is an info tooltip"
>
<svg style="width: 24px; height: 24px" viewBox="0 0 24 24">
<path
fill="#ffffff"
d="M12,2A7,7 0 0,1 19,9C19,11.38 17.81,13.47 16,14.74V17A1,1 0 0,1 15,18H9A1,1 0 0,1 8,17V14.74C6.19,13.47 5,11.38 5,9A7,7 0 0,1 12,2M9,21V20H15V21A1,1 0 0,1 14,22H10A1,1 0 0,1 9,21M12,4A5,5 0 0,0 7,9C7,11.05 8.23,12.81 10,13.58V16H14V13.58C15.77,12.81 17,11.05 17,9A5,5 0 0,0 12,4Z"
/>
</svg>
</a>
<a
class="status-icon hint--bottom-right hint--success"
style="background: lightgreen"
aria-label="This is success tooltip"
>
<svg style="width: 24px; height: 24px" viewBox="0 0 24 24">
<path
fill="#ffffff"
d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"
/>
</svg>
</a>
</p>
<h3>Size variations</h3>
<p>
<a
class="hint--top hint--small"
style="
border: 1px solid #eee;
padding: 3px 6px;
border-radius: 4px;
"
data-hint="You can show very very long sentences inside tooltips by using various available size variation classes."
>
Small
</a>
<a
class="hint--top hint--medium"
style="
border: 1px solid #eee;
padding: 3px 6px;
border-radius: 4px;
"
data-hint="You can show very very long sentences inside tooltips by using various available size variation classes."
>
Medium
</a>
<a
class="hint--top hint--large"
style="
border: 1px solid #eee;
padding: 3px 6px;
border-radius: 4px;
"
data-hint="You can show very very long sentences inside tooltips by using various available size variation classes."
>
Large
</a>
<a
class="hint--top hint--fit"
style="
border: 1px solid #eee;
padding: 3px 56px;
border-radius: 4px;
"
data-hint="You can show very very long sentences inside tooltips by using various available size variation classes."
>
Fit
</a>
</p>
<h3>Extra</h3>
<p>
<a
class="hint--top hint--rounded"
aria-label="We have rounded corners for you"
>Hmm...So you don't like sharp edges?</a
>
</p>
<p>
<a
class="hint--left hint--always"
aria-label="...which always keep showing"
>You can also make tooltips...</a
>
</p>
<p>
<a class="hint--top hint--no-arrow" aria-label="Just the tip!"
>You can omit the arrow too.</a
>
</p>
<h3>Effects</h3>
<p>
<a
class="hint--top hint--no-animate"
aria-label="Get a simple show/hide tooltip"
>Dont like animation?</a
>
</p>
<p>
<a class="hint--right hint--bounce" aria-label="Bounce"
>Adding a <code>hint--bounce</code> class gives you that...</a
>
</p>
<p>
<a class="hint--left hint--no-shadow" aria-label="Yes, no shadows!"
>Maybe you do not want shadows.</a
>
</p>
</div>
</div>
<div class="section-inner" style="opacity: 0.7; margin-top: 25px">
<strong>Upgrading from v1.x</strong>: If you are already using v1.x, you
may need to tweak certain position classes because of the way tooltips
are positioned in v2.
<br />
Its recommended to use <code>aria-label</code> attribute to specify your
tooltip text in support of accessibility. Though, you can always use
<code>data-hint</code> attribute instead.
<a href="https://webaccessibility.withgoogle.com/unit?unit=6&lesson=10"
>Read more about <code>aria-label</code> here</a
>.
</div>
</div>
<div class="section footer">
Made with hands by
<a
aria-label="@chinchang457"
class="hint--top"
href="https://twitter.com/chinchang457"
>Kushagra Gour</a
>
in India
</div>
</body>
</html>