text fix + image fade in

This commit is contained in:
Dreamgineer
2025-11-21 02:29:02 -05:00 Unverified
parent 381be4c36d
commit 8682ff371b
13 changed files with 79 additions and 51 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
"use client";
import { AutoTextSize } from "auto-text-size";
import Image from "next/image";
import Image from "@/components/image";
import type { characters } from "@/lib/db/schema";
// TODO: Change amber type
+28
View File
@@ -0,0 +1,28 @@
"use client";
import NextImage from "next/image";
import { useState } from "react";
import { cn } from "@/lib/utils";
export default function Image({
src,
alt,
className = "",
...props
}: React.ComponentProps<typeof NextImage>) {
const [isLoaded, setIsLoaded] = useState(false);
return (
<NextImage
src={src}
alt={alt}
className={cn(
"transition-opacity duration-700 opacity-0",
isLoaded && "opacity-100",
className,
)}
onLoad={() => setIsLoaded(true)}
{...props}
/>
);
}