-
Notifications
You must be signed in to change notification settings - Fork 16
/
index.html
63 lines (63 loc) · 2.04 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Web Push</title>
<link rel="stylesheet" as="style" crossorigin href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
<link rel="stylesheet" href="/css/common.css">
</head>
<body>
<header>
<h1>Web Push</h1>
<a href="https://github.com/leegeunhyeok/web-push" target="_blank">
<span class="github"></span>
</a>
</header>
<main>
<section>
<h2>👀 Status</h2>
<div class="item">
Current User ID: <u><p class="inline" id="current_user_id"></p></u>
</div>
<div class="item">
ServiceWorker registered: <p class="inline" id="registration_status"></p>
<br>
Push Support: <p class="inline" id="push_support_status"></p>
<br>
Notification permission: <p class="inline" id="notification_permission_status"></p>
</div>
<div class="item">
<pre id="subscription"></pre>
</div>
</section>
<section>
<h2>👉 Subscribe</h2>
<div class="item">
<button onclick="subscribe()">Subscribe</button>
<button onclick="unsubscribe()">Unsubscribe</button>
</div>
</section>
<section>
<h2>🚀 Send Push Notification</h2>
<div class="item">
<input type="text" id="message" value="Hello, World!">
</div>
<div class="item group">
<input class="fill" type="text" id="target_user_id" placeholder="Target User ID">
<button onclick="sendPushNotification()">Send</button>
</div>
<div class="item">
<p class="inline secondary" id="send_status">-</p>
</div>
</section>
<section>
<h2>🔥 Logout</h2>
<div class="item">
<button onclick="logout()">Logout</button>
</div>
</section>
</main>
<script src="/index.js"></script>
</body>
</html>