82 lines
2.6 KiB
TypeScript
82 lines
2.6 KiB
TypeScript
"use client";
|
|
import { usePathname } from "next/navigation";
|
|
import { useEffect } from "react";
|
|
import { init_wow } from "@/utils/initWow";
|
|
import { parallaxMouseMovement, parallaxScroll } from "@/utils/parallax";
|
|
import { headerChangeOnScroll } from "@/utils/changeHeaderOnScroll";
|
|
import "swiper/css";
|
|
import "jarallax/dist/jarallax.min.css";
|
|
import "swiper/css/effect-fade";
|
|
import "react-modal-video/css/modal-video.css";
|
|
import "photoswipe/dist/photoswipe.css";
|
|
import "tippy.js/dist/tippy.css";
|
|
|
|
import "@public/assets/css/styles.css";
|
|
|
|
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 (
|
|
<html lang="en" className="no-mobile no-touch">
|
|
<head>
|
|
<link
|
|
href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap"
|
|
rel="stylesheet"
|
|
/>
|
|
<link
|
|
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;1,400;1,500&display=swap"
|
|
rel="stylesheet"
|
|
/>
|
|
<link
|
|
href="https://fonts.googleapis.com/css2?family=Epilogue:wght@400;500&family=Poppins&display=swap"
|
|
rel="stylesheet"
|
|
/>
|
|
<link
|
|
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
|
|
rel="stylesheet"
|
|
/>
|
|
<link
|
|
href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap"
|
|
rel="stylesheet"
|
|
/>
|
|
<link
|
|
href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap"
|
|
rel="stylesheet"
|
|
/>
|
|
</head>
|
|
<body className="appear-animate body">{children}</body>
|
|
</html>
|
|
);
|
|
}
|