diff --git a/components/Live2D.js b/components/Live2D.js index 2e2011b6..74522cc2 100644 --- a/components/Live2D.js +++ b/components/Live2D.js @@ -36,14 +36,14 @@ function initLive2D() { window.removeEventListener('scroll', initLive2D) setTimeout(() => { // 加载 waifu.css live2d.min.js waifu-tips.js - if (screen.width >= 768) { - Promise.all([ - // loadExternalResource('https://cdn.zhangxinxu.com/sp/demo/live2d/live2d/js/live2d.js', 'js') - loadExternalResource('https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/live2d.min.js', 'js') - ]).then((e) => { - // https://github.com/xiazeyu/live2d-widget-models - loadlive2d('live2d', BLOG.WIDGET_PET_LINK) - }) - } + // if (screen.width >= 768) { + Promise.all([ + // loadExternalResource('https://cdn.zhangxinxu.com/sp/demo/live2d/live2d/js/live2d.js', 'js') + loadExternalResource('https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/live2d.min.js', 'js') + ]).then((e) => { + // https://github.com/xiazeyu/live2d-widget-models + loadlive2d('live2d', BLOG.WIDGET_PET_LINK) + }) + // } }, 300) } diff --git a/components/SideBarDrawer.js b/components/SideBarDrawer.js index ad988503..dac43d75 100644 --- a/components/SideBarDrawer.js +++ b/components/SideBarDrawer.js @@ -9,10 +9,6 @@ import React from 'react' const SideBarDrawer = ({ children, isOpen, onOpen, onClose, className }) => { const router = useRouter() React.useEffect(() => { - // 页面渲染后删除hidden属性 - // const sideBarWrapperElement = document.getElementById('sidebar-wrapper') - // sideBarWrapperElement?.classList?.remove('hidden') - const sideBarDrawerRouteListener = () => { switchSideDrawerVisible(false) } @@ -25,29 +21,30 @@ const SideBarDrawer = ({ children, isOpen, onOpen, onClose, className }) => { // 点击按钮更改侧边抽屉状态 const switchSideDrawerVisible = (showStatus) => { if (showStatus) { - onOpen() + onOpen && onOpen() } else { - onClose() + onClose && onClose() } const sideBarDrawer = window.document.getElementById('sidebar-drawer') const sideBarDrawerBackground = window.document.getElementById('sidebar-drawer-background') if (showStatus) { - sideBarDrawer.classList.replace('-ml-80', 'ml-0') + sideBarDrawer.classList.replace('-ml-56', 'ml-0') sideBarDrawerBackground.classList.replace('hidden', 'block') } else { - sideBarDrawer.classList.replace('ml-0', '-ml-80') + sideBarDrawer.classList.replace('ml-0', '-ml-56') sideBarDrawerBackground.classList.replace('block', 'hidden') } } - return