Files
cwshed-clone/web/weather-effect.css
T

74 lines
2.3 KiB
CSS

/* Shared precipitation layer; no decorative particles without reported precipitation. */
.weather-field {
--rain: #69849a;
--snow: #fffefa;
--snow-edge: #aab9c5;
position: fixed;
inset: 0;
overflow: hidden;
pointer-events: none;
z-index: 0;
}
.weather-particle {
position: absolute;
top: -3rem;
animation: snow-fall var(--duration, 12s) linear infinite;
}
.weather-particle[data-kind="snow"] {
width: calc(.45rem * var(--size));
height: calc(.45rem * var(--size));
border-radius: 50%;
background: var(--snow);
box-shadow: 0 0 2px var(--snow-edge);
opacity: .85;
}
.weather-particle[data-kind="rain"] {
width: 1.5px;
height: calc(1.6rem * var(--size));
border-radius: 2px;
background: var(--rain);
opacity: .4;
animation-name: rain-fall;
}
.weather-paused .weather-particle { animation-play-state: paused; }
@keyframes snow-fall {
0% { transform: translate3d(0, -4rem, 0); }
50% { transform: translate3d(calc(2rem + var(--drift, 0vw) * .5), 50vh, 0); }
100% { transform: translate3d(var(--drift, 0vw), 112vh, 0); }
}
@keyframes rain-fall {
from { transform: translate3d(0, -4rem, 0) rotate(calc(-1 * var(--rain-angle, 0deg))); }
to { transform: translate3d(var(--drift, 0vw), 112vh, 0) rotate(calc(-1 * var(--rain-angle, 0deg))); }
}
.snow-footer {
--snow-shade: #e8eef0;
--snow-ridge: #f4f7f7;
--snow-front: #fffefa;
margin-top: 48px;
padding-top: 18px;
border-top: 1px solid var(--line);
color: var(--muted);
font-size: .9rem;
}
.snow-footer a { color: inherit; text-underline-offset: 3px; }
.snow-footer a:hover { color: var(--accent); }
.snow-footer a:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.footer-snowdrift {
height: var(--snow-height, 0px);
width: 100%;
overflow: hidden;
pointer-events: none;
}
.footer-snowdrift svg { display: block; width: 100%; height: 100%; }
.snow-bank-shade { fill: var(--snow-shade); }
.snow-bank-ridge { fill: none; stroke: var(--snow-ridge); stroke-width: 2; stroke-linecap: round; }
.weather-page main { margin-bottom: 0; padding-bottom: 0; }
.snow-bank-front { fill: var(--snow-front); }
@media (max-width: 600px) {
.snow-footer { margin-top: 32px; }
}
@media (prefers-reduced-motion: reduce) {
.weather-field .weather-particle { animation: none; top: 8vh; opacity: .16; }
.weather-particle:nth-child(n+8) { display: none; }
}