Main file codes are retrived

This commit is contained in:
akash 2025-11-04 14:00:48 +05:30
parent d5e47ef7ae
commit 47f9f780c9
6 changed files with 165 additions and 106 deletions

View File

@ -11,18 +11,8 @@ const App = ({ Component, pageProps }) => {
return () => clearTimeout(timer); return () => clearTimeout(timer);
}, []); }, []);
// ✅ Add accessiBe script
useEffect(() => { useEffect(() => {
if (typeof window === "undefined") return;
const host = window.location.hostname;
const isLocal =
host === "localhost" ||
host === "127.0.0.1" ||
host.endsWith(".vercel.app") ||
host.endsWith(".netlify.app");
if (process.env.NODE_ENV !== "production" || isLocal) return;
const script = document.createElement("script"); const script = document.createElement("script");
script.src = "https://acsbapp.com/apps/app/dist/js/app.js"; script.src = "https://acsbapp.com/apps/app/dist/js/app.js";
script.async = true; script.async = true;
@ -31,11 +21,9 @@ const App = ({ Component, pageProps }) => {
window.acsbJS.init(); window.acsbJS.init();
} }
}; };
document.head.appendChild(script);
return () => { const h = document.querySelector("head") || document.body;
script.remove(); h.appendChild(script);
};
}, []); }, []);
return ( return (

View File

@ -1,26 +1,10 @@
// pages/_document.js import { Html, Head, Main, NextScript } from 'next/document';
import { Html, Head, Main, NextScript } from "next/document";
export default function Document() { export default function Document() {
return ( return (
<Html lang="en"> <Html lang="en">
<Head> <Head>
{/* ✅ CSS Styles */} {/* ✅ Google Tag Manager (script) */}
<link rel="icon" type="image/png" sizes="56x56" href="/assets/images/fav-icon/icon.webp" />
<link rel="stylesheet" href="/assets/css/bootstrap.min.css" />
<link rel="stylesheet" href="/assets/css/animate.css" />
<link rel="stylesheet" href="/assets/css/animated-text.css" />
<link rel="stylesheet" href="/assets/css/all.min.css" />
<link rel="stylesheet" href="/assets/css/flaticon.css" />
<link rel="stylesheet" href="/assets/css/theme-default.css" />
<link rel="stylesheet" href="/assets/css/meanmenu.min.css" />
<link rel="stylesheet" href="/assets/css/owl.transitions.css" />
<link rel="stylesheet" href="/assets/css/bootstrap-icons.css" />
<link rel="stylesheet" href="/assets/css/style.css" />
<link rel="stylesheet" href="/assets/css/magnific-popup.css" />
<link rel="stylesheet" href="/assets/css/responsive.css" />
{/* ✅ Google Tag Manager */}
<script <script
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': __html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
@ -31,8 +15,11 @@ export default function Document() {
}} }}
/> />
{/* ✅ Google Analytics */} {/* ✅ Google Analytics (gtag.js) */}
<script async src="https://www.googletagmanager.com/gtag/js?id=G-1NXE8QSBC8"></script> <script
async
src="https://www.googletagmanager.com/gtag/js?id=G-1NXE8QSBC8"
></script>
<script <script
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: ` __html: `
@ -43,17 +30,26 @@ export default function Document() {
`, `,
}} }}
/> />
</Head>
</Head>
<body> <body>
{/* ✅ Google Tag Manager (noscript) */}
{/* <noscript>
<iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-KWXS2ZM3"
height="0"
width="0"
style={{ display: 'none', visibility: 'hidden' }}
></iframe>
</noscript> */}
<Main /> <Main />
<NextScript /> <NextScript />
{/* ✅ accessiBe (only load in production) */} {/* ✅ accessiBe script */}
<script <script
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: ` __html: `
if (window.location.hostname !== "localhost") {
(function(){ (function(){
var s = document.createElement('script'); var s = document.createElement('script');
var h = document.querySelector('head') || document.body; var h = document.querySelector('head') || document.body;
@ -66,7 +62,6 @@ export default function Document() {
}; };
h.appendChild(s); h.appendChild(s);
})(); })();
}
`, `,
}} }}
/> />

View File

@ -1,17 +1,19 @@
// pages/portfolio.js import Portfolios from "@/src/components/services-details-banner/portfoliobanner";
import Layout from "@/src/layout/Layout"; import Layout from "@/src/layout/Layout";
import dynamic from "next/dynamic"; import dynamic from "next/dynamic";
import Portfolios from "@/src/components/services-details-banner/portfoliobanner";
const CaseStudies = dynamic( const CaseStudies = dynamic(
() => import("@/src/components/isotope/CaseStudies"), () => import("@/src/components/isotope/CaseStudies"),
{ ssr: false } {
ssr: false,
}
); );
const Portfolio = () => {
export default function Portfolio() {
return ( return (
<Layout> <Layout>
<Portfolios pageName="PORTFOLIO" /> <Portfolios pageName={"PORTFOLIO"} />
{/*==================================================*/}
{/* Start consen case study Area */}
{/*==================================================*/}
<div className="case-study-area style-three"> <div className="case-study-area style-three">
<div className="container"> <div className="container">
<CaseStudies /> <CaseStudies />
@ -19,4 +21,5 @@ export default function Portfolio() {
</div> </div>
</Layout> </Layout>
); );
} };
export default Portfolio;

View File

@ -1,11 +1,10 @@
import Head from "next/head"; import Head from "next/head";
const ConsenHead = ({ title, description }) => { const ConsenHead = ({ title, description }) => {
const defaultTitle = "Metatroncube: Leaders in Web & Mobile Dev, SEO, Digital Marketing"; const defaultTitle = "Metatroncube: Leaders in Web &amp; Mobile Dev, SEO, Digital Marketing";
const defaultDescription = const defaultDescription =
"Metatroncube Software Solutions: Your go-to agency for cutting-edge web & app development, SEO, digital marketing, and graphic design services"; "Metatroncube Software Solutions: Your go-to agency for cutting-edge web &amp; app development, SEO, digital marketing, and graphic design services";
// console.log("title", title) console.log("title", title)
// console.log("description", description)
return ( return (
<Head> <Head>
@ -16,12 +15,117 @@ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.cre
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-N29NTKG9');`, }}/> */} })(window,document,'script','dataLayer','GTM-N29NTKG9');`, }}/> */}
{/* End Google Tag Manager */} {/* End Google Tag Manager */}
<meta charSet="UTF-8" /> <meta charSet="UTF-8" />
<meta httpEquiv="x-ua-compatible" content="ie=edge" /> <meta httpEquiv="x-ua-compatible" content="ie=edge" />
<title>{title || defaultTitle}</title> <title>{title || defaultTitle}</title>
<meta name="description" content={description || defaultDescription} /> <meta name="description" content={description || defaultDescription} />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
{/* Favicon */}
<link
rel="icon"
type="image/png"
sizes="56x56"
href="/assets/images/fav-icon/icon.webp"
/>
{/* bootstrap CSS */}
<link
rel="stylesheet"
href="/assets/css/bootstrap.min.css"
type="text/css"
media="all"
/>
{/* carousel CSS */}
{/* <link
rel="stylesheet"
href="assets/css/owl.carousel.min.css"
type="text/css"
media="all"
/> */}
{/* animate CSS */}
<link
rel="stylesheet"
href="/assets/css/animate.css"
type="text/css"
media="all"
/>
{/* animated-text CSS */}
<link
rel="stylesheet"
href="/assets/css/animated-text.css"
type="text/css"
media="all"
/>
{/* font-awesome CSS */}
<link
rel="stylesheet"
href="/assets/css/all.min.css"
type="text/css"
media="all"
/>
{/* font-flaticon CSS */}
<link
rel="stylesheet"
href="/assets/css/flaticon.css"
type="text/css"
media="all"
/>
{/* theme-default CSS */}
<link
rel="stylesheet"
href="/assets/css/theme-default.css"
type="text/css"
media="all"
/>
{/* meanmenu CSS */}
<link
rel="stylesheet"
href="/assets/css/meanmenu.min.css"
type="text/css"
media="all"
/>
{/* transitions CSS */}
<link
rel="stylesheet"
href="/assets/css/owl.transitions.css"
type="text/css"
media="all"
/>
{/* venobox CSS */}
<link
rel="stylesheet"
href="/venobox/venobox.css"
type="text/css"
media="all"
/>
{/* bootstrap icons */}
<link
rel="stylesheet"
href="/assets/css/bootstrap-icons.css"
type="text/css"
media="all"
/>
{/* Main Style CSS */}
<link
rel="stylesheet"
href="/assets/css/style.css"
type="text/css"
media="all"
/>
{/* Main Style CSS */}
<link
rel="stylesheet"
href="/assets/css/magnific-popup.css"
type="text/css"
media="all"
/>
{/* responsive CSS */}
<link
rel="stylesheet"
href="/assets/css/responsive.css"
type="text/css"
media="all"
/>
</Head> </Head>
); );
}; };

View File

@ -1,7 +1,4 @@
"use client";
import { Fragment, useEffect } from "react"; import { Fragment, useEffect } from "react";
import dynamic from "next/dynamic";
import ImageView from "../components/ImageView"; import ImageView from "../components/ImageView";
import VideoPopup from "../components/VideoPopup"; import VideoPopup from "../components/VideoPopup";
import { animation, stickyNav } from "../utils"; import { animation, stickyNav } from "../utils";
@ -9,14 +6,10 @@ import Footer from "./footer/Footer";
import Header from "./header/Header"; import Header from "./header/Header";
import MobileMenu from "./header/MobileMenu"; import MobileMenu from "./header/MobileMenu";
import ScrollTop from "./ScrollTop"; import ScrollTop from "./ScrollTop";
const WOW = dynamic(() => import("wowjs"), { ssr: false });
const Layout = ({ children, header, footer }) => { const Layout = ({ children, header, footer }) => {
useEffect(() => { useEffect(() => {
if (typeof window !== "undefined") {
animation(); animation();
stickyNav(); stickyNav();
}
}, []); }, []);
return ( return (

View File

@ -1,33 +1,9 @@
export const animation = () => { export const animation = () => {
if (typeof window === "undefined") return; if (typeof window !== "undefined") {
window.WOW = require("wowjs");
try {
const WOW = require("wowjs");
const wow = new WOW.WOW({
live: false,
});
wow.init();
if ("MutationObserver" in window) {
const observer = new MutationObserver(() => {
wow.sync();
});
observer.observe(document.body, {
childList: true,
subtree: true,
});
window.addEventListener("beforeunload", () => observer.disconnect());
} else {
setInterval(() => wow.sync(), 2000);
}
} catch (err) {
console.warn("WOW.js initialization failed:", err);
} }
new WOW.WOW().init();
}; };
// Sticky nav // Sticky nav
export const stickyNav = () => { export const stickyNav = () => {
window.addEventListener("scroll", () => { window.addEventListener("scroll", () => {
@ -168,7 +144,7 @@ export const calender = () => {
} }
if (i == rightbox) { if (i == rightbox) {
// console.log(document.querySelectorAll(".all-date ul li")[rightbox]); console.log(document.querySelectorAll(".all-date ul li")[rightbox]);
document document
.querySelectorAll(".all-date ul li") .querySelectorAll(".all-date ul li")
[rightbox].classList.add("b-right"); [rightbox].classList.add("b-right");