mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-07 23:16:52 +00:00
动效移动端特殊处理
This commit is contained in:
@@ -15,8 +15,26 @@ const MOUSE_FOLLOW = () => {
|
||||
loadExternalResource('/js/mouse-follow.js', 'js').then(url => {
|
||||
window.createMouseCanvas && window.createMouseCanvas()({ type, color })
|
||||
})
|
||||
|
||||
return () => {
|
||||
// 在组件卸载时清理资源
|
||||
const mouseFollowElement = document.getElementById('vixcityCanvas')
|
||||
mouseFollowElement?.parentNode?.removeChild(mouseFollowElement)
|
||||
}
|
||||
}, [])
|
||||
|
||||
return <></>
|
||||
return (
|
||||
<>
|
||||
<style global jsx>
|
||||
{`
|
||||
@media (max-width: 600px) {
|
||||
#vixcityCanvas {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
`}
|
||||
</style>
|
||||
</>
|
||||
)
|
||||
}
|
||||
export default MOUSE_FOLLOW
|
||||
|
||||
Reference in New Issue
Block a user