-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
77 lines (73 loc) · 2.42 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Weather Forecast App</title>
<link rel="stylesheet" href="styles.css" />
<!-- Chart.js for visualization -->
<script
src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/js/all.min.js"
crossorigin="anonymous"
></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="app.js" defer></script>
</head>
<body>
<div class="container">
<!-- Header Section -->
<header class="header">
<h1>Weather Forecast</h1>
<div class="location-controls">
<button id="getCurrentLocation" class="btn">
<i class="fas fa-location-arrow"></i> Use My Location
</button>
<div class="search-box">
<input
type="text"
id="locationInput"
placeholder="Enter city name"
aria-label="Enter city name"
/>
<button id="searchLocation" class="btn">Search</button>
</div>
</div>
</header>
<!-- Main Weather Display -->
<main>
<!-- Current Weather Section -->
<section class="current-weather">
<div class="weather-card">
<h2 id="locationName">Loading...</h2>
<div class="weather-info">
<div class="temperature"><span id="currentTemp">--</span>°C</div>
<div class="weather-details">
<p>Humidity: <span id="humidity">--</span>%</p>
<p>Wind: <span id="windSpeed">--</span> km/h</p>
<p>Feels like: <span id="feelsLike">--</span>°C</p>
</div>
</div>
</div>
</section>
<!-- Forecast Section -->
<section class="forecast">
<h2>7-Day Forecast</h2>
<canvas id="forecastChart"></canvas>
<div class="forecast-cards" id="forecastCards"></div>
</section>
</main>
<!-- Loading Spinner -->
<div
id="loadingSpinner"
class="loading-spinner hidden"
role="status"
aria-live="assertive"
>
<div class="spinner"></div>
<span>Loading...</span>
</div>
<!-- Error Messages -->
<div id="errorMessage" class="error-message hidden" role="alert"></div>
</div>
</body>
</html>