-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
149 lines (140 loc) · 4.79 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
140
141
142
143
144
145
146
147
148
149
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Weather App</title>
<!-- tailwind css link -->
<link rel="stylesheet" href="dist/style.css" />
<style>
/* Ensure the video covers the entire background */
.video-background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
z-index: -1;
/* Set z-index to place it behind other elements */
}
</style>
</head>
<body class="bg-gray-900">
<main
class="flex flex-col items-center justify-center min-h-screen p-5 relative"
>
<!-- Video Background -->
<video autoplay muted loop class="video-background">
<source
src="resource/856572-uhd_3840_2160_25fps.mp4"
type="video/mp4"
/>
Your browser does not support the video tag.
</video>
<!-- Header Section -->
<header class="text-center mb-8">
<h1 class="text-5xl text-white font-extrabold">Weather Forecast</h1>
<p class="text-lg text-gray-200">
Your daily weather updates at a glance
</p>
</header>
<!-- Search Section -->
<section
class="flex flex-col sm:flex-row items-center mb-6 w-full max-w-lg relative"
>
<input
type="text"
placeholder="Enter city..."
class="w-full px-4 py-3 rounded-lg focus:outline-none focus:ring-2 focus:ring-yellow-300 shadow-lg"
id="city-input"
/>
<button
id="current-location-button"
class="mt-4 sm:mt-0 sm:ml-4 px-4 py-3 flex items-center justify-center bg-blue-500 text-white rounded-lg hover:bg-blue-600 focus:ring-2 focus:ring-blue-400 shadow-lg"
>
<!-- SVG Icon for Location -->
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
aria-hidden="true"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 2a10 10 0 00-10 10c0 5.52 10 12 10 12s10-6.48 10-12a10 10 0 00-10-10z"
/>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 6h0m0 6h0m0 6h0"
/>
</svg>
</button>
<button
class="mt-4 sm:mt-0 sm:ml-4 px-4 py-3 bg-yellow-500 text-white rounded-lg hover:bg-yellow-600 focus:ring-2 focus:ring-yellow-400 shadow-lg"
id="search-button"
>
Search
</button>
<!-- Recently searched cities -->
<div
id="recent-searches"
class="absolute left-0 right-0 mx-auto bg-white shadow-lg rounded-lg p-2 mt-1 hidden w-48 z-10"
>
<h4 class="font-bold text-gray-800 mb-2">Recently Searched</h4>
<ul id="recent-search-list">
<!-- Recent cities will be added here dynamically -->
</ul>
</div>
</section>
<!-- Weather Display Section -->
<section
class="bg-white rounded-lg shadow-lg p-6 mb-8 w-full max-w-xl text-center"
>
<h2 id="city-name" class="text-4xl font-semibold text-gray-800">
City Name
</h2>
<div class="flex justify-center items-center mt-2">
<img
id="weather-icon"
src="https://cdn-icons-png.flaticon.com/512/3222/3222691.png"
alt="Sunny Weather Icon"
class="w-16 h-16"
/>
<p id="weather-description" class="text-2xl text-gray-700 ml-4">
Sunny, 28°C
</p>
</div>
<div class="flex justify-around mt-4">
<div class="flex flex-col items-center">
<p class="text-gray-700">Wind Speed</p>
<p id="wind-speed" class="text-3xl font-bold">10 km/h</p>
</div>
<div class="flex flex-col items-center">
<p class="text-gray-700">Humidity</p>
<p id="humidity" class="text-3xl font-bold">70%</p>
</div>
<div class="flex flex-col items-center">
<p class="text-gray-700">Pressure</p>
<p id="pressure" class="text-3xl font-bold">1015 hPa</p>
</div>
</div>
</section>
<!-- 5-day Forecast Section -->
<section class="w-full max-w-xl">
<h3 class="text-3xl font-semibold text-white mb-4">5-Day Forecast</h3>
<div
id="forecast-container"
class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-5 gap-4"
></div>
</section>
</main>
<script src="src/app.js"></script>
</body>
</html>