Weather app with a living sky
A weather screen where the sky is the interface: pick an hour and the colours, sun or moon, clouds and rain change to match, the temperature rolls and ten days of ranges share one scale.
"use client";
import { useRef, useState, type CSSProperties } from "react";
import "./weather-app.css";
export type Sky = "clear" | "cloudy" | "rain" | "storm";
export type Hour = { time: number; temp: number; sky: Sky; rain: number };
export type Day = { name: string; low: number; high: number; sky: Sky };
/** Sky colours through the day: [top, bottom], blended by hour. */
const SKY: Record<number, [string, string]> = {
0: ["#0b1026", "#1c2347"],
5: ["#1c2347", "#4a3d6b"],
7: ["#ff9a6b", "#ffd3a1"],
10: ["#3f8fe0", "#9fd0ff"],
15: ["#2f7fd6", "#a8d4ff"],
18: ["#ff7a45", "#ffc285"],
20: ["#3b2a63", "#b4547a"],
22: ["#0b1026", "#1c2347"],
};
const phase = (h: number) => {
const keys = Object.keys(SKY).map(Number);
let k = keys[0];
for (const x of keys) if (x <= h) k = x;
return SKY[k];
};
const label = (h: number) =>
h === 0 ? "12 am" : h < 12 ? `${h} am` : h === 12 ? "12 pm" : `${h - 12} pm`;
const word: Record<Sky, string> = {
clear: "Clear",
cloudy: "Cloudy",
rain: "Rain",
storm: "Thunderstorms",
};
function Icon({ sky, night }: { sky: Sky; night: boolean }) {
return (
<svg
viewBox="0 0 32 32"
className="gu-wx__icon"
data-sky={sky}
aria-hidden="true"
>
{sky === "clear" ? (
night ? (
<path
className="gu-wx__moon"
d="M20 5a11 11 0 1 0 7 19.5A12 12 0 0 1 20 5Z"
/>
) : (
<g className="gu-wx__sun-ic">
<circle cx="16" cy="16" r="6" />
<path d="M16 3v3M16 26v3M3 16h3M26 16h3M6.8 6.8l2.1 2.1M23.1 23.1l2.1 2.1M6.8 25.2l2.1-2.1M23.1 8.9l2.1-2.1" />
</g>
)
) : (
<>
<path
className="gu-wx__cloud-ic"
d="M9 23h14a5 5 0 0 0 .6-10A7.5 7.5 0 0 0 9.3 15 4 4 0 0 0 9 23Z"
/>
{sky !== "cloudy" && (
<path
className="gu-wx__drops"
d="M12 26l-1 3M17 26l-1 3M22 26l-1 3"
/>
)}
{sky === "storm" && (
<path className="gu-wx__bolt" d="m17 21-3 5h3l-2 4" />
)}
</>
)}
</svg>
);
}
/**
* WeatherApp: a weather screen whose sky is the interface.
* - The background is a living sky for the hour you pick: colours, sun or moon on its arc, drifting clouds, rain.
* - Drag through the hours strip (or use the arrow keys): the sky blends to that hour and the big temperature rolls.
* - Ten days of ranges as bars on one shared scale, with a dot for today's temperature.
*/
export function WeatherApp({
city,
hours,
days,
now = 0,
}: {
city: string;
hours: Hour[];
days: Day[];
/** Index of the current hour in `hours`. */
now?: number;
}) {
const [sel, setSel] = useState(now);
const strip = useRef<HTMLDivElement>(null);
const h = hours[sel];
const night = h.time < 6 || h.time >= 20;
const [top, bottom] = phase(h.time);
// Sun and moon travel along an arc: 6 am on the left, 6 pm on the right (and the moon at night).
const t = night ? ((h.time + 24 - 20) % 24) / 10 : (h.time - 6) / 14;
const arcX = 12 + t * 76;
const arcY = 40 - Math.sin(t * Math.PI) * 26;
const lo = Math.min(...days.map((d) => d.low));
const hi = Math.max(...days.map((d) => d.high));
const pick = (i: number) => {
const n = Math.max(0, Math.min(hours.length - 1, i));
setSel(n);
strip.current
?.querySelectorAll<HTMLButtonElement>("button")
[n]?.scrollIntoView({
inline: "center",
block: "nearest",
behavior: "smooth",
});
};
return (
<div
className="gu-wx"
data-sky={h.sky}
data-night={night}
style={{ "--gu-wx-top": top, "--gu-wx-bottom": bottom } as CSSProperties}
>
<div className="gu-wx__sky" aria-hidden="true">
<span className="gu-wx__stars" />
<span
className="gu-wx__orb"
style={{ left: `${arcX}%`, top: `${arcY}%` }}
/>
<span className="gu-wx__cloud" data-c="1" />
<span className="gu-wx__cloud" data-c="2" />
<span className="gu-wx__cloud" data-c="3" />
<span className="gu-wx__rain" />
<span className="gu-wx__flash" />
</div>
<div className="gu-wx__scroll">
<header className="gu-wx__now">
<p className="gu-wx__city">{city}</p>
<p className="gu-wx__temp" aria-live="polite">
<span className="gu-wx__digits" key={h.temp} aria-hidden="true">
{h.temp}
</span>
<span className="gu-wx__sr">{h.temp} degrees</span>
<span className="gu-wx__deg" aria-hidden="true">
°
</span>
</p>
<p className="gu-wx__cond" key={`${h.sky}${sel}`}>
{word[h.sky]} · {label(h.time)}
</p>
<p className="gu-wx__range">
H:{days[0].high}° L:{days[0].low}°
</p>
</header>
<section className="gu-wx__card" aria-label="Hourly">
<p className="gu-wx__note">
{hours.some((x) => x.rain > 50)
? `Rain likely around ${label(hours.find((x) => x.rain > 50)!.time)}. Gusts up to 30 km/h.`
: "Dry all day. Light wind from the west."}
</p>
<div
className="gu-wx__hours"
ref={strip}
role="listbox"
aria-label="Pick an hour"
aria-activedescendant={`gu-wx-h-${sel}`}
tabIndex={0}
onKeyDown={(e) => {
const k = { ArrowRight: 1, ArrowLeft: -1 }[e.key];
if (k) {
e.preventDefault();
pick(sel + k);
}
}}
>
{hours.map((x, i) => (
<button
key={x.time}
id={`gu-wx-h-${i}`}
type="button"
role="option"
aria-selected={i === sel}
tabIndex={-1}
onClick={() => pick(i)}
style={{ "--i": i } as CSSProperties}
>
<span>{i === now ? "Now" : label(x.time)}</span>
<Icon sky={x.sky} night={x.time < 6 || x.time >= 20} />
{x.rain > 20 && <small>{x.rain}%</small>}
<strong>{x.temp}°</strong>
</button>
))}
</div>
</section>
<section className="gu-wx__card" aria-label="10-day forecast">
<h3>10-day forecast</h3>
<ul className="gu-wx__days">
{days.map((d, i) => (
<li key={`${d.name}-${i}`} style={{ "--i": i } as CSSProperties}>
<span className="gu-wx__day">{i === 0 ? "Today" : d.name}</span>
<Icon sky={d.sky} night={false} />
<span className="gu-wx__lo">{d.low}°</span>
<span
className="gu-wx__bar"
style={
{
"--a": (d.low - lo) / (hi - lo),
"--b": (d.high - lo) / (hi - lo),
...(i === 0
? { "--dot": (h.temp - lo) / (hi - lo) }
: null),
} as CSSProperties
}
aria-label={`${d.low} to ${d.high} degrees`}
>
{i === 0 && <i />}
</span>
<span className="gu-wx__hi">{d.high}°</span>
</li>
))}
</ul>
</section>
<div className="gu-wx__tiles">
<section className="gu-wx__card gu-wx__tile" aria-label="Wind">
<h3>Wind</h3>
<div
className="gu-wx__compass"
style={{ "--deg": `${200 + sel * 6}deg` } as CSSProperties}
>
<span className="gu-wx__needle" />
<strong>{12 + (sel % 5) * 3}</strong>
<small>km/h</small>
</div>
</section>
<section
className="gu-wx__card gu-wx__tile"
aria-label="Chance of rain"
>
<h3>Rain</h3>
<div
className="gu-wx__gauge"
style={{ "--p": h.rain / 100 } as CSSProperties}
>
<strong>{h.rain}%</strong>
</div>
</section>
</div>
</div>
</div>
);
}
Paste this into ChatGPT, Claude, Cursor, v0, Lovable or Bolt. It describes the layout, motion, colors and accessibility and includes the code, so the AI can rebuild it in any framework.
# Build this UI piece: Weather app with a living sky
You are a senior front-end engineer. Recreate the piece below in my project. If I don't say which framework I use, ask once, then build it in that framework (React, Vue, Svelte, Angular, Astro, plain HTML/CSS/JS or anything else). Keep the behavior, motion, colors, spacing and accessibility exactly as described. Keep the code clean and commented for beginners.
## What it is
A phone weather screen (390 × 844) where the sky is the interface. The whole background is a living sky for the selected hour: gradient colours by time of day, a sun (or moon at night) travelling along an arc, drifting clouds, slanted rain and lightning flashes in storms, stars at night. Swiping through the hourly strip and picking an hour blends the sky to it while the big temperature rolls.
## Layout and look
- Background: a vertical gradient from two registered colour properties (@property --top / --bottom, syntax <color>) so they blend over 1.2s. Key colours: midnight #0b1026 → #1c2347, sunrise #ff9a6b → #ffd3a1, day #3f8fe0 → #9fd0ff, sunset #ff7a45 → #ffc285, dusk #3b2a63 → #b4547a. Rain and storms desaturate it.
- Top, centred white text with a soft shadow: city 30px, temperature 104px weight 200, condition and time 19px weight 600, today's high and low.
- Frosted cards (rgba(20,30,60,0.22), blur 18px, 0.5px white inner line, radius 18px):
1. A one-line summary ("Rain likely around 2 pm. Gusts up to 30 km/h.") over a horizontal hour strip: 54px wide pill per hour with the time, an icon, the chance of rain if over 20% (light blue) and the temperature. The selected hour gets a light glass pill.
2. A 10-day list: day, icon, low, a range bar on one shared scale coloured with a blue → yellow → orange gradient that lines up across days, high. Today has a white dot at the selected hour's temperature.
3. Two square tiles: a wind compass (tick ring, needle that turns with a spring, speed in the middle) and a rain gauge (conic ring filled to the chance of rain).
- Icons drawn in SVG: sun (spins slowly when selected), moon, cloud, rain drops (fall when selected), lightning bolt.
## Behavior and motion
1. Picking an hour sets the sky colours, moves the orb along its arc (left/top transitions 1.2s), shows clouds for any sky but clear, rain for rain and storm, lightning flashes every 5s in storms, stars and a moon from 8 pm to 6 am.
2. Temperature digits re-mount and roll in (30px up, blur 6px, spring); the condition text fades in.
3. Cards rise in on load, days stagger in 40ms apart, bars grow from the left.
4. The selected hour scrolls to the centre of the strip (scroll-snap).
## Accessibility
- The hour strip is a listbox with options (aria-selected) and arrow-key control; temperature changes are announced in words. Range bars have labels like "11 to 19 degrees". Sky layers are aria-hidden.
- prefers-reduced-motion: no blending, drifting, rain, lightning or rolling; everything changes at once.
## Props
city, hours ({ time 0–23, temp, sky: "clear" | "cloudy" | "rain" | "storm", rain % }[]), days ({ name, low, high, sky }[]), now (index of the current hour).
## Reference implementation
The original is written in React with one plain CSS file. Dependencies: none (plain React and CSS). Translate it faithfully; do not add new libraries unless my framework needs them.
### WeatherApp.tsx
```tsx
"use client";
import { useRef, useState, type CSSProperties } from "react";
import "./weather-app.css";
export type Sky = "clear" | "cloudy" | "rain" | "storm";
export type Hour = { time: number; temp: number; sky: Sky; rain: number };
export type Day = { name: string; low: number; high: number; sky: Sky };
/** Sky colours through the day: [top, bottom], blended by hour. */
const SKY: Record<number, [string, string]> = {
0: ["#0b1026", "#1c2347"],
5: ["#1c2347", "#4a3d6b"],
7: ["#ff9a6b", "#ffd3a1"],
10: ["#3f8fe0", "#9fd0ff"],
15: ["#2f7fd6", "#a8d4ff"],
18: ["#ff7a45", "#ffc285"],
20: ["#3b2a63", "#b4547a"],
22: ["#0b1026", "#1c2347"],
};
const phase = (h: number) => {
const keys = Object.keys(SKY).map(Number);
let k = keys[0];
for (const x of keys) if (x <= h) k = x;
return SKY[k];
};
const label = (h: number) =>
h === 0 ? "12 am" : h < 12 ? `${h} am` : h === 12 ? "12 pm" : `${h - 12} pm`;
const word: Record<Sky, string> = {
clear: "Clear",
cloudy: "Cloudy",
rain: "Rain",
storm: "Thunderstorms",
};
function Icon({ sky, night }: { sky: Sky; night: boolean }) {
return (
<svg
viewBox="0 0 32 32"
className="gu-wx__icon"
data-sky={sky}
aria-hidden="true"
>
{sky === "clear" ? (
night ? (
<path
className="gu-wx__moon"
d="M20 5a11 11 0 1 0 7 19.5A12 12 0 0 1 20 5Z"
/>
) : (
<g className="gu-wx__sun-ic">
<circle cx="16" cy="16" r="6" />
<path d="M16 3v3M16 26v3M3 16h3M26 16h3M6.8 6.8l2.1 2.1M23.1 23.1l2.1 2.1M6.8 25.2l2.1-2.1M23.1 8.9l2.1-2.1" />
</g>
)
) : (
<>
<path
className="gu-wx__cloud-ic"
d="M9 23h14a5 5 0 0 0 .6-10A7.5 7.5 0 0 0 9.3 15 4 4 0 0 0 9 23Z"
/>
{sky !== "cloudy" && (
<path
className="gu-wx__drops"
d="M12 26l-1 3M17 26l-1 3M22 26l-1 3"
/>
)}
{sky === "storm" && (
<path className="gu-wx__bolt" d="m17 21-3 5h3l-2 4" />
)}
</>
)}
</svg>
);
}
/**
* WeatherApp: a weather screen whose sky is the interface.
* - The background is a living sky for the hour you pick: colours, sun or moon on its arc, drifting clouds, rain.
* - Drag through the hours strip (or use the arrow keys): the sky blends to that hour and the big temperature rolls.
* - Ten days of ranges as bars on one shared scale, with a dot for today's temperature.
*/
export function WeatherApp({
city,
hours,
days,
now = 0,
}: {
city: string;
hours: Hour[];
days: Day[];
/** Index of the current hour in `hours`. */
now?: number;
}) {
const [sel, setSel] = useState(now);
const strip = useRef<HTMLDivElement>(null);
const h = hours[sel];
const night = h.time < 6 || h.time >= 20;
const [top, bottom] = phase(h.time);
// Sun and moon travel along an arc: 6 am on the left, 6 pm on the right (and the moon at night).
const t = night ? ((h.time + 24 - 20) % 24) / 10 : (h.time - 6) / 14;
const arcX = 12 + t * 76;
const arcY = 40 - Math.sin(t * Math.PI) * 26;
const lo = Math.min(...days.map((d) => d.low));
const hi = Math.max(...days.map((d) => d.high));
const pick = (i: number) => {
const n = Math.max(0, Math.min(hours.length - 1, i));
setSel(n);
strip.current
?.querySelectorAll<HTMLButtonElement>("button")
[n]?.scrollIntoView({
inline: "center",
block: "nearest",
behavior: "smooth",
});
};
return (
<div
className="gu-wx"
data-sky={h.sky}
data-night={night}
style={{ "--gu-wx-top": top, "--gu-wx-bottom": bottom } as CSSProperties}
>
<div className="gu-wx__sky" aria-hidden="true">
<span className="gu-wx__stars" />
<span
className="gu-wx__orb"
style={{ left: `${arcX}%`, top: `${arcY}%` }}
/>
<span className="gu-wx__cloud" data-c="1" />
<span className="gu-wx__cloud" data-c="2" />
<span className="gu-wx__cloud" data-c="3" />
<span className="gu-wx__rain" />
<span className="gu-wx__flash" />
</div>
<div className="gu-wx__scroll">
<header className="gu-wx__now">
<p className="gu-wx__city">{city}</p>
<p className="gu-wx__temp" aria-live="polite">
<span className="gu-wx__digits" key={h.temp} aria-hidden="true">
{h.temp}
</span>
<span className="gu-wx__sr">{h.temp} degrees</span>
<span className="gu-wx__deg" aria-hidden="true">
°
</span>
</p>
<p className="gu-wx__cond" key={`${h.sky}${sel}`}>
{word[h.sky]} · {label(h.time)}
</p>
<p className="gu-wx__range">
H:{days[0].high}° L:{days[0].low}°
</p>
</header>
<section className="gu-wx__card" aria-label="Hourly">
<p className="gu-wx__note">
{hours.some((x) => x.rain > 50)
? `Rain likely around ${label(hours.find((x) => x.rain > 50)!.time)}. Gusts up to 30 km/h.`
: "Dry all day. Light wind from the west."}
</p>
<div
className="gu-wx__hours"
ref={strip}
role="listbox"
aria-label="Pick an hour"
aria-activedescendant={`gu-wx-h-${sel}`}
tabIndex={0}
onKeyDown={(e) => {
const k = { ArrowRight: 1, ArrowLeft: -1 }[e.key];
if (k) {
e.preventDefault();
pick(sel + k);
}
}}
>
{hours.map((x, i) => (
<button
key={x.time}
id={`gu-wx-h-${i}`}
type="button"
role="option"
aria-selected={i === sel}
tabIndex={-1}
onClick={() => pick(i)}
style={{ "--i": i } as CSSProperties}
>
<span>{i === now ? "Now" : label(x.time)}</span>
<Icon sky={x.sky} night={x.time < 6 || x.time >= 20} />
{x.rain > 20 && <small>{x.rain}%</small>}
<strong>{x.temp}°</strong>
</button>
))}
</div>
</section>
<section className="gu-wx__card" aria-label="10-day forecast">
<h3>10-day forecast</h3>
<ul className="gu-wx__days">
{days.map((d, i) => (
<li key={`${d.name}-${i}`} style={{ "--i": i } as CSSProperties}>
<span className="gu-wx__day">{i === 0 ? "Today" : d.name}</span>
<Icon sky={d.sky} night={false} />
<span className="gu-wx__lo">{d.low}°</span>
<span
className="gu-wx__bar"
style={
{
"--a": (d.low - lo) / (hi - lo),
"--b": (d.high - lo) / (hi - lo),
...(i === 0
? { "--dot": (h.temp - lo) / (hi - lo) }
: null),
} as CSSProperties
}
aria-label={`${d.low} to ${d.high} degrees`}
>
{i === 0 && <i />}
</span>
<span className="gu-wx__hi">{d.high}°</span>
</li>
))}
</ul>
</section>
<div className="gu-wx__tiles">
<section className="gu-wx__card gu-wx__tile" aria-label="Wind">
<h3>Wind</h3>
<div
className="gu-wx__compass"
style={{ "--deg": `${200 + sel * 6}deg` } as CSSProperties}
>
<span className="gu-wx__needle" />
<strong>{12 + (sel % 5) * 3}</strong>
<small>km/h</small>
</div>
</section>
<section
className="gu-wx__card gu-wx__tile"
aria-label="Chance of rain"
>
<h3>Rain</h3>
<div
className="gu-wx__gauge"
style={{ "--p": h.rain / 100 } as CSSProperties}
>
<strong>{h.rain}%</strong>
</div>
</section>
</div>
</div>
</div>
);
}
```
### weather-app.css
```css
/* Sky colours are registered so they blend smoothly when you change the hour. */
@property --gu-wx-top {
syntax: "<color>";
inherits: true;
initial-value: #3f8fe0;
}
@property --gu-wx-bottom {
syntax: "<color>";
inherits: true;
initial-value: #9fd0ff;
}
.gu-wx {
--ease: cubic-bezier(0.16, 1, 0.3, 1);
--spring: cubic-bezier(0.34, 1.56, 0.64, 1);
position: relative;
height: 100%;
overflow: hidden;
color: #fff;
font-family:
ui-sans-serif,
system-ui,
-apple-system,
"Segoe UI",
sans-serif;
background: linear-gradient(var(--gu-wx-top), var(--gu-wx-bottom));
transition:
--gu-wx-top 1.2s var(--ease),
--gu-wx-bottom 1.2s var(--ease);
}
.gu-wx[data-sky="rain"],
.gu-wx[data-sky="storm"] {
filter: saturate(0.7);
}
/* ---------- The sky ---------- */
.gu-wx__sky {
position: absolute;
inset: 0;
pointer-events: none;
}
.gu-wx__stars {
position: absolute;
inset: 0 0 50%;
background-image:
radial-gradient(1.2px 1.2px at 20% 30%, #fff, transparent),
radial-gradient(1px 1px at 70% 20%, #fff, transparent),
radial-gradient(1.4px 1.4px at 40% 60%, #fff, transparent),
radial-gradient(1px 1px at 85% 55%, #fff, transparent),
radial-gradient(1.2px 1.2px at 10% 75%, #fff, transparent),
radial-gradient(1px 1px at 55% 40%, #fff, transparent),
radial-gradient(1.3px 1.3px at 92% 12%, #fff, transparent);
background-size: 180px 180px;
opacity: 0;
transition: opacity 1.2s;
}
.gu-wx[data-night="true"] .gu-wx__stars {
opacity: 0.85;
animation: gu-wx-twinkle 4s ease-in-out infinite alternate;
}
@keyframes gu-wx-twinkle {
to {
opacity: 0.45;
}
}
.gu-wx__orb {
position: absolute;
width: 74px;
height: 74px;
margin: -37px 0 0 -37px;
border-radius: 50%;
background: radial-gradient(
circle,
#fff7d6 30%,
#ffd36b 60%,
rgb(255 211 107 / 0) 72%
);
box-shadow: 0 0 80px 30px rgb(255 214 120 / 0.45);
transition:
left 1.2s var(--ease),
top 1.2s var(--ease),
background 1.2s,
box-shadow 1.2s;
}
.gu-wx[data-night="true"] .gu-wx__orb {
background: radial-gradient(
circle at 40% 40%,
#f4f1ff 40%,
#c9c6e6 62%,
rgb(201 198 230 / 0) 70%
);
box-shadow: 0 0 60px 16px rgb(200 200 255 / 0.25);
}
.gu-wx__cloud {
position: absolute;
width: 220px;
height: 70px;
border-radius: 999px;
background: rgb(255 255 255 / 0.85);
filter: blur(6px);
opacity: 0;
transition:
opacity 1.2s,
background-color 1.2s;
animation: gu-wx-drift 38s linear infinite;
}
.gu-wx__cloud::before,
.gu-wx__cloud::after {
content: "";
position: absolute;
border-radius: 50%;
background: inherit;
}
.gu-wx__cloud::before {
width: 110px;
height: 110px;
left: 30px;
top: -50px;
}
.gu-wx__cloud::after {
width: 80px;
height: 80px;
left: 110px;
top: -30px;
}
.gu-wx__cloud[data-c="1"] {
top: 110px;
animation-delay: -6s;
}
.gu-wx__cloud[data-c="2"] {
top: 200px;
scale: 0.7;
animation-duration: 52s;
animation-delay: -30s;
}
.gu-wx__cloud[data-c="3"] {
top: 60px;
scale: 1.3;
animation-duration: 64s;
animation-delay: -44s;
}
@keyframes gu-wx-drift {
from {
translate: -260px 0;
}
to {
translate: 460px 0;
}
}
.gu-wx:not([data-sky="clear"]) .gu-wx__cloud {
opacity: 1;
}
.gu-wx[data-sky="clear"] .gu-wx__cloud[data-c="2"] {
opacity: 0.35;
}
.gu-wx[data-sky="rain"] .gu-wx__cloud,
.gu-wx[data-sky="storm"] .gu-wx__cloud {
background: rgb(120 130 150 / 0.9);
}
.gu-wx[data-night="true"] .gu-wx__cloud {
background: rgb(90 96 130 / 0.8);
}
.gu-wx__rain {
position: absolute;
inset: -40px 0 0;
background-image:
linear-gradient(
105deg,
transparent 48%,
rgb(255 255 255 / 0.5) 50%,
transparent 52%
),
linear-gradient(
105deg,
transparent 48%,
rgb(255 255 255 / 0.35) 50%,
transparent 52%
);
background-size:
22px 46px,
34px 70px;
background-position:
0 0,
11px 20px;
opacity: 0;
transition: opacity 0.8s;
}
.gu-wx[data-sky="rain"] .gu-wx__rain,
.gu-wx[data-sky="storm"] .gu-wx__rain {
opacity: 0.6;
animation: gu-wx-rain 0.45s linear infinite;
}
@keyframes gu-wx-rain {
to {
background-position:
-10px 46px,
1px 90px;
}
}
.gu-wx__flash {
position: absolute;
inset: 0;
background: #fff;
opacity: 0;
}
.gu-wx[data-sky="storm"] .gu-wx__flash {
animation: gu-wx-flash 5s 1s infinite;
}
@keyframes gu-wx-flash {
0%,
90%,
94%,
100% {
opacity: 0;
}
91% {
opacity: 0.55;
}
95% {
opacity: 0.35;
}
}
/* ---------- Content ---------- */
.gu-wx__scroll {
position: relative;
height: 100%;
overflow-y: auto;
padding: calc(var(--gu-safe-top, env(safe-area-inset-top, 0px)) + 30px) 16px
calc(var(--gu-safe-bottom, env(safe-area-inset-bottom, 0px)) + 24px);
scrollbar-width: none;
}
.gu-wx__scroll::-webkit-scrollbar {
display: none;
}
.gu-wx__now {
text-align: center;
text-shadow: 0 1px 12px rgb(0 0 0 / 0.18);
margin-bottom: 26px;
}
.gu-wx__now p {
margin: 0;
}
.gu-wx__city {
font-size: 30px;
font-weight: 500;
letter-spacing: -0.01em;
}
.gu-wx__temp {
position: relative;
display: inline-flex;
font-size: 104px;
font-weight: 200;
line-height: 1;
letter-spacing: -0.04em;
margin-left: 0.2em !important;
}
.gu-wx__digits {
display: inline-block;
animation: gu-wx-roll 0.6s var(--spring);
}
@keyframes gu-wx-roll {
from {
translate: 0 30px;
opacity: 0;
filter: blur(6px);
}
}
.gu-wx__cond {
font-size: 19px;
font-weight: 600;
animation: gu-wx-fade 0.5s var(--ease);
}
@keyframes gu-wx-fade {
from {
opacity: 0;
translate: 0 6px;
}
}
.gu-wx__range {
font-size: 18px;
font-weight: 600;
margin-top: 2px !important;
}
.gu-wx__sr {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
}
.gu-wx__card {
margin-top: 12px;
padding: 12px 14px;
border-radius: 18px;
background: rgb(20 30 60 / 0.22);
-webkit-backdrop-filter: blur(18px) saturate(1.4);
backdrop-filter: blur(18px) saturate(1.4);
box-shadow: inset 0 0 0 0.5px rgb(255 255 255 / 0.25);
animation: gu-wx-card 0.8s var(--ease) backwards;
}
.gu-wx__card:nth-of-type(2) {
animation-delay: 0.08s;
}
@keyframes gu-wx-card {
from {
opacity: 0;
translate: 0 18px;
}
}
.gu-wx__card h3 {
margin: 0 0 8px;
font-size: 13px;
font-weight: 600;
opacity: 0.7;
}
.gu-wx__note {
margin: 0 0 10px;
padding-bottom: 10px;
font-size: 14px;
line-height: 1.4;
border-bottom: 0.5px solid rgb(255 255 255 / 0.25);
}
.gu-wx__hours {
display: flex;
gap: 4px;
overflow-x: auto;
scroll-snap-type: x mandatory;
scrollbar-width: none;
outline: none;
margin: 0 -6px;
padding: 2px 6px;
}
.gu-wx__hours::-webkit-scrollbar {
display: none;
}
.gu-wx__hours:focus-visible {
box-shadow: 0 0 0 2px #fff;
border-radius: 12px;
}
.gu-wx__hours button {
flex: none;
display: grid;
justify-items: center;
align-content: start;
gap: 6px;
width: 54px;
min-height: 112px;
padding: 8px 0;
border: 0;
border-radius: 999px;
background: none;
color: inherit;
font-family: inherit;
scroll-snap-align: center;
cursor: pointer;
transition:
background-color 0.4s,
scale 0.4s var(--spring);
}
.gu-wx__hours button:active {
scale: 0.94;
}
.gu-wx__hours button[aria-selected="true"] {
background: rgb(255 255 255 / 0.22);
box-shadow: inset 0 0 0 0.5px rgb(255 255 255 / 0.5);
}
.gu-wx__hours button span {
font-size: 13px;
font-weight: 600;
}
.gu-wx__hours button small {
font-size: 11px;
font-weight: 700;
color: #9fd6ff;
margin-top: -4px;
}
.gu-wx__hours button strong {
font-size: 17px;
font-weight: 600;
margin-top: auto;
}
.gu-wx__icon {
width: 28px;
height: 28px;
overflow: visible;
}
.gu-wx__sun-ic circle {
fill: #ffd84d;
}
.gu-wx__sun-ic path {
stroke: #ffd84d;
stroke-width: 2;
stroke-linecap: round;
}
.gu-wx__hours button[aria-selected="true"] .gu-wx__sun-ic {
animation: gu-wx-spin 8s linear infinite;
transform-origin: 16px 16px;
}
@keyframes gu-wx-spin {
to {
rotate: 360deg;
}
}
.gu-wx__moon {
fill: #f1efff;
}
.gu-wx__cloud-ic {
fill: #fff;
}
.gu-wx__drops {
stroke: #7cc7ff;
stroke-width: 2;
stroke-linecap: round;
}
.gu-wx__hours button[aria-selected="true"] .gu-wx__drops {
animation: gu-wx-drop 0.8s linear infinite;
}
@keyframes gu-wx-drop {
50% {
translate: -1px 2px;
opacity: 0.4;
}
}
.gu-wx__bolt {
fill: none;
stroke: #ffd84d;
stroke-width: 2.2;
stroke-linejoin: round;
stroke-linecap: round;
}
.gu-wx__days {
list-style: none;
margin: 0;
padding: 0;
}
.gu-wx__days li {
display: grid;
grid-template-columns: 58px 30px 34px 1fr 34px;
align-items: center;
gap: 8px;
padding: 8px 0;
border-top: 0.5px solid rgb(255 255 255 / 0.22);
font-size: 17px;
font-weight: 600;
animation: gu-wx-fade 0.6s calc(0.2s + var(--i) * 40ms) var(--ease) backwards;
}
.gu-wx__lo {
opacity: 0.6;
text-align: right;
}
.gu-wx__bar {
--a: 0;
--b: 1;
position: relative;
height: 5px;
border-radius: 5px;
background: rgb(0 0 0 / 0.18);
}
.gu-wx__bar::before {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: calc(var(--a) * 100%);
right: calc((1 - var(--b)) * 100%);
border-radius: inherit;
background: linear-gradient(90deg, #8ad4ff, #ffd84d, #ff8a3d);
background-size: calc(100% / (var(--b) - var(--a) + 0.001)) 100%;
background-position: calc(var(--a) * -100% / (var(--b) - var(--a) + 0.001)) 0;
transform-origin: left;
animation: gu-wx-bar 0.9s 0.3s var(--ease) backwards;
}
@keyframes gu-wx-bar {
from {
scale: 0 1;
}
}
.gu-wx__bar i {
position: absolute;
top: 50%;
left: calc(var(--dot) * 100%);
width: 9px;
height: 9px;
margin: -4.5px 0 0 -4.5px;
border-radius: 50%;
background: #fff;
box-shadow: 0 0 0 2px rgb(20 30 60 / 0.5);
transition: left 0.8s var(--spring);
}
.gu-wx__tiles {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
}
.gu-wx__tile {
display: grid;
}
.gu-wx__compass {
position: relative;
display: grid;
place-items: center;
align-content: center;
width: 120px;
aspect-ratio: 1;
margin: 0 auto;
border-radius: 50%;
background: repeating-conic-gradient(
rgb(255 255 255 / 0.5) 0 1deg,
transparent 1deg 10deg
);
-webkit-mask:
radial-gradient(circle, transparent 47%, #000 48% 56%, transparent 57%),
radial-gradient(circle, #000 46%, transparent 47%);
mask:
radial-gradient(circle, transparent 47%, #000 48% 56%, transparent 57%),
radial-gradient(circle, #000 46%, transparent 47%);
}
.gu-wx__compass strong {
font-size: 26px;
line-height: 1;
}
.gu-wx__compass small {
font-size: 11px;
opacity: 0.8;
}
.gu-wx__needle {
position: absolute;
inset: 0;
rotate: var(--deg);
transition: rotate 1s var(--spring);
}
.gu-wx__needle::before {
content: "";
position: absolute;
left: 50%;
top: 2px;
margin-left: -6px;
border: 6px solid transparent;
border-bottom: 14px solid #fff;
}
.gu-wx__gauge {
position: relative;
display: grid;
place-items: center;
width: 120px;
aspect-ratio: 1;
margin: 0 auto;
}
.gu-wx__gauge::before {
content: "";
position: absolute;
inset: 0;
border-radius: 50%;
background: conic-gradient(
#7cc7ff calc(var(--p) * 100%),
rgb(255 255 255 / 0.2) 0
);
-webkit-mask: radial-gradient(circle, transparent 54%, #000 55%);
mask: radial-gradient(circle, transparent 54%, #000 55%);
}
.gu-wx__gauge strong {
position: relative;
font-size: 26px;
}
@media (prefers-reduced-motion: reduce) {
.gu-wx *,
.gu-wx *::before,
.gu-wx *::after {
animation-duration: 0.01ms !important;
animation-delay: 0ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
.gu-wx {
transition: none;
}
}
```
You might also want
Next piece: Boarding pass appMusic player
Apps, advanced
Run tracker app
Apps, advanced
Smart home dial app
Apps, advanced