|
|
@ -64,21 +64,46 @@ const showQuestions = async (questions) => { |
|
|
|
|
|
|
|
// 飘屏控制 |
|
|
|
const floatingTopMouseEnter = function () { |
|
|
|
|
|
|
|
const userAgent = navigator.userAgent.toLowerCase(); |
|
|
|
const mobileKeywords = ['mobile', 'android', 'iphone', 'ipad', 'ipod']; |
|
|
|
const isMobile = mobileKeywords.some(keyword => userAgent.includes(keyword)); |
|
|
|
if (isMobile) { |
|
|
|
return |
|
|
|
} |
|
|
|
console.log("鼠标指上去"); |
|
|
|
const floatTop = document.getElementById("top"); |
|
|
|
floatTop.style.animationPlayState = "paused"; |
|
|
|
} |
|
|
|
const floatingTopMouseLeave = function () { |
|
|
|
const userAgent = navigator.userAgent.toLowerCase(); |
|
|
|
const mobileKeywords = ['mobile', 'android', 'iphone', 'ipad', 'ipod']; |
|
|
|
const isMobile = mobileKeywords.some(keyword => userAgent.includes(keyword)); |
|
|
|
if (isMobile) { |
|
|
|
return |
|
|
|
} |
|
|
|
console.log("鼠标指下去"); |
|
|
|
const floatTop = document.getElementById("top"); |
|
|
|
floatTop.style.animationPlayState = "running" |
|
|
|
} |
|
|
|
const floatingBottomMouseEnter = function () { |
|
|
|
const userAgent = navigator.userAgent.toLowerCase(); |
|
|
|
const mobileKeywords = ['mobile', 'android', 'iphone', 'ipad', 'ipod']; |
|
|
|
const isMobile = mobileKeywords.some(keyword => userAgent.includes(keyword)); |
|
|
|
if (isMobile) { |
|
|
|
return |
|
|
|
} |
|
|
|
console.log("鼠标指上去"); |
|
|
|
const floatBottom = document.getElementById("bottom"); |
|
|
|
floatBottom.style.animationPlayState = "paused"; |
|
|
|
} |
|
|
|
const floatingBottomMouseLeave = function () { |
|
|
|
const userAgent = navigator.userAgent.toLowerCase(); |
|
|
|
const mobileKeywords = ['mobile', 'android', 'iphone', 'ipad', 'ipod']; |
|
|
|
const isMobile = mobileKeywords.some(keyword => userAgent.includes(keyword)); |
|
|
|
if (isMobile) { |
|
|
|
return |
|
|
|
} |
|
|
|
console.log("鼠标指下去"); |
|
|
|
const floatBottom = document.getElementById("bottom"); |
|
|
|
floatBottom.style.animationPlayState = "running" |
|
|
|