Skip to content

Commit

Permalink
animation
Browse files Browse the repository at this point in the history
  • Loading branch information
dani-moreno committed Nov 29, 2024
1 parent f5aaf0e commit 11e58ad
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/experimental/Utilities/PrivateBox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { usePrivacyMode } from "@/lib/privacyMode"
import { cn } from "@/lib/utils"
import { motion } from "framer-motion"
import { FC, PropsWithChildren } from "react"

export const PrivateBox: FC<PropsWithChildren> = ({ children }) => {
Expand All @@ -8,13 +9,22 @@ export const PrivateBox: FC<PropsWithChildren> = ({ children }) => {
return (
<div
className={cn(
"inline-flex",
"inline-flex ring-1 ring-inset ring-transparent transition-all duration-150",
enabled &&
"select-none overflow-hidden rounded-sm ring-1 ring-inset ring-f1-border-secondary"
"select-none overflow-hidden rounded-sm ring-f1-border-secondary"
)}
aria-hidden={enabled}
>
<div className={cn(enabled && "opacity-30 blur")}>{children}</div>
<motion.div
className="h-full w-full"
animate={{
opacity: enabled ? 0.3 : 1,
filter: enabled ? "blur(5px)" : "blur(0px)",
}}
transition={{ duration: 0.15 }}
>
{children}
</motion.div>
</div>
)
}

0 comments on commit 11e58ad

Please sign in to comment.