-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
75 lines (66 loc) · 2.71 KB
/
index.html
File metadata and controls
75 lines (66 loc) · 2.71 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dynamic Weather App</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css">
</head>
<body>
<div id="app" class="app-container">
<!-- Header -->
<header>
<h1>Weather Forecast</h1>
<div class="search-container">
<input type="text" id="cityInput" placeholder="Enter city name..." aria-label="City Name Input">
<button id="searchButton" aria-label="Search"><i class="fas fa-search"></i></button>
<button id="locationButton" aria-label="Get my current location weather"><i class="fa-solid fa-location-arrow"></i></button>
</div>
</header>
<!-- Main Content -->
<main id="weatherContainer">
<!-- Initial Message -->
<div id="initialMessage" class="message">
<h2 id="welcomeText">Hi there!</h2>
<p>Enter a city name above or use the GPS button to get started.</p>
</div>
<!-- Loading -->
<div id="loadingSpinner" class="hidden message">
<div class="spinner"></div>
<p>Fetching weather data...</p>
</div>
<!-- Weather Details -->
<div id="weatherDetails" class="hidden weather-card">
<div class="weather-header">
<div>
<h2 id="cityName">City Name</h2>
<p id="weatherDescription">Clear sky</p>
</div>
<img id="weatherIcon" src="" alt="Weather Icon" class="weather-icon">
</div>
<div class="temp-section">
<span id="temperature">25</span>
<span id="tempUnit">°C</span>
</div>
<div class="details-grid">
<div>
<p>Humidity</p>
<p id="humidity">50%</p>
</div>
<div>
<p>Wind Speed</p>
<p id="windSpeed">10 km/h</p>
</div>
</div>
</div>
<!-- Error -->
<div id="errorMessage" class="hidden error-message">
<p>❌ Could not retrieve weather data.</p>
<p id="errorText"></p>
</div>
</main>
</div>
<script src="script.js"></script>
</body>
</html>