|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="UTF-8"> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | + <meta name="description" content="Real-time weather forecasts built with Lume.js — a lightweight reactive library with no build step."> |
| 7 | + <meta property="og:title" content="Weather App - Lume.js"> |
| 8 | + <meta property="og:description" content="Real-time weather forecasts built with Lume.js — a lightweight reactive library with no build step."> |
| 9 | + <meta property="og:type" content="website"> |
| 10 | + <meta property="og:url" content="https://sathvikc.github.io/lume-js/"> |
| 11 | + <title>Weather App - Lume.js</title> |
| 12 | + <link rel="icon" href="./public/favicon.ico" type="image/x-icon"> |
| 13 | + <link rel="stylesheet" href="public/styles/design-system.css"> |
| 14 | + <link rel="stylesheet" href="public/styles/variables.css"> |
| 15 | + <link rel="stylesheet" href="public/styles/base.css"> |
| 16 | + <link rel="stylesheet" href="public/styles/components.css"> |
| 17 | + <link rel="stylesheet" href="styles.css"> |
| 18 | + <script defer src="https://cdn.jsdelivr.net/npm/lume-js@2.2.1/dist/lume.global.js"></script> |
| 19 | + <script defer src="./js/weather-utils.js"></script> |
| 20 | + <script defer src="./js/weather-service.js"></script> |
| 21 | +</head> |
| 22 | +<body> |
| 23 | + <header class="header"> |
| 24 | + <div class="container"> |
| 25 | + <h1 class="header__title">Weather Front</h1> |
| 26 | + </div> |
| 27 | + </header> |
| 28 | + |
| 29 | + <main class="main"> |
| 30 | + <div class="container"> |
| 31 | + <section class="search-section"> |
| 32 | + <form |
| 33 | + class="search-form" |
| 34 | + data-testid="search-form" |
| 35 | + id="search-form" |
| 36 | + > |
| 37 | + <div class="search-form__group"> |
| 38 | + <label for="location-input" class="sr-only">Enter city name</label> |
| 39 | + <input |
| 40 | + type="text" |
| 41 | + id="location-input" |
| 42 | + class="search-input" |
| 43 | + placeholder="Enter city name..." |
| 44 | + data-testid="search-input" |
| 45 | + autocomplete="off" |
| 46 | + data-bind="searchQuery" |
| 47 | + > |
| 48 | + <button |
| 49 | + type="submit" |
| 50 | + class="search-button" |
| 51 | + data-testid="search-button" |
| 52 | + data-disabled="isLoading" |
| 53 | + > |
| 54 | + <span class="search-button__text" data-bind="buttonText"></span> |
| 55 | + <span class="search-button__icon">🌦️</span> |
| 56 | + </button> |
| 57 | + </div> |
| 58 | + </form> |
| 59 | + </section> |
| 60 | + |
| 61 | + <div class="weather-container" data-testid="weather-container"> |
| 62 | + <!-- Loading State --> |
| 63 | + <div |
| 64 | + class="loading" |
| 65 | + data-testid="loading" |
| 66 | + data-show="isLoading" |
| 67 | + hidden |
| 68 | + > |
| 69 | + <div class="loading__spinner"></div> |
| 70 | + <p>Loading weather data...</p> |
| 71 | + </div> |
| 72 | + |
| 73 | + <!-- Error State --> |
| 74 | + <div |
| 75 | + class="error" |
| 76 | + data-testid="error" |
| 77 | + data-show="hasError" |
| 78 | + hidden |
| 79 | + > |
| 80 | + <h2 class="error__title">Unable to load weather data</h2> |
| 81 | + <p class="error__message" data-bind="errorMessage">Please check the city name and try again.</p> |
| 82 | + </div> |
| 83 | + |
| 84 | + <!-- Weather Content --> |
| 85 | + <div |
| 86 | + class="weather-content" |
| 87 | + data-testid="weather-content" |
| 88 | + data-show="showWeather" |
| 89 | + hidden |
| 90 | + > |
| 91 | + <div class="weather-layout"> |
| 92 | + <!-- Current Weather --> |
| 93 | + <section class="current-section"> |
| 94 | + <h2 class="section-title">Current Weather</h2> |
| 95 | + <div class="weather-card" data-testid="current-weather"> |
| 96 | + <div class="current-weather"> |
| 97 | + <h3 |
| 98 | + class="current-weather__location" |
| 99 | + data-testid="current-location" |
| 100 | + data-bind="locationDisplay" |
| 101 | + ></h3> |
| 102 | + <div class="current-weather__main"> |
| 103 | + <div |
| 104 | + class="current-weather__icon" |
| 105 | + data-testid="current-icon" |
| 106 | + data-bind="icon" |
| 107 | + >🌤️</div> |
| 108 | + <div class="current-weather__temp-group"> |
| 109 | + <div |
| 110 | + class="current-weather__temp" |
| 111 | + data-testid="current-temperature" |
| 112 | + data-bind="temperature" |
| 113 | + ></div> |
| 114 | + <div |
| 115 | + class="current-weather__condition" |
| 116 | + data-testid="current-condition" |
| 117 | + data-bind="condition" |
| 118 | + data-class="conditionClass" |
| 119 | + ></div> |
| 120 | + </div> |
| 121 | + </div> |
| 122 | + |
| 123 | + <div class="current-weather__details"> |
| 124 | + <div class="weather-detail"> |
| 125 | + <div class="weather-detail__label">Feels like</div> |
| 126 | + <div |
| 127 | + class="weather-detail__value" |
| 128 | + data-testid="feels-like" |
| 129 | + data-bind="feelsLike" |
| 130 | + ></div> |
| 131 | + </div> |
| 132 | + <div class="weather-detail"> |
| 133 | + <div class="weather-detail__label">Humidity</div> |
| 134 | + <div |
| 135 | + class="weather-detail__value" |
| 136 | + data-testid="humidity" |
| 137 | + data-bind="humidity" |
| 138 | + ></div> |
| 139 | + </div> |
| 140 | + <div class="weather-detail"> |
| 141 | + <div class="weather-detail__label">Wind Speed</div> |
| 142 | + <div |
| 143 | + class="weather-detail__value" |
| 144 | + data-testid="wind-speed" |
| 145 | + data-bind="windSpeed" |
| 146 | + ></div> |
| 147 | + </div> |
| 148 | + <div class="weather-detail"> |
| 149 | + <div class="weather-detail__label">Pressure</div> |
| 150 | + <div |
| 151 | + class="weather-detail__value" |
| 152 | + data-testid="pressure" |
| 153 | + data-bind="pressure" |
| 154 | + ></div> |
| 155 | + </div> |
| 156 | + <div class="weather-detail"> |
| 157 | + <div class="weather-detail__label">Cloud Cover</div> |
| 158 | + <div |
| 159 | + class="weather-detail__value" |
| 160 | + data-testid="cloud-cover" |
| 161 | + data-bind="cloudCover" |
| 162 | + ></div> |
| 163 | + </div> |
| 164 | + <div class="weather-detail"> |
| 165 | + <div class="weather-detail__label">Wind Direction</div> |
| 166 | + <div |
| 167 | + class="weather-detail__value" |
| 168 | + data-testid="wind-direction" |
| 169 | + data-bind="windDirection" |
| 170 | + ></div> |
| 171 | + </div> |
| 172 | + </div> |
| 173 | + </div> |
| 174 | + </div> |
| 175 | + </section> |
| 176 | + |
| 177 | + <!-- Forecast (populated by repeat() in weather-app.js) --> |
| 178 | + <section class="forecast-section"> |
| 179 | + <h2 class="section-title">7-Day Forecast</h2> |
| 180 | + <div class="forecast"> |
| 181 | + <div class="forecast__list" data-testid="forecast-list" id="forecast-list"></div> |
| 182 | + </div> |
| 183 | + </section> |
| 184 | + </div> |
| 185 | + </div> |
| 186 | + </div> |
| 187 | + </div> |
| 188 | + </main> |
| 189 | + |
| 190 | + <footer class="footer"> |
| 191 | + <div class="container"> |
| 192 | + <p class="footer__text"> |
| 193 | + Built with Lume.js • MIT License • |
| 194 | + <a href="https://github.com/Lissy93" class="footer__link" target="_blank" rel="noopener">Alicia Sykes</a> |
| 195 | + </p> |
| 196 | + </div> |
| 197 | + </footer> |
| 198 | + |
| 199 | + <script defer src="js/app.js"></script> |
| 200 | +</body> |
| 201 | +</html> |
0 commit comments