-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
174 lines (154 loc) · 5 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="theme-color" content="#fff" />
<title>Document</title>
<!-- Minireset -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jgthms/minireset.css@master/minireset.min.css">
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter&display=swap" rel="stylesheet">
<style>
/* Required for Notch CSS */
:root {
--sat: env(safe-area-inset-top);
--sar: env(safe-area-inset-right);
--sab: env(safe-area-inset-bottom);
--sal: env(safe-area-inset-left);
}
body {
padding:
var(--sat) var(--sar) var(--sab) var(--sal);
padding-top: var(--sat);
padding-bottom: var(--sab);
}
.notch--header {
position: fixed;
top: 0px;
width: 100%;
height: auto;
padding-top: var(--sat);
z-index: 100;
}
.notch--footer {
position: fixed;
bottom: 0px;
width: 100%;
height: auto;
padding-bottom: var(--sab);
z-index: 100;
}
/* Code for scroll and key - You do not need to include this. */
.container {
width: 100%;
height: 2000px;
background-color: #FFF5D1;
}
.key {
display: flex;
flex-direction: column;
align-items: flex-start;
padding: 0px;
gap: 10px;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-family: 'Inter';
font-style: normal;
font-weight: 400;
font-size: 20px;
line-height: 24px;
}
.item {
display: flex;
flex-direction: row;
align-items: center;
padding: 0px;
gap: 10px;
}
.swatch {
width: 32px;
height: 32px;
border-radius: 8px;
}
.item--safeTop>.swatch {
background: #001524;
}
.item--header>.swatch {
background: #15616D;
}
.item--footer>.swatch {
background: #FF7D00;
}
.item--safeBottom>.swatch {
background: #78290F;
}
.item--safeBottom>.text::after {
content: var(--sab);
}
button {
font-family: 'Inter';
font-style: normal;
font-weight: 400;
font-size: 16px;
padding: 0px 24px;
height: 44px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
color: #ffffff;
border: none;
background-color: #15616D;
width: 100%;
transition: 300ms;
margin-top: 30px;
}
button:hover {
background-color: #001524;
transition: 300ms;
}
</style>
</head>
<body>
<div class="notch--header" style="background:#001524;">
<header style="background:#15616D; height: 60px;"></header>
</div>
<div class="container"></div>
<div class="key">
<div class="item item--safeTop">
<div class="swatch"></div>
<div class="text" id="swatchTopText">Safe top: --</div>
</div>
<div class="item item--header">
<div class="swatch"></div>
<div class="text">Header: 60px</div>
</div>
<div class="item item--footer">
<div class="swatch"></div>
<div class="text">Footer: 50px</div>
</div>
<div class="item item--safeBottom">
<div class="swatch"></div>
<div class="text" id="swatchBottomText">Safe bottom: --</div>
</div>
<button type="button" onClick="window.location.reload();">Update values</button>
</div>
<div class="notch--footer" style="background:#78290F;">
<footer style="background:#FF7D00; height: 50px;"></footer>
</div>
<script>
var sat = getComputedStyle(document.documentElement).getPropertyValue("--sat");
var sab = getComputedStyle(document.documentElement).getPropertyValue("--sab");
document.getElementById("swatchTopText").innerHTML = "Safe top:" + sat;
document.getElementById("swatchBottomText").innerHTML = "Safe bottom:" + sab;
</script>
</body>
</html>