Initial Montech monorepo: Nuxt landing, Vue admin, Nest API.
Scaffold SSR site with CMS/blog/gallery/SEO admin and deploy configs for montech.ir. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import Lenis from "lenis";
|
||||
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
if (!import.meta.client) return;
|
||||
const lenis = new Lenis({ lerp: 0.09, smoothWheel: true });
|
||||
let raf = 0;
|
||||
const loop = (time: number) => {
|
||||
lenis.raf(time);
|
||||
raf = requestAnimationFrame(loop);
|
||||
};
|
||||
raf = requestAnimationFrame(loop);
|
||||
nuxtApp.hook("app:unmounted", () => {
|
||||
cancelAnimationFrame(raf);
|
||||
lenis.destroy();
|
||||
});
|
||||
return {
|
||||
provide: { lenis },
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user