Skip to content

Commit 32888fa

Browse files
committed
'init'
1 parent aeb356d commit 32888fa

38 files changed

+1122
-165
lines changed

app/[locale]/globals.css

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
:root {
6+
--primary: #3870ff;
7+
--primary-hoverd: #2856cc;
8+
--inverted-primary: #C78F00;
9+
}
10+
11+
/* pangination on the hero section swiper */
12+
13+
span.swiper-pagination-bullet.swiper-pagination-bullet-active {
14+
padding: 5px;
15+
z-index: 10;
16+
}
17+
18+
19+
/* Styling when the language is Arabic */
20+
.body-ar {
21+
text-align: right;
22+
}
23+
24+
.flexRowar {
25+
flex-direction: row-reverse;
26+
}
27+
.flexColar {
28+
display: flex;
29+
flex-direction: column;
30+
align-items: flex-end;
31+
}
32+
.floatLeft {
33+
float: left !important;
34+
}
35+
.justifyLeft {
36+
justify-content: left !important;
37+
}
38+
39+
::-webkit-scrollbar {
40+
width: 6px;
41+
}
42+
43+
::-webkit-scrollbar-track {
44+
background-color: #f1f1f1;
45+
}
46+
47+
::-webkit-scrollbar-thumb {
48+
background-color: var(--primary);
49+
border-radius: 0px;
50+
}
51+
52+
::-webkit-scrollbar-thumb:hover {
53+
background-color: var(--primary-hoverd);
54+
}

app/[locale]/layout.tsx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import "./globals.css";
2+
import { Inter, Roboto } from "next/font/google";
3+
import { useLocale } from "next-intl";
4+
import { notFound } from "next/navigation";
5+
import Header from "@/components/header/Header";
6+
import Footer from "@/components/footer";
7+
8+
const inter = Inter({ subsets: ["latin"] });
9+
const roboto = Roboto({
10+
weight: ["100", "700"],
11+
style: ["normal", "italic"],
12+
subsets: ["latin"],
13+
display: "swap",
14+
});
15+
16+
export const metadata = {
17+
title: "Solimania",
18+
description: "Generated by create next app",
19+
};
20+
21+
export default function RootLayout({
22+
children,
23+
params,
24+
}: {
25+
children: React.ReactNode;
26+
params: { locale: string | undefined };
27+
}) {
28+
const locale = useLocale();
29+
30+
console.log(locale);
31+
// Show a 404 error if the user requests an unknown locale
32+
if (params.locale !== locale) {
33+
notFound();
34+
}
35+
return (
36+
<html lang={locale}>
37+
<body
38+
className={` ${locale === "en" ? inter.className : roboto.className}`}
39+
>
40+
<Header />
41+
{children}
42+
<Footer />
43+
</body>
44+
</html>
45+
);
46+
}

app/[locale]/page.tsx

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { useTranslations } from "next-intl";
2+
import heroimg1 from "@/public/images/hero1.jpg";
3+
import heroimg2 from "@/public/images/hero2.jpg";
4+
import heroimg3 from "@/public/images/hero3.jpg";
5+
import heroimg4 from "@/public/images/hero5.jpg";
6+
7+
import { Suspense } from "react";
8+
import Hero from "@/components/home/Hero";
9+
import SubHero from "@/components/home/SubHero";
10+
import Catalog from "@/components/home/Catalog";
11+
12+
export default function Home() {
13+
const t = useTranslations("home");
14+
15+
const caroucelSlides = [
16+
{
17+
src: heroimg1,
18+
title: t("catLinkServices"),
19+
slogan: "Unmatched Quality, Exceptional Craftsmanship, Reliable Results",
20+
},
21+
{
22+
src: heroimg2,
23+
title: t("catLinkAbout"),
24+
slogan: "Precision Engineering, Innovative Design, Unparalleled Service",
25+
},
26+
{
27+
src: heroimg3,
28+
title: t("catLinkProducts"),
29+
slogan: "Exceeding Expectations, Building Dreams, Delivering Excellence",
30+
},
31+
{
32+
src: heroimg4,
33+
title: t("catLinkServices"),
34+
slogan: "Unleashing Creativity, Transforming Spaces, Inspiring Vision",
35+
},
36+
];
37+
38+
return (
39+
<div>
40+
<Suspense fallback={<div className="fixed">Loading...</div>}>
41+
<div className="h-[calc(100vh-80px)] min-h-[38rem] ">
42+
{/* @ts-expect-error Server Component */}
43+
<Hero caroucelSlides={caroucelSlides} />
44+
</div>
45+
<SubHero />
46+
<Catalog />
47+
</Suspense>
48+
</div>
49+
);
50+
}

app/globals.css

Lines changed: 0 additions & 27 deletions
This file was deleted.

app/layout.tsx

Lines changed: 0 additions & 21 deletions
This file was deleted.

app/page.tsx

Lines changed: 0 additions & 113 deletions
This file was deleted.

components/footer/index.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { useLocale, useTranslations } from "next-intl";
2+
import React from "react";
3+
import Nav from "../nav";
4+
5+
export default function Footer() {
6+
const t = useTranslations("home");
7+
const locale = useLocale();
8+
return (
9+
<div
10+
className={`min-h-[34rem] ${
11+
locale === "ar" && " text-right"
12+
} relative flex flex-col bg-zinc-900 w-full text-white rounded-[60px] h-[60vh]`}
13+
>
14+
<p className="text-3xl p-12 font-medium">{t("logo")}</p>
15+
<Nav />
16+
<p className=" absolute bottom-5 left-0 w-full text-center text-md font-light text-white">
17+
{" "}
18+
© Al-Solimania 2012-2023, All rights reserved.
19+
</p>
20+
</div>
21+
);
22+
}

components/header/Header.tsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import SwitchLink from "./SwitchLink";
2+
import Menu from "./Menu";
3+
import Link from "next/link";
4+
import { useLocale, useTranslations } from "next-intl";
5+
import Nav from "../nav";
6+
import { Inter } from "next/font/google";
7+
8+
const inter = Inter({ subsets: ["latin"] });
9+
10+
const Header = () => {
11+
const t = useTranslations("home");
12+
const locale = useLocale();
13+
return (
14+
<header
15+
className={` flex justify-center items-center z-10 relative ${
16+
locale === "ar" && " flex-row-reverse text-right"
17+
} `}
18+
>
19+
<h1
20+
className={` p-5 w-[90%] border-y-0 h-20 flex items-center ${
21+
locale === "ar"
22+
? " justify-end border border-l-black border-r-0 "
23+
: " h-20 border-r-black border-l-0"
24+
} `}
25+
>
26+
<Link className="mx-8 font-semibold text-2xl " href="/" locale={locale}>
27+
{t("logo")}
28+
</Link>
29+
</h1>
30+
<div className={`flex gap ${locale === "ar" && " flex-row-reverse"} `}>
31+
<SwitchLink inter={inter} locale={locale} />
32+
33+
<Menu locale={locale}>
34+
<Nav />
35+
</Menu>
36+
</div>
37+
</header>
38+
);
39+
};
40+
export default Header;

0 commit comments

Comments
 (0)