-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
62 lines (54 loc) · 1.61 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Weather App</title>
<!-- Google Fonts -->
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;500;600&display=swap"
rel="stylesheet"
/>
<!-- Stylesheet -->
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" />
<link rel="manifest" href="manifest.json" />
</head>
<body>
<div class="wrapper">
<div class="current-data-child3 animate__animated animate__bounceInLeft">
<!-- <div class="shape shape-1"></div>
<div class="shape shape-2"></div> -->
<div class="container">
<div class="search-container">
<input
type="text"
placeholder="Enter a city name"
id="city"
value="karachi"
/>
<button id="search-btn">Search</button>
</div>
<div id="result"></div>
</div>
</div>
</div>
<!-- Script -->
<script src="serviceWorker.js"></script>
<script src="script.js"></script>
<script>
window.addEventListener("load", () => {
registerSW();
});
// Register the Service Worker
async function registerSW() {
if ("serviceWorker" in navigator) {
try {
await navigator.serviceWorker.register("serviceworker.js");
} catch (e) {
console.log("SW registration failed");
}
}
}
</script>
</body>
</html>