Add better image styles
This commit is contained in:
@ -11,10 +11,12 @@ type Props = {
|
||||
colors: (ImageColor & { color: Color })[];
|
||||
alt: string;
|
||||
src: string;
|
||||
};
|
||||
nsfw: boolean;
|
||||
}
|
||||
|
||||
export default function GlowingImageWithToggle({ variant, colors, alt, src }: Props) {
|
||||
export default function GlowingImageWithToggle({ variant, colors, alt, src, nsfw }: Props) {
|
||||
const [animate, setAnimate] = useState(true);
|
||||
const [revealed, setRevealed] = useState(!nsfw)
|
||||
|
||||
return (
|
||||
<div className="relative w-full max-w-fit">
|
||||
@ -24,6 +26,7 @@ export default function GlowingImageWithToggle({ variant, colors, alt, src }: Pr
|
||||
colors={colors}
|
||||
src={src}
|
||||
animate={animate}
|
||||
revealed={revealed}
|
||||
/>
|
||||
|
||||
<div className="flex flex-col items-center gap-4 pt-8">
|
||||
@ -32,6 +35,15 @@ export default function GlowingImageWithToggle({ variant, colors, alt, src }: Pr
|
||||
<Label htmlFor="animate">Animate glow</Label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{nsfw && (
|
||||
<div className="flex flex-col items-center gap-4 pt-8">
|
||||
<div className="flex items-center gap-2">
|
||||
<Switch id="animate" checked={revealed} onCheckedChange={setRevealed} />
|
||||
<Label htmlFor="animate">Reveal NSFW</Label>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user