add: side menu transition

This commit is contained in:
Mahyar Khanbolooki
2025-07-04 16:50:55 +03:30
parent 424373bc3f
commit 43cf76bec2
9 changed files with 255 additions and 56 deletions
+22
View File
@@ -0,0 +1,22 @@
import React from 'react'
type Props = {
} & React.InputHTMLAttributes<HTMLInputElement>;
export default function NightModeSwitch({ checked, onClick }: Props) {
return (
<input
onClick={onClick}
className={`visual-switch relative inline-flex justify-between px-1.5 h-6 w-11 items-center rounded-full transition-colors duration-300 ${checked ? "bg-green-500" : "bg-gray-300"
}`}
>
A
<span
className={`absolute inline-block h-5 w-5 transform rounded-full bg-white transition-transform duration-300 ${checked ? "translate-x-1" : "-translate-x-3.5"
}`}
/>
B
</input>
)
}