diff --git a/src/app.d.ts b/src/app.d.ts index d967425..fd825fe 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -33,4 +33,56 @@ declare type PhotoGridAbout = { id: string title: string } +} + + +/** + * Notifcation + */ +declare interface Notification { + title: string + name: string + image: string + timeout?: number + id?: number +} + + +/** + * Smooth Scroll Options + */ +declare interface smoothScrollOptions { + hash: string + changeHash?: boolean + event?: MouseEvent + callback?: Function +} + + +/** + * Swipe options + */ +interface SwipeOptions { + travelX?: number + travelY?: number + timeframe?: number +} + + +/** + * Reveal Animation + */ +declare interface RevealOptions { + enable?: boolean + options?: TransitionOptions + children?: string | HTMLElement + animation: any +} +// Options interface +declare interface TransitionOptions { + threshold?: number + duration?: number + stagger?: number + delay?: number + easing?: any } \ No newline at end of file diff --git a/src/utils/functions/index.ts b/src/utils/functions/index.ts index 3cafec7..057e99b 100644 --- a/src/utils/functions/index.ts +++ b/src/utils/functions/index.ts @@ -1,4 +1,4 @@ -import { easeInOutQuart } from './easing' +import { quartInOutFunc } from '$animations/easings' /** @@ -32,7 +32,7 @@ export const debounce = (func: Function, timeout: number) => { * @description Split a string into words or characters * @returns string[] */ - export const splitText = (text: string, mode: string = 'words'): string[] => { +export const splitText = (text: string, mode: string = 'words'): string[] => { // Split by words if (mode === 'words') { const words = text @@ -199,10 +199,4 @@ export const smoothScroll = async ({ hash, callback, changeHash = true, event }: if (changeHash) location.hash = hash callback && callback() }) -} -type smoothScrollOptions = { - hash: string - changeHash?: boolean - event?: MouseEvent - callback?: Function } \ No newline at end of file diff --git a/src/utils/functions/notifications.ts b/src/utils/functions/notifications.ts index d8d223d..1750638 100644 --- a/src/utils/functions/notifications.ts +++ b/src/utils/functions/notifications.ts @@ -1,13 +1,5 @@ import { cartNotifications } from '$utils/stores/shop' -interface Notification { - title: string - name: string - image: string - timeout?: number - id?: number -} - /** * Add a notification diff --git a/src/utils/interactions/swipe.ts b/src/utils/interactions/swipe.ts index a967789..8c17cf1 100644 --- a/src/utils/interactions/swipe.ts +++ b/src/utils/interactions/swipe.ts @@ -83,14 +83,4 @@ export const swipe = ( node.removeEventListener('pointerup', onUp) } } -} - - -/** - * Types - */ -interface SwipeOptions { - travelX?: number - travelY?: number - timeframe?: number } \ No newline at end of file