mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
feat: updates
This commit is contained in:
parent
8f4c3d8e5b
commit
f340a90117
34 changed files with 781 additions and 323 deletions
|
|
@ -78,9 +78,12 @@ const TabName = () => {
|
|||
}
|
||||
|
||||
const Tabs = () => {
|
||||
const location = useLocation()
|
||||
const navigate = useNavigate()
|
||||
const controls = useAnimation()
|
||||
const [active, setActive] = useState<string>(tabs[0].path)
|
||||
const [active, setActive] = useState<string>(
|
||||
location.pathname || tabs[0].path
|
||||
)
|
||||
|
||||
const animate = async (path: string) => {
|
||||
await controls.start((p: string) =>
|
||||
|
|
@ -96,7 +99,12 @@ const Tabs = () => {
|
|||
key={tab.name}
|
||||
animate={controls}
|
||||
transition={{ ease, duration: 0.18 }}
|
||||
onMouseDown={() => animate(tab.path)}
|
||||
onMouseDown={() => {
|
||||
if ('vibrate' in navigator) {
|
||||
navigator.vibrate(20)
|
||||
}
|
||||
animate(tab.path)
|
||||
}}
|
||||
onClick={() => {
|
||||
setActive(tab.path)
|
||||
navigate(tab.path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue