-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
186 lines (183 loc) · 5.03 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>
<meta name="description" content="Device Orientation Demo" />
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image" />
<meta
property="twitter:image"
content="https://demos.ubilabs.net/device-orientation/share.png"
/>
<meta name="twitter:site" content="@ubilabs" />
<!-- OpenGraph -->
<meta property="og:type" content="website" />
<meta property="og:title" content="Device Orientation Demo" />
<!-- replace one live deployement is done -->
<meta
property="og:image"
content="https://demos.ubilabs.net/device-orientation/share.png"
/>
<meta
property="og:url"
content="https://demos.ubilabs.net/device-orientation"
/>
<meta
property="og:description"
content="This demo shows how to use the Geolocation- and DeviceOrientation APIs
to display a user's location on a google map."
/>
<link
rel="stylesheet"
href="https://ui-components.ubilabs.com/css/v1/ubilabs-styles.css"
/>
<title>Device Orientation Demo</title>
<style>
body {
margin: 0;
width: 100vw;
height: 100vh;
height: calc(var(--vh, 1vh) * 100);
padding-bottom: env(safe-area-inset-bottom);
}
#map {
width: 100vw;
height: 100vh;
}
.wordmark-link {
color: black;
font-size: 13px;
display: flex;
flex-direction: row;
margin-top: 1.5em;
width: fit-content;
align-items: baseline;
align-self: flex-end;
white-space: nowrap;
}
.wordmark-link:hover {
text-decoration: none;
}
.ubi-wordmark {
height: 1.3em;
padding-left: 0.5em;
}
.info {
position: absolute;
top: 2em;
left: 2em;
width: 400px;
max-width: 90%;
padding: 2em 1.5em;
background: white;
border-radius: 5px;
box-shadow: 0 0 10px 5px rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
}
.info button {
margin: 0 auto;
margin-top: 1em;
}
p:last-child {
margin-bottom: 0;
}
.header {
font-size: 20px;
margin-bottom: 1em;
display: flex;
place-items: center;
}
.ubi-logo {
height: 18px;
margin-right: 0.25em;
}
.permission-info {
margin-left: -1.5em;
margin-right: -1.5em;
margin-bottom: 1em;
padding: 1.5em;
background: rgba(0, 0, 0, 0.04);
}
.privacy-note {
color: rgba(0, 0, 0, 0.54);
}
@media only screen and (max-width: 600px) {
.app {
flex-direction: column;
height: 100%;
display: flex;
}
#map {
width: 100%;
height: 100%;
}
.info {
position: initial;
background: white;
width: 100%;
max-width: 100%;
display: flex;
flex-direction: column;
}
}
</style>
</head>
<body>
<div class="app">
<div id="map"></div>
<div class="info">
<h1 class="header">Device Orientation Demo</h1>
<p>
This demo shows how to use the Geolocation- and DeviceOrientation APIs
to display a user's location on a google map.
</p>
<div
class="permission-info permission-info--granted"
data-state="granted"
style="display: none"
>
<p>
You have granted this page permission to access to your location
which will now be shown on the map.
</p>
</div>
<div
class="permission-info permission-info--prompt"
data-state="prompt"
style="display: none"
>
<p>
You haven't yet granted the required permissions, or we couldn't
check if the permissions have been granted. Press the button below
to start the process.
</p>
<button>Let's go!</button>
</div>
<div
class="permission-info permission-info--denied"
data-state="denied"
style="display: none"
>
<p>
You have denied the permission for this site to use your location.
This can be changed in the website settings which you can usually
reach via the button to the left of the URL.
</p>
</div>
<p class="privacy-note">
All data is kept local and will never leave your device.
</p>
<a href="https://ubilabs.com/" target="_blank" class="wordmark-link">
made by
<img src="/ubi-wordmark.svg" class="ubi-wordmark" alt="ubilabs" />
</a>
</div>
</div>
<script type="module" src="./src/main.ts"></script>
</body>
</html>