-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
152 lines (140 loc) · 6.2 KB
/
Copy pathindex.html
File metadata and controls
152 lines (140 loc) · 6.2 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
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
150
151
152
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dynamic Weather Dashboard</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- Particle Background -->
<div id="particles"></div>
<!-- Main Container -->
<div class="container">
<!-- Header -->
<header class="header">
<div class="header-content">
<h1 class="logo">
<i class="fas fa-cloud-sun"></i>
WeatherSync
</h1>
<div class="header-controls">
<button id="themeToggle" class="theme-toggle" aria-label="Toggle theme">
<i class="fas fa-moon"></i>
</button>
</div>
</div>
</header>
<!-- Search Section -->
<section class="search-section">
<div class="search-container">
<div class="search-box">
<input type="text" id="citySearch" placeholder="Search for a city..." autocomplete="off">
<button id="searchBtn" class="search-btn">
<i class="fas fa-search"></i>
</button>
</div>
<button id="locationBtn" class="location-btn" aria-label="Use current location">
<i class="fas fa-location-crosshairs"></i>
<span>Use My Location</span>
</button>
</div>
<!-- Search Suggestions -->
<div id="suggestions" class="suggestions"></div>
</section>
<!-- Recent Searches -->
<section class="recent-searches" id="recentSearches">
<h3>Recent Searches</h3>
<div class="recent-list" id="recentList"></div>
</section>
<!-- Loading Indicator -->
<div id="loading" class="loading">
<div class="loading-spinner"></div>
<p>Fetching weather data...</p>
</div>
<!-- Error Message -->
<div id="error" class="error hidden">
<i class="fas fa-exclamation-triangle"></i>
<p id="errorMessage">Something went wrong. Please try again.</p>
</div>
<!-- Weather Content -->
<div id="weatherContent" class="weather-content hidden">
<!-- Current Weather -->
<section class="current-weather">
<div class="current-info">
<div class="location">
<h2 id="currentCity">New York, NY</h2>
<p id="currentDate">Monday, January 1, 2024</p>
</div>
<div class="temperature">
<span id="currentTemp">22°</span>
<div class="temp-unit">
<button id="celsius" class="unit-btn active">°C</button>
<button id="fahrenheit" class="unit-btn">°F</button>
</div>
</div>
</div>
<div class="current-details">
<div class="weather-icon">
<i id="mainWeatherIcon" class="fas fa-sun"></i>
</div>
<div class="details-grid">
<div class="detail-item">
<i class="fas fa-eye"></i>
<span>Feels like</span>
<span id="feelsLike">25°C</span>
</div>
<div class="detail-item">
<i class="fas fa-tint"></i>
<span>Humidity</span>
<span id="humidity">65%</span>
</div>
<div class="detail-item">
<i class="fas fa-wind"></i>
<span>Wind Speed</span>
<span id="windSpeed">10 km/h</span>
</div>
<div class="detail-item">
<i class="fas fa-compress-arrows-alt"></i>
<span>Pressure</span>
<span id="pressure">1013 hPa</span>
</div>
<div class="detail-item">
<i class="fas fa-sunrise"></i>
<span>Sunrise</span>
<span id="sunrise">6:30 AM</span>
</div>
<div class="detail-item">
<i class="fas fa-sunset"></i>
<span>Sunset</span>
<span id="sunset">7:45 PM</span>
</div>
</div>
</div>
<div class="weather-description">
<p id="description">Partly Cloudy</p>
</div>
</section>
<!-- Temperature Chart -->
<section class="chart-section">
<h3>5-Day Temperature Trend</h3>
<div class="chart-container">
<canvas id="temperatureChart"></canvas>
</div>
</section>
<!-- 5-Day Forecast -->
<section class="forecast-section">
<h3>5-Day Forecast</h3>
<div class="forecast-grid" id="forecastGrid"></div>
</section>
</div>
</div>
<!-- Scripts -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="script.js"></script>
</body>
</html>