forked from gokulkrishh/demo-progressive-web-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
139 lines (127 loc) · 5.99 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Progressive Web Application</title>
<meta http-equiv=X-UA-Compatible content="IE=edge">
<meta name=description content="This web application will work in offline, has a splash screen add to home screen etc,.">
<meta name=viewport content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="theme-color" content="#0288d1">
<meta name="msapplication-TileColor" content="#0288d1">
<meta name="msapplication-TileImage" content="./images/icons/mstile-150x150.png">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Progressive Web Application">
<meta name="application-name" content="Progressive Web Application">
<link rel="apple-touch-icon" href="./images/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" href="./images/icons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="./images/icons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="./manifest.json">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:200,300,400,500,700">
<link rel="stylesheet" href="./css/styles.css">
</head>
<body>
<div class="app app__layout">
<header>
<span class="header__icon">
<svg class="menu__icon no--select" width="24px" height="24px" viewBox="0 0 48 48" fill="#fff">
<path d="M6 36h36v-4H6v4zm0-10h36v-4H6v4zm0-14v4h36v-4H6z"></path>
</svg>
</span>
<span class="header__title no--select">Progressive Web Application</span>
</header>
<div class="menu">
<div class="menu__header"></div>
<ul class="menu__list">
<li><a target="_blank" rel="noopener" href="https://github.com/gokulkrishh">Author</a></li>
<li><a target="_blank" rel="noopener" href="https://github.com/gokulkrishh/demo-progressive-web-app">Source</a></li>
</div>
<div class="menu__overlay"></div>
<div class="app__content">
<!-- <h3>Push Notification: </h3>
<p class="custom__button">
<input id="turn-on-notification" type="checkbox" hidden="hidden" class="custom__input" data-checked="">
<label for="turn-on-notification" class="custom__checkbox"></label>
<button class="no--select send-push" disabled>Send Push Notification</button>
</p> -->
<h3>Fetch API: </h3>
<div class="card">
<div class="card__spinner"></div>
<div class="card__container">
<img alt="avatar" class="card__img">
<p class="card__title"></p>
<p class="card__desc"></p>
<p class="card__temp">
<b>Company: </b><span></span>
</p>
<p class="card__following"><b>Following: </b><span></span></p>
<p class="card__followers"><b>Followers: </b><span></span></p>
<div class="add__to-card">
<input type="text" class="add__input" placeholder="Enter a github username" />
<button class="add__btn">Add</button>
</div>
</div>
</div>
<div class="add__card">
<b><i>Try BG Sync in <a href="https://www.google.com/chrome/browser/canary.html" target="_blank" rel="noopener">Chrome Canary</a> or Chrome in Android</i></b>
<h3>Enable OneTime BG Sync:
<span class="bg-sync__text" hidden>Registered</span>
<p class="custom__button custom__button-bg">
<button class="turn-on-sync">Register</button>
</p>
</h3>
<p>In chrome dev channel, Android</p>
<ul>
<li><b>Step 1:</b> Go offline.</li>
<li><b>Step 2:</b> Register BG Sync from above register button.<li>
<li><b>Step 3:</b> Enter a git username and click add.</li>
<li><b>Step 4:</b> Go online and sync will be triggered when user is gets connectivity and card will be updated.</li>
</ul>
<p>or Emulate via chrome devTools</p>
<ul>
<li><b>Step 1: </b> Go offline and register BG Sync.</li>
<li><b>Step 2: </b>Go to application tab in chrome canary devTools, navigate to serviceWorker tab.</li>
<li><b>Step 3: </b>Go online and click `sync` button to emulate sync.</li>
<li><b>Step 4: </b>Above card will be updated as per your input.</li>
</ul>
</div>
<div class="card__spinner"></div>
<div class="share__container">
<h3>Share API</h3>
<ul>
<li><b>Step 1: </b>Go to <a href="https://play.google.com/store/apps/details?id=com.chrome.dev&hl=en" target="_blank" rel="noopener">Chrome Beta on Android</a></li>
<li><b>Step 2: </b>Toggle <a href="chrome://flags/#enable-experimental-web-platform-features" target="_blank" rel="noopener">chrome://flags/#enable-experimental-web-platform-features</a></li>
<li><b>Step 3: </b>Click below button to share.</li>
</ul>
<button class="share">Share</button>
</div>
<div class="fab fab__push">
<div class="fab__ripple"></div>
<img class="fab__image" src="./images/push-off.png" alt="Push Notification" />
</div>
<!-- Toast msg's -->
<div class="toast__container"></div>
</div>
</div>
<!-- JS Files -->
<script type="text/javascript">
//If serviceWorker supports, then register it.
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register('./serviceWorker.js', { scope: "./" }) //setting scope of sw
.then(function (registration) {
console.info('Service worker is registered!');
})
.catch(function (error) {
console.error('Service worker failed ', error);
});
}
</script>
<script src="./js/toast.js"></script>
<script src="./js/offline.js"></script>
<script src="./js/app.js"></script>
<script src="./js/push.js"></script>
<script src="./js/sync.js"></script>
<script src="./js/share.js"></script>
<script src="./js/menu.js"></script>
</body>
</html>