diff --git a/public/icons/welcome/welcomeLeft.png b/public/icons/welcome/welcomeLeft.png new file mode 100644 index 0000000..cc4218d Binary files /dev/null and b/public/icons/welcome/welcomeLeft.png differ diff --git a/src/layout/grid/WelcomePage.tsx b/src/layout/grid/WelcomePage.tsx index 4137639..4c73ff0 100644 --- a/src/layout/grid/WelcomePage.tsx +++ b/src/layout/grid/WelcomePage.tsx @@ -1,13 +1,16 @@ -import { computed, defineComponent, onMounted, ref, Transition } from 'vue' +import { computed, defineComponent, onMounted, onUnmounted, ref, Transition } from 'vue' import WelcomeImg from '~/icons/welcome/welcomeTitle.png' import DivBgImg from '~/icons/welcome/back.png' import startUseImg from '~/icons/welcome/startUse.png' +import LeftImg from '~/icons/welcome/welcomeLeft.png' +import RightImg from '~/icons/welcome/welcomeRight.png' import useLayoutStore from '../useLayoutStore' import request from '@/utils/request' import useStatisticStore from '@/utils/useStatisticStore' import { v4 as uuid } from 'uuid' import { uploadLocal } from '@/utils/upload' import { videoArr } from '@/config' +import clsx from 'clsx' export const DefaultPageSetting = [ { name: '游戏', @@ -40,6 +43,25 @@ export default defineComponent(() => { const layout = useLayoutStore() const isFirst = ref(false) + // 创建一个响应式变量来存储屏幕宽度 + const width = ref(window.innerWidth) + + const updateWidth = () => { + width.value = window.innerWidth + } + + onMounted(() => { + // 监听窗口大小变化 + window.addEventListener('resize', updateWidth) + }) + + onUnmounted(() => { + // 组件卸载时移除事件监听器 + window.removeEventListener('resize', updateWidth) + }) + const isBig = computed(() => { + return width.value > 1700 + }) onMounted(() => { // 检查 localStorage 是否已经有访问记录 const visited = localStorage.getItem('hasVisited') @@ -86,24 +108,39 @@ export default defineComponent(() => { > 请选择您的初始模式 -