初始化页面结构

This commit is contained in:
Andy Leong
2024-01-09 17:27:03 +08:00
parent eddb210dc5
commit ad07452795
11 changed files with 78 additions and 117 deletions

View File

@@ -1,6 +1,14 @@
// 常用的方法
import gsap from 'gsap'
import { Howl, Howler } from 'howler';
// 初始化
const btnEnable = ref(true) //按钮可点击状态
// 音效初始化
const sound = new Howl({
src: [new URL(`@/assets/media/click.mp3`, import.meta.url).href]
});
//是否在微信环境
export function isWX() {
@@ -269,13 +277,14 @@ export function addPointByBd(des) {
}
// 防抖函数
const btnEnable = ref(true)
export function debounceTap(target, callbacks, timeScale = 1) {
if (!btnEnable.value) return false
btnEnable.value = false;
let createAni = () => {
let timeline = new gsap.timeline({
onStart: () => { },
onStart: () => {
sound.play()
},
onComplete: () => {
callbacks && callbacks();
btnEnable.value = true;