-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
50 lines (47 loc) · 1.53 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/webp" href="/Logo.webp" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Playlisty: A Web App to organize Spotify Playlists" />
<meta name="author" content="Rohit Mehta" />
<meta name="keywords" content="Spotify, Playlists" />
<title>Playlisty: Bird Eye Organization of Spotify Playlists</title>
<style>
.offline-message {
text-align: center;
opacity: 1;
display: none;
color: red;
background-color: var(--primary-color-dark);
font-size: 1.5rem;
font-weight: bold;
padding: 1rem;
}
</style>
</head>
<body>
<p class="offline-message">
You are offline. Please check your internet connection.
</p>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<script>
const root = document.getElementById('root');
const offlineMessage = document.querySelector('.offline-message');
// if we go offline, then fade out the app and disable the app
window.addEventListener('offline', () => {
root.style.opacity = 0.5;
root.style.pointerEvents = 'none';
offlineMessage.style.display = 'block';
});
window.addEventListener('online', () => {
root.style.opacity = 1;
root.style.pointerEvents = 'auto';
offlineMessage.style.display = 'none';
alert('You are back online. It would not be a bad idea to refresh just in case');
});
</script>
</body>
</html>