-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathindex.html
108 lines (89 loc) · 3.47 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.1/css/all.css" integrity="sha384-vp86vTRFVJgpjF9jiIGPEEqYqlDwgyBgEF109VFjmqGmIY/Y4HV4d3Gp2irVfcrp" crossorigin="anonymous">
<title>Secret Peek</title>
<meta name="description" content="Confession's Page">
<meta http-equiv="X-UA-Compatible" content="ie=edge"/>
<link href="https://fonts.googleapis.com/css?family=Dosis:400,700" rel="stylesheet" />
<link href="style.css" rel="stylesheet" />
<link rel="shortcut icon" href="" />
<meta name="theme-color" content="#4dbaa8"/>
<link rel="manifest" href="manifest.json">
<link rel="apple-touch-icon" sizes="180x180" href="public/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="public/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="public/favicon-16x16.png">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#00aba9" />
</head>
<body>
<h1>Welcome To Confession Page😬🤐</h1>
<div id="root"></div>
<div class="container inputarea">
<fieldset>
<legend>Enter details for confessions</legend>
<h1>Name of the person you want to confess</h1>
<input class="card" type="text" name="name" placeholder="Name" autocomplete="off">
<h1>Write your confession here</h1>
<textarea class="card" name="name" maxlength="200" placeholder="Enter confession in 200 max words........."></textarea>
<button type="submit" name="button">🤐Confess😅</button>
</fieldset>
</div>
<script src="scripts.js"></script>
<script>
if('serviceWorker' in navigator) {
/**
* Define if <link rel='next|prev|prefetch'> should
* be preloaded when accessing this page
*/
const PREFETCH = true;
/**
* Define which link-rel's should be preloaded if enabled.
*/
const PREFETCH_LINK_RELS = ['index','next', 'prev', 'prefetch'];
/**
* prefetchCache
*/
function prefetchCache() {
if(navigator.serviceWorker.controller) {
let links = document.querySelectorAll(
PREFETCH_LINK_RELS.map((rel) => {
return 'link[rel='+rel+']';
}).join(',')
);
if(links.length > 0) {
Array.from(links)
.map((link) => {
let href = link.getAttribute('href');
navigator.serviceWorker.controller.postMessage({
action : 'cache',
url : href,
});
});
}
}
}
/**
* Register Service Worker
*/
navigator.serviceWorker
.register('/service-worker.js', { scope: '/' })
.then(() => {
console.log('Service Worker Registered');
});
/**
* Wait if ServiceWorker is ready
*/
navigator.serviceWorker
.ready
.then(() => {
if(PREFETCH) {
prefetchCache();
}
});
}
</script>
</body>
</html>