-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
83 lines (80 loc) · 1.91 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Airhorn Web Component</title>
<meta name="viewport" content="width=device-width, user-scalable=no" />
<link href="https://fonts.googleapis.com/css?family=Hi+Melody" rel="stylesheet" />
<style>
* {
margin: 0;
}
airhorn-overlay {
background: #eee;
border-radius: 20px;
display: block;
text-align: center;
padding: 20px;
width: 240px;
max-width: 320px;
}
airhorn-overlay.contain {
overflow: hidden;
}
body {
font-family: 'Hi Melody', cursive;
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
margin: 0;
min-height: 100vh;
font-size: 18px;
line-height: 32px;
}
form {
width: 100%;
max-width: 220px;
}
form label {
cursor: pointer;
border-bottom: 1px solid #eee;
line-height: 2em;
display: block;
padding: 0 12px;
}
form label:hover {
background: #f9f9ff;
}
form p {
text-align: center;
line-height: 1em;
padding: 0.5em 0;
}
a {
color: #33f;
text-decoration: none;
}
</style>
<script type="module">
import './airhorn-overlay.js';
form.addEventListener('change', (ev) => {
airhorn.disabled = !check_enabled.checked;
airhorn.classList.toggle('contain', check_overflow.checked);
});
</script>
</head>
<body>
<airhorn-overlay id="airhorn">
<h1>Airhorn Overlay</h1>
<p>Click Me!</p>
</airhorn-overlay>
<form id="form">
<label><input type="checkbox" id="check_enabled" checked /> Enabled</label>
<label><input type="checkbox" id="check_overflow" /> Overflow hidden</label>
<p>
Requires a browser supporting Custom Elements and Shadow DOM.
For more, <a href="https://github.com/samthor/airhorn-overlay">see GitHub</a>
</p>
</form>
</body>
</html>