-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
99 lines (85 loc) · 4.06 KB
/
Copy pathindex.html
File metadata and controls
99 lines (85 loc) · 4.06 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SkyCast - Weather App</title>
<!-- Modern typography for a premium look -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<body class="theme-default">
<div class="weather-card slide-up">
<header>
<h1>SkyCast</h1>
<!-- Current Date & Time Display -->
<p class="current-date-time" id="date-time-display">--:--</p>
</header>
<div class="search-box">
<input type="text" placeholder="Enter city name..." class="search-input" id="search-input">
<button class="search-btn" id="search-btn" aria-label="Search">
<svg viewBox="0 0 24 24" width="20" height="20" stroke="currentColor" stroke-width="2" fill="none"
stroke-linecap="round" stroke-linejoin="round">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
</button>
</div>
<button class="location-btn" id="location-btn">
<svg viewBox="0 0 24 24" width="18" height="18" stroke="currentColor" stroke-width="2" fill="none"
stroke-linecap="round" stroke-linejoin="round">
<polygon points="3 11 22 2 13 21 11 13 3 11"></polygon>
</svg>
Use My Location
</button>
<!-- Loading Spinner Container -->
<div class="loader-container" id="loader-container" style="display: none;">
<div class="spinner"></div>
<p id="loader-text">Fetching weather...</p>
</div>
<!-- Stylish Error Box -->
<div class="error-container" id="error-container" style="display: none;">
<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none"
stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="10"></circle>
<line x1="12" y1="8" x2="12" y2="12"></line>
<line x1="12" y1="16" x2="12.01" y2="16"></line>
</svg>
<p id="error-message">Oops! Something went wrong.</p>
</div>
<!-- Main Display Container (Animated states) -->
<div class="weather-display fade-in" id="weather-display" style="display: none;">
<div class="weather-icon-placeholder" id="weather-icon-container">
<img id="dynamic-icon" src="" alt="Weather icon"
style="display: none; width: 120px; height: 120px; filter: drop-shadow(0 8px 12px rgba(0,0,0,0.15));" />
</div>
<h2 class="temperature" id="temperature">--°<span>C</span></h2>
<h3 class="city-name" id="city-name">--</h3>
<p class="weather-condition" id="weather-condition">--</p>
<!-- Unique Hackathon Feature: Smart Suggestion -->
<div class="smart-suggestion" id="smart-suggestion" style="display: none;">
<!-- Text injected via JS -->
</div>
<div class="weather-details">
<div class="detail-item">
<span class="detail-label">Humidity</span>
<span class="detail-value" id="humidity-value">--%</span>
</div>
<div class="detail-item">
<span class="detail-label">Wind</span>
<span class="detail-value" id="wind-value">-- m/s</span>
</div>
</div>
<!-- 5-Day Forecast Section -->
<div class="forecast-container" id="forecast-container">
<!-- Javascript Injection Map -->
</div>
</div>
</div>
<footer class="app-footer">
Built with ❤️ for Hack Club!
</footer>
<!-- Link to the JavaScript file -->
<script src="script.js"></script>
</body>
</html>