Tweak loading styles (#440)
This commit is contained in:
parent
b1d9a82d00
commit
23660c5ad1
2 changed files with 98 additions and 90 deletions
|
|
@ -105,6 +105,14 @@
|
||||||
.skeleton {
|
.skeleton {
|
||||||
*[class^="text-"] {
|
*[class^="text-"] {
|
||||||
color: transparent;
|
color: transparent;
|
||||||
@apply rounded-md bg-foreground/20 select-none;
|
@apply rounded-md bg-foreground/20 select-none animate-pulse;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skeleton-bg {
|
||||||
|
@apply bg-foreground/10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skeleton-div {
|
||||||
|
@apply bg-foreground/20 animate-pulse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import cx from "classnames";
|
import cx from "classnames";
|
||||||
import { addHours, format, isWithinInterval } from "date-fns";
|
import { format, isWithinInterval } from "date-fns";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
interface WeatherAtLocation {
|
interface WeatherAtLocation {
|
||||||
|
|
@ -247,7 +247,7 @@ export function Weather({
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cx(
|
className={cx(
|
||||||
"flex flex-col gap-4 rounded-2xl p-4",
|
"flex flex-col gap-4 rounded-2xl p-4 skeleton-bg",
|
||||||
{
|
{
|
||||||
"bg-blue-400": isDay,
|
"bg-blue-400": isDay,
|
||||||
},
|
},
|
||||||
|
|
@ -260,7 +260,7 @@ export function Weather({
|
||||||
<div className="flex flex-row gap-2 items-center">
|
<div className="flex flex-row gap-2 items-center">
|
||||||
<div
|
<div
|
||||||
className={cx(
|
className={cx(
|
||||||
"size-10 rounded-full",
|
"size-10 rounded-full skeleton-div",
|
||||||
{
|
{
|
||||||
"bg-yellow-300": isDay,
|
"bg-yellow-300": isDay,
|
||||||
},
|
},
|
||||||
|
|
@ -286,7 +286,7 @@ export function Weather({
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className={cx(
|
className={cx(
|
||||||
"size-6 rounded-full",
|
"size-6 rounded-full skeleton-div",
|
||||||
{
|
{
|
||||||
"bg-yellow-300": isDay,
|
"bg-yellow-300": isDay,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue