diff --git a/src/assets/images/index/agreement.png b/src/assets/images/index/agreement.png new file mode 100644 index 0000000..e3fb24d Binary files /dev/null and b/src/assets/images/index/agreement.png differ diff --git a/src/assets/images/index/bg.jpg b/src/assets/images/index/bg.jpg new file mode 100644 index 0000000..acb86e5 Binary files /dev/null and b/src/assets/images/index/bg.jpg differ diff --git a/src/assets/images/index/prize-btn.png b/src/assets/images/index/prize-btn.png new file mode 100644 index 0000000..44d0434 Binary files /dev/null and b/src/assets/images/index/prize-btn.png differ diff --git a/src/assets/images/index/rule-btn.png b/src/assets/images/index/rule-btn.png new file mode 100644 index 0000000..bb38c97 Binary files /dev/null and b/src/assets/images/index/rule-btn.png differ diff --git a/src/assets/images/index/start-btn.png b/src/assets/images/index/start-btn.png new file mode 100644 index 0000000..58ef8d8 Binary files /dev/null and b/src/assets/images/index/start-btn.png differ diff --git a/src/assets/images/index/title.png b/src/assets/images/index/title.png new file mode 100644 index 0000000..03cc389 Binary files /dev/null and b/src/assets/images/index/title.png differ diff --git a/src/assets/images/music-off.png b/src/assets/images/music-off.png new file mode 100644 index 0000000..dc25257 Binary files /dev/null and b/src/assets/images/music-off.png differ diff --git a/src/assets/images/music-on.png b/src/assets/images/music-on.png new file mode 100644 index 0000000..64597a0 Binary files /dev/null and b/src/assets/images/music-on.png differ diff --git a/src/assets/images/qa/answer-box-1.png b/src/assets/images/qa/answer-box-1.png new file mode 100644 index 0000000..92a74d0 Binary files /dev/null and b/src/assets/images/qa/answer-box-1.png differ diff --git a/src/assets/images/qa/answer-box-2.png b/src/assets/images/qa/answer-box-2.png new file mode 100644 index 0000000..31ffa58 Binary files /dev/null and b/src/assets/images/qa/answer-box-2.png differ diff --git a/src/assets/images/qa/bg.jpg b/src/assets/images/qa/bg.jpg new file mode 100644 index 0000000..96b38ea Binary files /dev/null and b/src/assets/images/qa/bg.jpg differ diff --git a/src/assets/images/qa/question.png b/src/assets/images/qa/question.png new file mode 100644 index 0000000..b6aec99 Binary files /dev/null and b/src/assets/images/qa/question.png differ diff --git a/src/components/Index.vue b/src/components/Index.vue index a33a380..bd74ae5 100644 --- a/src/components/Index.vue +++ b/src/components/Index.vue @@ -4,8 +4,8 @@ import { debounceTap } from "@/plugins"; const emit = defineEmits(["IndexPage"]); -const count = ref(0); -const show = (event) => { + +const start = (event) => { debounceTap(event.target, () => { Toast.success("开发中!"); }); @@ -16,7 +16,11 @@ const show = (event) => {
- +
+
+
+
+
@@ -24,14 +28,43 @@ const show = (event) => { diff --git a/src/components/Question.vue b/src/components/Question.vue index 0c6dfce..623aed1 100644 --- a/src/components/Question.vue +++ b/src/components/Question.vue @@ -1,24 +1,3 @@ - - + + \ No newline at end of file diff --git a/src/page/Home/App.vue b/src/page/Home/App.vue index 72c4e9e..9439e19 100644 --- a/src/page/Home/App.vue +++ b/src/page/Home/App.vue @@ -11,7 +11,7 @@ import gsap from "gsap"; import Loading from "@/components/Loading"; import Index from "@/components/Index"; import Question from "@/components/Question"; -import { bgm } from "@/plugins"; +import { createBGM } from "@/plugins"; const showLoad = ref(false); const loadFn = (item) => { @@ -36,7 +36,7 @@ const questionFn = (item) => { }; onMounted(() => { - bgm(); + // createBGM(); }); @@ -48,13 +48,21 @@ onMounted(() => { #musicBtn { @include pos(60px, 60px, 80px, 40px); - @include bg_pos("music-icon.png"); z-index: 99; } +// 音乐-on样式 +.music-on { + @include bg_pos("music-on.png"); +} + +// 音乐-off样式 +.music-off { + @include bg_pos("music-off.png"); +} + .home { @include box(750px, 100vh); - // position: relative; overflow: hidden; margin: 0 auto; } diff --git a/src/plugins/index.js b/src/plugins/index.js index 5a559b1..a88c00b 100644 --- a/src/plugins/index.js +++ b/src/plugins/index.js @@ -13,7 +13,7 @@ const sound = new Howl({ }); // 背景音乐 -export function bgm(autoPlay) { +export function createBGM() { const musicNode = createVNode( 'div', { @@ -21,18 +21,23 @@ export function bgm(autoPlay) { id: 'musicBtn', onClick: () => { let auduoEle = document.querySelector("#audio") + let musicBox = document.querySelector("#musicBtn") if (auduoEle.paused) { auduoEle.play() audioAni.play() + musicBox.classList.add('music-on') + musicBox.classList.remove('music-off') } else { + gsap.set('#musicBtn', { rotation: '0deg' }) auduoEle.pause() audioAni.pause() + musicBox.classList.add('music-off') + musicBox.classList.remove('music-on') } }, }, ) - const audioNode = createVNode( 'audio', { @@ -41,12 +46,12 @@ export function bgm(autoPlay) { src: new URL(`@/assets/media/bgm.mp3`, import.meta.url).href, autoPlay: true, loop: true, - }, ) render(musicNode, document.body); render(audioNode, document.querySelector("#musicBtn")); + document.querySelector("#musicBtn").classList.add('music-on') let audioAni = gsap.timeline({ paused: true }) audioAni.to('#musicBtn', { duration: 10, rotation: "+=360", repeat: -1, ease: 'none' }) setTimeout(() => {