diff --git a/src/routes/zhen/+page.svelte b/src/routes/zhen/+page.svelte index e492cff..f21056c 100644 --- a/src/routes/zhen/+page.svelte +++ b/src/routes/zhen/+page.svelte @@ -1,108 +1,5 @@ - - -
-
- - TEXT!!! -
-
- - + diff --git a/src/routes/zhen/Comps/TopAnimatedBackground.svelte b/src/routes/zhen/Comps/TopAnimatedBackground.svelte new file mode 100644 index 0000000..bbd718d --- /dev/null +++ b/src/routes/zhen/Comps/TopAnimatedBackground.svelte @@ -0,0 +1,109 @@ + + + + +
+
+ + TEXT!!! +
+
+ + diff --git a/src/routes/zhen/Utils/Throttle.js b/src/routes/zhen/Utils/Throttle.js new file mode 100644 index 0000000..318512c --- /dev/null +++ b/src/routes/zhen/Utils/Throttle.js @@ -0,0 +1,21 @@ +export function throttle(callback, wait) { + let timeoutId = null; + let lastExecutedTime = 0; + + return function (...args) { + const currentTime = Date.now(); + + const execute = () => { + lastExecutedTime = currentTime; + callback.apply(this, args); + }; + + if (currentTime - lastExecutedTime >= wait) { + execute(); + } else { + clearTimeout(timeoutId); + timeoutId = setTimeout(execute, wait - (currentTime - lastExecutedTime)); + } + }; + } + \ No newline at end of file