mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-25 10:19:06 +01:00
fix scroll anim bug?
This commit is contained in:
parent
def4c95090
commit
c96c89f213
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "calckey",
|
"name": "calckey",
|
||||||
"version": "12.119.0-calc.9.21",
|
"version": "12.119.0-calc.9.22",
|
||||||
"codename": "aqua",
|
"codename": "aqua",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -178,25 +178,6 @@ onMounted(() => {
|
|||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
if (window.innerWidth >= DESKTOP_THRESHOLD) isDesktop.value = true;
|
if (window.innerWidth >= DESKTOP_THRESHOLD) isDesktop.value = true;
|
||||||
}, { passive: 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 New Issue
Block a user