fix scroll anim bug?
This commit is contained in:
parent
bb3ba02f0c
commit
0a3ed642d2
2 changed files with 1 additions and 20 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "calckey",
|
||||
"version": "12.119.0-calc.9.21",
|
||||
"version": "12.119.0-calc.9.22",
|
||||
"codename": "aqua",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -178,25 +178,6 @@ onMounted(() => {
|
|||
window.addEventListener('resize', () => {
|
||||
if (window.innerWidth >= DESKTOP_THRESHOLD) isDesktop.value = true;
|
||||
}, { passive: true });
|
||||
|
||||
function createScrollStopListener(element: Window, callback: TimerHandler, timeout: number): () => void {
|
||||
let handle = 0;
|
||||
const onScroll = () => {
|
||||
if (handle) {
|
||||
clearTimeout(handle);
|
||||
}
|
||||
postButton.style.transform = 'scale(0)';
|
||||
handle = setTimeout(callback, timeout || 200);
|
||||
};
|
||||
element.addEventListener('scroll', onScroll, { passive: true });
|
||||
return () => {
|
||||
element.removeEventListener('scroll', onScroll);
|
||||
};
|
||||
}
|
||||
|
||||
createScrollStopListener(window, () => {
|
||||
postButton.style.transform = 'scale(1)';
|
||||
} , 200);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue