2025-02-02 13:00:27 +07:00
|
|
|
"use client";
|
2025-02-13 13:56:53 +07:00
|
|
|
import { usePathname } from "next/navigation";
|
|
|
|
import { useEffect } from "react";
|
2025-02-13 21:32:58 +07:00
|
|
|
import { init_wow } from "@/utils/initWow";
|
|
|
|
import { parallaxMouseMovement, parallaxScroll } from "@/utils/parallax";
|
|
|
|
import { headerChangeOnScroll } from "@/utils/changeHeaderOnScroll";
|
|
|
|
import Header from "@/components/Header";
|
|
|
|
import Footer from "@/components/Footer";
|
|
|
|
import { navMenuData } from "@/data/menu";
|
|
|
|
import "@/app/globals.css";
|
2025-02-13 13:56:53 +07:00
|
|
|
import "swiper/css";
|
2025-02-13 21:32:58 +07:00
|
|
|
import "jarallax/dist/jarallax.min.css";
|
2025-02-13 13:56:53 +07:00
|
|
|
import "swiper/css/effect-fade";
|
2025-02-13 21:32:58 +07:00
|
|
|
import "react-modal-video/css/modal-video.css";
|
|
|
|
import "photoswipe/dist/photoswipe.css";
|
2025-02-02 13:00:27 +07:00
|
|
|
import "tippy.js/dist/tippy.css";
|
2025-02-13 21:32:58 +07:00
|
|
|
import "@public/assets/css/styles.css";
|
2025-02-28 01:30:56 +07:00
|
|
|
import { Roboto } from "next/font/google";
|
2025-02-02 13:00:27 +07:00
|
|
|
|
2025-02-28 01:30:56 +07:00
|
|
|
const roboto = Roboto({ subsets: ["latin"] });
|
2025-02-02 13:00:27 +07:00
|
|
|
export default function MainLayout({
|
|
|
|
children,
|
|
|
|
}: Readonly<{
|
|
|
|
children: React.ReactNode;
|
|
|
|
}>) {
|
|
|
|
const path = usePathname();
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
init_wow();
|
|
|
|
parallaxMouseMovement();
|
|
|
|
const mainNav = document.querySelector(".main-nav");
|
|
|
|
if (mainNav?.classList.contains("transparent")) {
|
|
|
|
mainNav.classList.add("js-transparent");
|
|
|
|
} else if (!mainNav?.classList?.contains("dark")) {
|
|
|
|
mainNav?.classList.add("js-no-transparent-white");
|
|
|
|
}
|
|
|
|
|
|
|
|
window.addEventListener("scroll", headerChangeOnScroll);
|
|
|
|
parallaxScroll();
|
|
|
|
return () => {
|
|
|
|
window.removeEventListener("scroll", headerChangeOnScroll);
|
|
|
|
};
|
|
|
|
}, [path]);
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
if (typeof window !== "undefined") {
|
|
|
|
// Import the script only on the client side
|
|
|
|
// @ts-ignore
|
|
|
|
import("bootstrap/dist/js/bootstrap.esm").then(() => {
|
|
|
|
// Module is imported, you can access any exported functionality if
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
return (
|
2025-02-28 01:30:56 +07:00
|
|
|
<html lang="en" className={`no-mobile no-touch ${roboto.className}`}>
|
2025-02-02 17:35:02 +07:00
|
|
|
<body className="appear-animate body">
|
|
|
|
<div className="theme-slick">
|
|
|
|
<div className="page" id="top">
|
2025-02-03 12:53:36 +07:00
|
|
|
<nav className="main-nav dark transparent stick-fixed wow-menubar wch-unset">
|
2025-02-06 02:44:31 +07:00
|
|
|
<Header links={navMenuData} />
|
2025-02-02 17:35:02 +07:00
|
|
|
</nav>
|
|
|
|
<main id="main">{children}</main>
|
2025-02-13 01:00:37 +07:00
|
|
|
<Footer />
|
2025-02-02 17:35:02 +07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
2025-02-02 13:00:27 +07:00
|
|
|
</html>
|
|
|
|
);
|
|
|
|
}
|