diff --git a/assets/ts/utils.ts b/assets/ts/utils.ts index 9cdfef3..8f02ce8 100644 --- a/assets/ts/utils.ts +++ b/assets/ts/utils.ts @@ -1,3 +1,6 @@ +import { type Power3, type gsap } from 'gsap' +import { type Swiper } from 'swiper' + /** * custom helpers */ @@ -36,6 +39,16 @@ export function onVisible( }).observe(element) } +export async function loadGsap(): Promise<[typeof gsap, typeof Power3]> { + const g = await import('gsap') + return [g.gsap, g.Power3] +} + +export async function loadSwiper(): Promise { + const s = await import('swiper') + return s.Swiper +} + /** * custom types */