add ui cards
@ -69,9 +69,9 @@ export default function Home() {
|
||||
/>
|
||||
|
||||
<h1 className={styles.mainTemp}>
|
||||
{Math.round(weatherData.main.temp)}°
|
||||
{Math.round(weatherData.main.temp)}°C
|
||||
</h1>
|
||||
<p>Feels like {Math.round(weatherData.main.feels_like)}°</p>
|
||||
<p>Feels like {Math.round(weatherData.main.feels_like)}°C</p>
|
||||
|
||||
<p>
|
||||
Time:{" "}
|
||||
@ -86,7 +86,7 @@ export default function Home() {
|
||||
type="text"
|
||||
className={styles.searchInput}
|
||||
defaultValue={defaultValue}
|
||||
placeholder="🔍 Search a city ..."
|
||||
// placeholder="🔍 Search a city ..."
|
||||
value={input}
|
||||
onFocus={(e) => (e.target.value = "")}
|
||||
onChange={(e) => setInput(e.target.value)}
|
||||
@ -94,33 +94,98 @@ export default function Home() {
|
||||
/>
|
||||
{weatherData && (
|
||||
<div className={styles.statsBox}>
|
||||
<div>Stats card1</div>
|
||||
<div>Stats card2</div>
|
||||
<div>Visibility: {weatherData.visibility / 1000} km</div>
|
||||
<div>
|
||||
<p>Humidity: {weatherData.main.humidity}</p>
|
||||
<div className={styles.statsCard}>Stats card1</div>
|
||||
<div className={styles.statsCard}>Stats card2</div>
|
||||
<div className={styles.statsCard}>
|
||||
Visibility: {weatherData.visibility / 1000} km
|
||||
</div>
|
||||
<div className={styles.statsCard}>
|
||||
<p>Humidity</p>
|
||||
<div className={styles.statsCardContent}>
|
||||
<Image
|
||||
alt="weatherIcon"
|
||||
src={`/icons/025-humidity.png`}
|
||||
height="100px"
|
||||
width="100px"
|
||||
/>
|
||||
<div>
|
||||
<h1>{weatherData.main.humidity}</h1>
|
||||
<p>%</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.statsCard}>
|
||||
<p>Wind speed</p>
|
||||
<div className={styles.statsCardContent}>
|
||||
<Image
|
||||
alt="weatherIcon"
|
||||
src={`/icons/017-wind.png`}
|
||||
height="100px"
|
||||
width="100px"
|
||||
/>
|
||||
<div>
|
||||
<h1>{weatherData.wind.speed}</h1>
|
||||
<p>Km/h</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/* <div className={styles.statsCard}>
|
||||
<p>
|
||||
Wind:{" "}
|
||||
{` ${weatherData.wind.speed} ${degToCompass(
|
||||
weatherData.wind.deg
|
||||
)}`}
|
||||
</p>
|
||||
<Image
|
||||
alt="weatherIcon"
|
||||
src={`/icons/wind.png`}
|
||||
height="100px"
|
||||
width="100px"
|
||||
/>
|
||||
</div> */}
|
||||
<div className={styles.statsCard}>
|
||||
<p>Sunrise</p>
|
||||
<div className={styles.statsCardContent}>
|
||||
<Image
|
||||
alt="weatherIcon"
|
||||
src={`/icons/040-sunrise.png`}
|
||||
height="100px"
|
||||
width="100px"
|
||||
/>
|
||||
<div>
|
||||
<h1>4:31</h1>
|
||||
<p>AM</p>
|
||||
</div>
|
||||
<div style={{ padding: "20px", border: "1px solid grey" }}>
|
||||
<p>
|
||||
</div>
|
||||
|
||||
{/* <p>
|
||||
Sunrise:{" "}
|
||||
{new Date(
|
||||
weatherData.sys.sunrise * 1000 + weatherData.timezone * 1000
|
||||
).toLocaleString("en-US")}
|
||||
</p>
|
||||
<p>
|
||||
</p> */}
|
||||
{/* <p>
|
||||
Sunset:{" "}
|
||||
{new Date(weatherData.sys.sunset * 1000).toLocaleString(
|
||||
"en-US"
|
||||
)}
|
||||
</p>
|
||||
</p> */}
|
||||
</div>
|
||||
<div className={styles.statsCard}>
|
||||
<p>Sunset</p>
|
||||
<div className={styles.statsCardContent}>
|
||||
<Image
|
||||
alt="weatherIcon"
|
||||
src={`/icons/041-sunset.png`}
|
||||
height="100px"
|
||||
width="100px"
|
||||
/>
|
||||
<div>
|
||||
<h1>10:02</h1>
|
||||
<p>PM</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
BIN
public/icons/014-compass.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
public/icons/017-wind.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
public/icons/025-humidity.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
public/icons/040-sunrise.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
public/icons/041-sunset.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
public/icons/png/png/001-cloud.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
public/icons/png/png/002-cloud-1.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
public/icons/png/png/003-rainy.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
public/icons/png/png/004-rainy-1.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
public/icons/png/png/005-hail.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
public/icons/png/png/006-snowy.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
public/icons/png/png/007-night.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
public/icons/png/png/008-storm.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
public/icons/png/png/009-storm-1.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
public/icons/png/png/010-windy.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
public/icons/png/png/011-cloudy.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
public/icons/png/png/012-snowy-1.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
public/icons/png/png/013-storm-2.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
public/icons/png/png/014-compass.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
public/icons/png/png/015-day.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
public/icons/png/png/016-flood.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
public/icons/png/png/017-foog.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
public/icons/png/png/018-flood-1.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
public/icons/png/png/019-night-1.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
public/icons/png/png/020-storm-3.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
public/icons/png/png/021-night-2.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
public/icons/png/png/022-night-3.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
public/icons/png/png/023-windy-1.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
public/icons/png/png/024-night-4.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
public/icons/png/png/025-humidity.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
public/icons/png/png/026-rainbow.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
public/icons/png/png/027-rainbow-1.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
public/icons/png/png/028-drop.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
public/icons/png/png/029-shooting-star.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
public/icons/png/png/030-wind.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
public/icons/png/png/031-snowflake.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
public/icons/png/png/032-star.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
public/icons/png/png/033-hurricane.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
public/icons/png/png/034-cloudy-1.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
public/icons/png/png/035-snowy-2.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
public/icons/png/png/036-storm-4.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
public/icons/png/png/037-cloudy-2.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
public/icons/png/png/038-cloudy-3.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
public/icons/png/png/039-sun.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
public/icons/png/png/040-sunrise.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
public/icons/png/png/041-sunset.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
public/icons/png/png/042-cold.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
public/icons/png/png/043-warm.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
public/icons/png/png/044-warm-1.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
public/icons/png/png/045-thunder.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
public/icons/png/png/046-tornado.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
public/icons/png/png/047-tornado-1.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
public/icons/png/png/048-umbrella.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
public/icons/png/png/049-windy-2.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
public/icons/png/png/050-windy-3.png
Normal file
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
BIN
public/icons/wind.png
Normal file
After Width: | Height: | Size: 11 KiB |
@ -44,6 +44,13 @@
|
||||
|
||||
.statsCard {
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
border-radius: 20px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.statsCardContent {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
|
||||
.mainTemp {
|
||||
|