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 {
background-color: rgba(0, 0, 0, 0.2);
background-color: rgba(255, 255, 255, 0.75);
backdrop-filter: blur(10px);
color: #bbb;
color: #333;
border-radius: 1rem;
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);
}
+1 -8
View File
@@ -5,18 +5,11 @@ import style from './Box.module.css';
type BoxProps = {
children: JSX.Element;
className?: string;
disableHover?: boolean;
};
export function Box(props: BoxProps) {
return (
<div
classList={{
[props.className ?? '']: Boolean(props.className),
[style.Box]: true,
[style.Hoverable]: !props.disableHover,
}}
>
<div classList={{ [props.className ?? '']: Boolean(props.className), [style.Box]: true }}>
{props.children}
</div>
);
@@ -7,6 +7,9 @@
display: flex;
flex-direction: column;
gap: .5rem;
backdrop-filter: blur(10px);
background-color: rgba(0, 0, 0, 0.2);
}
.FeelsLike {
+2 -3
View File
@@ -5,7 +5,6 @@ import { createWeather } from '~/api/open-weather';
import { getTime } from '~/lib/date';
import style from './Weather.module.css';
import { Box } from '../ui/Box';
export function Weather() {
const weather = createWeather();
@@ -14,7 +13,7 @@ export function Weather() {
const sunset = createMemo(() => getTime((weather()?.sunset ?? 0) * 1000));
return (
<Box className={style.Weather} disableHover>
<div class={style.Weather}>
{weather() ? (
<>
<div class={`${style.WeatherLine} ${style.Delimiter}`}>
@@ -40,6 +39,6 @@ export function Weather() {
) : (
'Loading'
)}
</Box>
</div>
);
}