Make weather black

This commit is contained in:
Georgi Gardev
2023-11-18 17:50:36 +02:00
parent 60e6907469
commit cc16c1c5fa
4 changed files with 11 additions and 15 deletions
+4 -3
View File
@@ -1,11 +1,12 @@
.Box { .Box {
background-color: rgba(0, 0, 0, 0.2); background-color: rgba(255, 255, 255, 0.75);
backdrop-filter: blur(10px); backdrop-filter: blur(10px);
color: #bbb; color: #333;
border-radius: 1rem;
transition: background-color 0.2s ease-in-out; transition: background-color 0.2s ease-in-out;
} }
.Hoverable:hover, .Hoverable:focus-within { .Box:hover, .Box:focus-within {
background-color: rgba(255, 255, 255, 1); background-color: rgba(255, 255, 255, 1);
} }
+1 -8
View File
@@ -5,18 +5,11 @@ import style from './Box.module.css';
type BoxProps = { type BoxProps = {
children: JSX.Element; children: JSX.Element;
className?: string; className?: string;
disableHover?: boolean;
}; };
export function Box(props: BoxProps) { export function Box(props: BoxProps) {
return ( return (
<div <div classList={{ [props.className ?? '']: Boolean(props.className), [style.Box]: true }}>
classList={{
[props.className ?? '']: Boolean(props.className),
[style.Box]: true,
[style.Hoverable]: !props.disableHover,
}}
>
{props.children} {props.children}
</div> </div>
); );
+4 -1
View File
@@ -7,6 +7,9 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: .5rem; gap: .5rem;
backdrop-filter: blur(10px);
background-color: rgba(0, 0, 0, 0.2);
} }
.FeelsLike { .FeelsLike {
@@ -24,7 +27,7 @@
} }
.Delimiter { .Delimiter {
border-bottom: 1px solid #bbb ; border-bottom: 1px solid #bbb;
padding-bottom: 1.2rem; padding-bottom: 1.2rem;
margin-bottom: .8rem; margin-bottom: .8rem;
} }
+2 -3
View File
@@ -5,7 +5,6 @@ import { createWeather } from '~/api/open-weather';
import { getTime } from '~/lib/date'; import { getTime } from '~/lib/date';
import style from './Weather.module.css'; import style from './Weather.module.css';
import { Box } from '../ui/Box';
export function Weather() { export function Weather() {
const weather = createWeather(); const weather = createWeather();
@@ -14,7 +13,7 @@ export function Weather() {
const sunset = createMemo(() => getTime((weather()?.sunset ?? 0) * 1000)); const sunset = createMemo(() => getTime((weather()?.sunset ?? 0) * 1000));
return ( return (
<Box className={style.Weather} disableHover> <div class={style.Weather}>
{weather() ? ( {weather() ? (
<> <>
<div class={`${style.WeatherLine} ${style.Delimiter}`}> <div class={`${style.WeatherLine} ${style.Delimiter}`}>
@@ -40,6 +39,6 @@ export function Weather() {
) : ( ) : (
'Loading' 'Loading'
)} )}
</Box> </div>
); );
} }