Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
KingSora committed Jun 20, 2024
1 parent 75c07cc commit 1e3e7ce
Show file tree
Hide file tree
Showing 20 changed files with 47 additions and 45 deletions.
2 changes: 1 addition & 1 deletion docs/404.html

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions docs/_next/static/chunks/556-5d1a2eacb450482a.js

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions docs/_next/static/chunks/556-ac2d711a334472fd.js

This file was deleted.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/example/overlayscrollbars/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
rel="stylesheet"
/>
<title>OverlayScrollbars</title>
<script type="module" crossorigin src="/OverlayScrollbars/example/overlayscrollbars/assets/index-QKf60RHu.js"></script>
<script type="module" crossorigin src="/OverlayScrollbars/example/overlayscrollbars/assets/index-CtqGM4I2.js"></script>
<link rel="stylesheet" crossorigin href="/OverlayScrollbars/example/overlayscrollbars/assets/index-ju41cgqM.css">
</head>
<body data-overlayscrollbars-initialize>
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/example/react/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
rel="stylesheet"
/>
<title>OverlayScrollbars & React</title>
<script type="module" crossorigin src="/OverlayScrollbars/example/react/assets/index-BrXiQHG3.js"></script>
<script type="module" crossorigin src="/OverlayScrollbars/example/react/assets/index-BzuohyLf.js"></script>
<link rel="stylesheet" crossorigin href="/OverlayScrollbars/example/react/assets/index-CibgCZHW.css">
</head>
<body data-overlayscrollbars-initialize>
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/example/solid/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
rel="stylesheet"
/>
<title>OverlayScrollbars & Solid</title>
<script type="module" crossorigin src="/OverlayScrollbars/example/solid/assets/index-dVXtlJrl.js"></script>
<script type="module" crossorigin src="/OverlayScrollbars/example/solid/assets/index-SU6Gyr20.js"></script>
<link rel="stylesheet" crossorigin href="/OverlayScrollbars/example/solid/assets/index-fJEZ6-W3.css">
</head>
<body data-overlayscrollbars-initialize>
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/example/svelte/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
rel="stylesheet"
/>
<title>OverlayScrollbars & Svelte</title>
<script type="module" crossorigin src="/OverlayScrollbars/example/svelte/assets/index-dEHn1ry4.js"></script>
<script type="module" crossorigin src="/OverlayScrollbars/example/svelte/assets/index-MTN0tc0m.js"></script>
<link rel="stylesheet" crossorigin href="/OverlayScrollbars/example/svelte/assets/index-DRAvN_0i.css">
</head>
<body data-overlayscrollbars-initialize>
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/example/vue/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
rel="stylesheet"
/>
<title>OverlayScrollbars & Vue</title>
<script type="module" crossorigin src="/OverlayScrollbars/example/vue/assets/index-MKVTpTkV.js"></script>
<script type="module" crossorigin src="/OverlayScrollbars/example/vue/assets/index-oLDcTFEk.js"></script>
<link rel="stylesheet" crossorigin href="/OverlayScrollbars/example/vue/assets/index-e8HPh1Qb.css">
</head>
<body data-overlayscrollbars-initialize>
Expand Down
2 changes: 1 addition & 1 deletion docs/examples.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/examples.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/index.html

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/index.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { animateNumber, noop, setT } from '~/support';
import { animateNumber, noop, selfClearTimeout } from '~/support';
import type { StaticPlugin } from '~/plugins';

export const clickScrollPluginModuleName = '__osClickScrollPlugin';
Expand All @@ -16,9 +16,11 @@ export const ClickScrollPlugin = /* @__PURE__ */ (() => ({
): (() => void) => {
// click scroll animation
let iteration = 0;
let clear = noop;
const animateClickScroll = (clickScrollProgress: number) => {
clear = animateNumber(
let stopAnimation = noop;
const [setFirstIterationPauseTimeout, clearFirstIterationPauseTimeout] =
selfClearTimeout(222);
const animateClickScroll = (clickScrollProgress: number) =>
animateNumber(
clickScrollProgress,
clickScrollProgress + handleLength * Math.sign(startOffset),
133,
Expand All @@ -29,29 +31,29 @@ export const ClickScrollPlugin = /* @__PURE__ */ (() => ({
const mouseBetweenHandleBounds =
relativeTrackPointerOffset >= handleStartBound &&
relativeTrackPointerOffset <= handleEndBound;
const animationCompletedAction = () => {
stopAnimation = animateClickScroll(animationProgress);
};

if (animationCompleted && !mouseBetweenHandleBounds) {
if (iteration) {
animateClickScroll(animationProgress);
animationCompletedAction();
} else {
const firstIterationPauseTimeout = setT(() => {
animateClickScroll(animationProgress);
}, 222);
clear = () => {
clearTimeout(firstIterationPauseTimeout);
};
setFirstIterationPauseTimeout(animationCompletedAction);
}

iteration++;
}
}
);
};

// never stop the first animation iteration because in case of a tap / very fast click scrolling would be canceled instantly
// stopAnimation = animateClickScroll(0);
animateClickScroll(0);

return () => {
// dont clear iteration `0` because in case of a tap it would be canceled instantly
iteration && clear();
clearFirstIterationPauseTimeout();
stopAnimation();
};
},
},
Expand Down

0 comments on commit 1e3e7ce

Please sign in to comment.