File size: 9,292 Bytes
72790d4
d3e44c7
 
 
 
 
 
d8804ab
72790d4
d8804ab
 
 
 
587459d
bd47f11
72790d4
d3e44c7
72790d4
 
 
 
 
 
d8804ab
 
 
 
 
 
587459d
 
 
 
 
 
d8804ab
 
 
 
 
d3e44c7
 
 
 
 
72790d4
d3e44c7
d3bcad8
d3e44c7
 
587459d
d3e44c7
587459d
d3e44c7
 
587459d
 
d8804ab
d3bcad8
d3e44c7
 
 
d8804ab
 
 
 
 
 
d3bcad8
d8804ab
 
 
 
 
 
d3bcad8
d3e44c7
 
d8804ab
 
72790d4
 
d8804ab
 
587459d
 
d8804ab
bd47f11
72790d4
 
 
 
bd47f11
 
d3e44c7
bd47f11
 
 
 
 
 
 
 
 
 
d3e44c7
bd47f11
 
72790d4
d3e44c7
 
 
 
 
 
2cf1dfe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d8804ab
587459d
d8804ab
2cf1dfe
 
 
 
 
 
d3e44c7
2cf1dfe
 
 
587459d
 
 
 
 
 
 
d3e44c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
587459d
 
 
 
 
d3e44c7
 
 
 
 
 
 
 
 
 
 
587459d
d8804ab
72790d4
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
import type { Metadata } from "next";
import {
  Geist_Mono,
  Geist,
  Instrument_Serif,
  IBM_Plex_Sans_Arabic,
} from "next/font/google";
import localFont from "next/font/local";
import "./globals.css";
import { Header } from "@/components/header";
import { Footer } from "@/components/footer";
import { cn } from "@/lib/utils";
import { ThemeProvider } from "@/components/theme-provider";
import Script from "next/script";
import { cookies, headers } from "next/headers";

const geist = Geist({ subsets: ["latin"], variable: "--font-sans" });

const geistMono = Geist_Mono({
  variable: "--font-geist-mono",
  subsets: ["latin"],
});

const instrumentSerif = Instrument_Serif({
  variable: "--font-display",
  subsets: ["latin"],
  weight: "400",
});

const ibmPlexArabic = IBM_Plex_Sans_Arabic({
  variable: "--font-arabic",
  subsets: ["arabic"],
  weight: ["300", "400", "500", "600", "700"],
});

const fastHand = localFont({
  src: "./fonts/FastHand.otf",
  variable: "--font-fast-hand",
});

const SITE_URL = (
  process.env.NEXT_PUBLIC_SITE_URL ??
  "https://darkslategrey-nightingale-132659.hostingersite.com"
).replace(/\/$/, "");

export const metadata: Metadata = {
  metadataBase: new URL(SITE_URL),
  title: "HUBAPI — Pre-Launch Marketing Showcase & Waitlist",
  description:
    "One planned gateway for multiple LLM providers. Access leading AI models through a unified API layer.",
  alternates: {
    canonical: SITE_URL,
    languages: {
      en: `${SITE_URL}/?lang=en`,
      ar: `${SITE_URL}/?lang=ar`,
    },
  },
  openGraph: {
    title: "HUBAPI — Pre-Launch Marketing Showcase",
    description:
      "One planned gateway for multiple LLM providers. Standard REST API, multi-model access, unified billing, and a developer-first dashboard.",
    url: SITE_URL,
    siteName: "HUBAPI",
    images: [
      {
        url: "/og-image.png",
        width: 1200,
        height: 630,
        alt: "HUBAPI — Pre-Launch Marketing Showcase",
      },
    ],
    type: "website",
  },
  twitter: {
    card: "summary_large_image",
    title: "HUBAPI — Pre-Launch Marketing Showcase",
    description:
      "One planned gateway for multiple LLM providers. Standard REST API, multi-model access, unified billing, and a developer-first dashboard.",
    images: ["/og-image.png"],
  },
};

import { SplitFlapAudioProvider } from "@/components/ui/split-flap-text";
import { WaitlistSocialProofTicker } from "@/components/WaitlistSocialProofTicker";
import { LanguageProvider } from "@/components/LanguageContext";
import { SkipToContent } from "@/components/SkipToContent";

export default async function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  const cookieStore = await cookies();
  const langCookie = cookieStore.get("hubapi_lang")?.value;

  let lang = "en";
  if (langCookie === "ar" || langCookie === "en") {
    lang = langCookie;
  } else {
    const headersList = await headers();
    const acceptLanguage = headersList.get("accept-language") || "";
    if (acceptLanguage.toLowerCase().includes("ar")) {
      lang = "ar";
    }
  }

  const dir = lang === "ar" ? "rtl" : "ltr";

  return (
    <html
      lang={lang}
      dir={dir}
      className={cn("font-sans", geist.variable)}
      suppressHydrationWarning
    >
      <head>
        {/* Google Tag Manager */}
        <Script
          id="gtm-head"
          strategy="afterInteractive"
          dangerouslySetInnerHTML={{
            __html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WHZJJT9H');`,
          }}
        />
        {/* End Google Tag Manager */}
      </head>
      <body
        className={`${geistMono.variable} ${fastHand.variable} ${instrumentSerif.variable} ${ibmPlexArabic.variable} font-sans antialiased bg-background`}
      >
        {/* Google Tag Manager (noscript) */}
        <noscript>
          <iframe
            src="https://www.googletagmanager.com/ns.html?id=GTM-WHZJJT9H"
            height="0"
            width="0"
            style={{ display: "none", visibility: "hidden" }}
          />
        </noscript>
        {/* End Google Tag Manager (noscript) */}
        <LanguageProvider>
          <ThemeProvider
            attribute="class"
            defaultTheme="dark"
            enableSystem
            disableTransitionOnChange
          >
            <SplitFlapAudioProvider>
              {/* JSON-LD Organization Schema for SEO */}
              <script
                type="application/ld+json"
                dangerouslySetInnerHTML={{
                  __html: JSON.stringify({
                    "@context": "https://schema.org",
                    "@type": "Organization",
                    name: "HUBAPI",
                    url: SITE_URL,
                    logo: `${SITE_URL}/logo.png`,
                    description:
                      "HUBAPI is a planned neural API gateway and automation platform designed to offer smart routing, cost optimization, and security shield for LLMs (pre-launch preview).",
                    sameAs: [
                      "https://github.com/hubapi",
                      "https://twitter.com/hubapi",
                    ],
                  }),
                }}
              />
              {/* JSON-LD SoftwareApplication Schema for Rich Search Results */}
              <script
                type="application/ld+json"
                dangerouslySetInnerHTML={{
                  __html: JSON.stringify({
                    "@context": "https://schema.org",
                    "@type": "SoftwareApplication",
                    name: "HUBAPI",
                    applicationCategory: "DeveloperApplication",
                    operatingSystem: "Web",
                    description:
                      "A unified API gateway for accessing multiple LLM providers with one API key, smart routing, usage tracking, and unified billing.",
                    url: `${SITE_URL}/`,
                    offers: {
                      "@type": "Offer",
                      price: "0",
                      priceCurrency: "USD",
                      availability: "https://schema.org/PreOrder",
                    },
                  }),
                }}
              />
              {/* Viewport Elegant Top Border */}
              <div
                className="fixed top-0 left-0 right-0 h-[1px] bg-gradient-to-r from-transparent via-primary/20 dark:via-primary/35 to-transparent pointer-events-none z-50"
                aria-hidden="true"
              />

              {/* Symmetrical Vertical Guides (Thin elegant lines) */}
              <div
                className="fixed inset-y-0 left-[8%] w-[1px] bg-gradient-to-b from-transparent via-primary/3 dark:via-primary/6 to-transparent pointer-events-none -z-40"
                aria-hidden="true"
              />
              <div
                className="fixed inset-y-0 right-[8%] w-[1px] bg-gradient-to-b from-transparent via-primary/3 dark:via-primary/6 to-transparent pointer-events-none -z-40"
                aria-hidden="true"
              />

              {/* Premium Dark Grain Background Overlay */}
              <div className="noise-grain" aria-hidden="true" />

              {/* Soft Ambient Spotlight Glow (Linear/Vercel style top-centered light) */}
              <div
                className="fixed top-0 left-1/2 -translate-x-1/2 w-[1200px] h-[600px] bg-gradient-to-b from-primary/6 dark:from-primary/12 via-primary/2 dark:via-primary/4 to-transparent blur-[160px] rounded-full -z-40 pointer-events-none opacity-70 dark:opacity-85"
                aria-hidden="true"
              />

              {/* Subtle cool indigo glow near bottom to anchor scrolling */}
              <div
                className="fixed bottom-0 left-1/2 -translate-x-1/2 w-[1000px] h-[500px] bg-indigo-500/[0.015] dark:bg-indigo-500/[0.01] blur-[150px] rounded-full -z-40 pointer-events-none"
                aria-hidden="true"
              />

              {/* Google Analytics Integration */}
              {process.env.NEXT_PUBLIC_GA_ID && (
                <>
                  <Script
                    src={`https://www.googletagmanager.com/gtag/js?id=${process.env.NEXT_PUBLIC_GA_ID}`}
                    strategy="afterInteractive"
                  />
                  <Script id="google-analytics" strategy="afterInteractive">
                    {`
                    window.dataLayer = window.dataLayer || [];
                    function gtag(){dataLayer.push(arguments);}
                    gtag('js', new Date());
                    gtag('config', '${process.env.NEXT_PUBLIC_GA_ID}');
                  `}
                  </Script>
                </>
              )}

              <SkipToContent />
              <Header />
              {children}
              <Footer />
              <WaitlistSocialProofTicker />
            </SplitFlapAudioProvider>
          </ThemeProvider>
        </LanguageProvider>
      </body>
    </html>
  );
}