mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
chore(deps): update motion to latest version
This commit is contained in:
+1
-1
@@ -78,7 +78,7 @@
|
|||||||
"localforage": "^1.10.0",
|
"localforage": "^1.10.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"million": "latest",
|
"million": "latest",
|
||||||
"motion": "^10.17.0",
|
"motion": "^10.18.0",
|
||||||
"publish-browser-extension": "^2.2.1",
|
"publish-browser-extension": "^2.2.1",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-best-gradient-color-picker": "3.0.5",
|
"react-best-gradient-color-picker": "3.0.5",
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
|
|
||||||
let { state, onChange } = $props<{ state: boolean, onChange: (newState: boolean) => void }>();
|
let { state, onChange } = $props<{ state: boolean, onChange: (newState: boolean) => void }>();
|
||||||
|
|
||||||
let handle: HTMLElement | null = null;
|
let handle: HTMLElement | null = null;
|
||||||
|
|
||||||
const toggleSwitch = () => {
|
const toggleSwitch = () => {
|
||||||
@@ -11,20 +10,22 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const springParams = {
|
const springParams = {
|
||||||
stiffness: 700,
|
stiffness: 600,
|
||||||
damping: 30,
|
damping: 30,
|
||||||
};
|
};
|
||||||
|
|
||||||
const animateSwitch = (enabled: boolean) => {
|
const animateSwitch = (enabled: boolean) => {
|
||||||
if (handle) {
|
if (!handle) return;
|
||||||
animate(
|
animate(
|
||||||
handle,
|
handle,
|
||||||
{ x: enabled ? 20 : 0 },
|
{
|
||||||
{
|
x: enabled ? 20 : 0,
|
||||||
easing: spring(springParams),
|
scaleX: [1, 2, 1]
|
||||||
}
|
},
|
||||||
);
|
{
|
||||||
}
|
easing: spring(springParams),
|
||||||
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Trigger animation whenever state changes
|
// Trigger animation whenever state changes
|
||||||
|
|||||||
Reference in New Issue
Block a user