|
|
|
@ -22,15 +22,24 @@ const scrollToTop = () => { |
|
|
|
|
flog.value = true |
|
|
|
|
const dom = document.querySelector('.gotop') as Element |
|
|
|
|
console.log(dom) |
|
|
|
|
totop.value.style.backgroundPosition = '-6px -145px' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
totop.value.style.backgroundPosition = '-363px -78px' |
|
|
|
|
totop.value.classList.add('top1'); |
|
|
|
|
|
|
|
|
|
}, 200) |
|
|
|
|
setTimeout(() => { |
|
|
|
|
totop.value.style.backgroundPosition = '-316px -78px' |
|
|
|
|
totop.value.classList.remove('top1'); |
|
|
|
|
totop.value.classList.add('top5'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, 400) |
|
|
|
|
setTimeout(() => { |
|
|
|
|
totop.value.style.backgroundPosition = '-6px -80px' |
|
|
|
|
totop.value.classList.remove('top5'); |
|
|
|
|
|
|
|
|
|
totop.value.classList.add('top4'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
totop.value.style.height = '60px' |
|
|
|
|
|
|
|
|
|
scrollTop() |
|
|
|
@ -88,14 +97,20 @@ onMounted(() => { |
|
|
|
|
position: fixed; |
|
|
|
|
bottom: 50px; |
|
|
|
|
right: 50px; |
|
|
|
|
background-image: url('../assets/images/jinglingtu.png'); |
|
|
|
|
background-position: -264px -78px; |
|
|
|
|
// background-image: url('../assets/images/jinglingtu.png'); |
|
|
|
|
background: url('../assets/images/top3.png') no-repeat; |
|
|
|
|
background-size: contain; |
|
|
|
|
// background-position: -264px -78px; |
|
|
|
|
transition: top 0.2s linear; |
|
|
|
|
animation: show 0.5s ease-in-out; |
|
|
|
|
} |
|
|
|
|
.gotop:hover { |
|
|
|
|
transition: background-image 0.2s ease-in; |
|
|
|
|
background-position: -215px -78px; |
|
|
|
|
// background-position: -215px -78px; |
|
|
|
|
background: url('../assets/images/top2.png') no-repeat; |
|
|
|
|
background-size: contain; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
.bian { |
|
|
|
|
animation: bian 0.1s ease-in-out; |
|
|
|
@ -131,4 +146,18 @@ onMounted(() => { |
|
|
|
|
// top: 10%; |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
.top1{ |
|
|
|
|
background: url('../assets/images/top1.png') no-repeat !important; |
|
|
|
|
background-size: contain !important |
|
|
|
|
} |
|
|
|
|
.top4{ |
|
|
|
|
background: url('../assets/images/top4.png') no-repeat !important; |
|
|
|
|
background-size: contain !important |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
.top5{ |
|
|
|
|
background: url('../assets/images/top5.png') no-repeat !important; |
|
|
|
|
background-size: contain !important |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|