-
Notifications
You must be signed in to change notification settings - Fork 0
/
site_under_construction_landing.js
85 lines (76 loc) · 1.86 KB
/
site_under_construction_landing.js
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
/*
* This script simply returns a static page to show that a given
* site is under construction.
* You can use it to serve any static page, even a proper landing.
*/
const html = `<!DOCTYPE html>
<html lang="en" class="page">
<head>
<meta charset="UTF-8">
<title>Site Under Construction</title>
<meta name="robots" content="noindex,nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<style>
*,
*:before,
*:after {
box-sizing: border-box;
}
html {
height: 100%;
}
body {
background: #F2994A;
font-family: Roboto, Helvetica, Arial, sans-serif;
height: 100%;
margin: 0;
}
.wrapper {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-style: italic;
margin-top: -1em;
color: #000;
}
.icon {
color: #ffde66;
font-size: 10em;
}
.title {
margin: 30px;
font-size: 2em;
font-weight: 700;
}
.text {
font-size: 18px;
text-align: center;
padding: 20px;
}
</style>
<script src="https://kit.fontawesome.com/ac0f4620f4.js" crossorigin="anonymous"></script>
</head>
<body>
<div class="wrapper">
<div class="icon">
<i class="fa-solid fa-helmet-safety"></i>
</div>
<div class="title">We're sorry, we're still working on our site.</div>
<div class="text">Please check back soon!</div>
</div>
</body>
</html>
`
async function handleRequest(request) {
return new Response(html, {
headers: {
'content-type': 'text/html;charset=UTF-8'
}
})
}
addEventListener('fetch', event => {
return event.respondWith(handleRequest(event.request))
})