样式调整

This commit is contained in:
tangly1024
2022-03-23 12:10:30 +08:00
parent 282217561e
commit de8a41e943
18 changed files with 562 additions and 97 deletions

View File

@@ -11,10 +11,11 @@ export default function Live2D () {
const [init, setInit] = useState()
const { switchTheme } = useGlobal()
// if (typeof window !== 'undefined' && !hasLoad) {
// initLive2D()
// hasLoad = true
// }
function handleClick () {
if (BLOG.WIDGET_PET_SWITCH_THEME) {
switchTheme()
}
}
useEffect(() => {
if (!init) {
@@ -23,7 +24,7 @@ export default function Live2D () {
}
}, [init])
return <canvas id="live2d" className='cursor-pointer' width="280" height="250" onClick={switchTheme} alt='切换主题' title='切换主题'/>
return <canvas id="live2d" className='cursor-pointer' width="280" height="250" onClick={handleClick} alt='切换主题' title='切换主题'/>
}
function initLive2D () {