add: side menu transition
This commit is contained in:
@@ -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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user