Skip to content

Commit

Permalink
💄 style(colors): color sychnorize with words and cards
Browse files Browse the repository at this point in the history
  • Loading branch information
lwinmoepaing committed Oct 19, 2023
1 parent bd0f3b1 commit 1656689
Show file tree
Hide file tree
Showing 12 changed files with 188 additions and 141 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"lint-staged": "^14.0.1",
"next": "13.5.4",
"next-contentlayer": "^0.3.4",
"next-pwa": "^5.6.0",
"react": "^18",
"react-dom": "^18",
"react-icons": "^4.11.0",
Expand Down
55 changes: 55 additions & 0 deletions src/app/components/HomePageComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
"use client";

import Container from "@/components/Common/Container/Container";
import OverflowContainer from "@/components/Common/Container/OverflowContainer";
import SpacingDivider from "@/components/Common/SpacingDivider/SpacingDivider";
import HomeSection from "@/components/MSE/HomeSection";
import JoinSection from "@/components/MSE/JoinSection";
import LanguageIconSection from "@/components/MSE/LanguageIconSection";
import MmsweTypoSection from "@/components/MSE/MmsweTypoSection";
import PlatformSection from "@/components/MSE/PlatformSection";
import { generateColor } from "@/utils";

export default function HomePageComponent() {
const color = generateColor();
const bgColor = `${color} bg-opacity-[0.35]`;

return (
<>
<Container withPadding>
{/* Home Section: Start */}
<HomeSection bgColor={bgColor} />
{/* Home Section: Finished */}

<SpacingDivider />

{/* Joined Section: Start */}
<JoinSection bgColor={bgColor} />
{/* Joined Section: Finished */}

<SpacingDivider size="lg" />
</Container>

<OverflowContainer>
{/* LanguageIcon Section: Start */}
<SpacingDivider size="sm" />

<LanguageIconSection bgColor={bgColor} />
{/* LanguageIcon Section: Finished */}

<SpacingDivider size="sm" />

{/* Typo Sectino: Start */}
<MmsweTypoSection bgColor={bgColor} />
{/* Typo Sectino: Finished */}
<SpacingDivider size="sm" />
</OverflowContainer>

<Container withPadding>
{/* Platform Section: Start */}
<PlatformSection bgColor={bgColor} />
{/* Platform Section: Start */}
</Container>
</>
);
}
47 changes: 2 additions & 45 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,59 +1,16 @@
import Container from "@/components/Common/Container/Container";
import OverflowContainer from "@/components/Common/Container/OverflowContainer";
import SpacingDivider from "@/components/Common/SpacingDivider/SpacingDivider";
import HomeSection from "@/components/MSE/HomeSection";
import JoinSection from "@/components/MSE/JoinSection";
import LanguageIconSection from "@/components/MSE/LanguageIconSection";
import MmsweTypoSection from "@/components/MSE/MmsweTypoSection";
import PlatformSection from "@/components/MSE/PlatformSection";
import APP_CONFIG from "@/config/config";
import { generateColor } from "@/utils";
import { Metadata } from "next";
import HomePageComponent from "./components/HomePageComponent";

export const metadata: Metadata = {
title: `Home | ${APP_CONFIG.title}`,
description: APP_CONFIG.description,
};

export default function HomePage() {
const bgColor = `${generateColor()} bg-opacity-20`;

return (
<>
<Container withPadding>
{/* Home Section: Start */}
<HomeSection bgColor={bgColor} />
{/* Home Section: Finished */}

<SpacingDivider />

{/* Joined Section: Start */}
<JoinSection bgColor={bgColor} />
{/* Joined Section: Finished */}

<SpacingDivider size="lg" />
</Container>

<OverflowContainer>
{/* LanguageIcon Section: Start */}
<SpacingDivider size="sm" />

<LanguageIconSection bgColor={bgColor} />
{/* LanguageIcon Section: Finished */}

<SpacingDivider size="sm" />

{/* Typo Sectino: Start */}
<MmsweTypoSection />
{/* Typo Sectino: Finished */}
<SpacingDivider size="sm" />
</OverflowContainer>

<Container withPadding>
{/* Platform Section: Start */}
<PlatformSection bgColor={bgColor} />
{/* Platform Section: Start */}
</Container>
<HomePageComponent />
</>
);
}
40 changes: 2 additions & 38 deletions src/app/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ import Container from "@/components/Common/Container/Container";
import APP_CONFIG from "@/config/config";
import { Metadata } from "next";

import ProfileCardList from "@/components/Profile/ProfileCardList/ProfileCardList";
import { allProfiles } from "contentlayer/generated";
import BodyText from "@/components/Common/BodyText/BodyText";
import SquareBox from "@/components/Ui/SquareBox/SquareBox";
import TitleText from "@/components/Common/TitleText/TitleText";
import Link from "next/link";
import { cn, generateColor } from "@/utils";

export const metadata: Metadata = {
title: `Profile List | ${APP_CONFIG.title}`,
Expand All @@ -23,39 +19,7 @@ const ProfileListPage = async () => {
return (
<Container>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-5">
{profiles.map((profile) => {
const bgColor = generateColor();

return (
<div key={profile._id}>
<Link href={`/profile/${profile.slugAsParams}`}>
<SquareBox
className={cn(
"transition ease-out cursor-pointer hover:opacity-80 hover:-translate-y-1 bg-opacity-30 min-h-[130px]",
bgColor
)}
>
<div className="flex flex-row items-center mb-2 space-x-2">
<div
className={cn(
"flex justify-center items-center h-10 w-10 rounded-full",
bgColor
)}
>
{profile.name?.[0]}
</div>
<TitleText tag="h4" className="text-base">
{profile.name}
</TitleText>
</div>
<TitleText tag="h4" className="text-sm">
{profile.description}
</TitleText>
</SquareBox>
</Link>
</div>
);
})}
<ProfileCardList profiles={profiles} />
</div>
</Container>
);
Expand Down
22 changes: 14 additions & 8 deletions src/components/Animate/MseTypo/MseTypo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ export const strokeAnimation = {
},
} as const;

const MsoTypo = () => {
const MsoTypo = ({ bgColor = "bg-indigo-500" }: { bgColor?: string }) => {
const containerRef = useRef<SVGSVGElement>(null);

const isInView = useInView(containerRef, { amount: 0.5 });
const textColor = `${bgColor
.replace(/bg/, "text")
.replace(/-400/, "")} opacity-90`;

const fillColor = `fill-white`;

const strokeColor = `${bgColor.replace(/bg/, "stroke")} opacity-80`;

return (
<motion.svg
Expand All @@ -34,31 +40,31 @@ const MsoTypo = () => {
>
<style>
{
'.st0{display:none}.st2{display:inline}.st3{opacity:.1}.st4{fill:#fff}.st6{fill:none;stroke:#fff;stroke-linecap:round;stroke-linejoin:round}.st8{display:inline;fill:#fff}.st10{fill:none;stroke:#fff;stroke-width:2}.st12{font-size:110px}.st14{font-size:46px}'
".st0{display:none}.st2{display:inline}.st3{opacity:.1}.st4{fill:#fff}.st6{fill:none;stroke-linecap:round;stroke-linejoin:round}.st8{display:inline;fill:#fff}.st10{fill:none;stroke-width:2}.st12{font-size:110px}.st14{font-size:46px}"
}
</style>
<g id="TextGroup">
<motion.text
variants={strokeAnimation}
className={cn("st10 st11 st12", titleFontBold.className)}
className={cn("st10 st11 st12", titleFontBold.className, strokeColor)}
transform="translate(10.957 106.424)"
>
{"M"}
</motion.text>
<text
className={cn("st4 st13 st14", titleFont.className)}
className={cn("st13 st14", titleFont.className, fillColor)}
transform="translate(87.933 59.278)"
>
{"yanmar"}
</text>
<text
className={cn("st4 st13 st14", titleFont.className)}
className={cn("st13 st14", titleFont.className, fillColor)}
transform="translate(340.562 108.983)"
>
{"ngineers"}
</text>
<text
className={cn("st4 st13", titleFont.className)}
className={cn("st13", titleFont.className, fillColor)}
style={{
fontSize: 43,
}}
Expand All @@ -68,7 +74,7 @@ const MsoTypo = () => {
</text>
<motion.text
variants={strokeAnimation}
className={cn("st10 st11 st12", titleFontBold.className)}
className={cn("st10 st11 st12", titleFontBold.className, strokeColor)}
transform="translate(272.74 108.424)"
>
{"E"}
Expand Down
3 changes: 2 additions & 1 deletion src/components/MSE/HomeSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const Card = ({
const HomeSection = ({ bgColor = "bg-indigo-500" }: { bgColor?: string }) => {
const ref = useRef(null);
const isInView = useInView(ref, { amount: 0.4, once: true });

return (
<motion.div
ref={ref}
Expand Down Expand Up @@ -109,7 +110,7 @@ const HomeSection = ({ bgColor = "bg-indigo-500" }: { bgColor?: string }) => {
transition: { delay: 0.7 },
}}
>
<TopArrow />
<TopArrow bgColor={bgColor}/>
</motion.div>
</motion.div>
</motion.div>
Expand Down
3 changes: 1 addition & 2 deletions src/components/MSE/JoinSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import Link from "next/link";
const JoinSection = ({ bgColor = "bg-indigo-500" }: { bgColor?: string }) => {
return (
<motion.div
transition={{ staggerChildren: 0.017, delay: 0.6 }}
className="grid grid-cols-1 lg:grid-cols-2 gap-10 lg:gap-5 relative overflow-hidden"
>
<motion.div
Expand Down Expand Up @@ -46,7 +45,7 @@ const JoinSection = ({ bgColor = "bg-indigo-500" }: { bgColor?: string }) => {

{/* Description Section: Start */}
<motion.div
className="flex hover:-translate-y-1 duration-200 transition ease-out"
className="flex"
initial={{ opacity: 0, y: 8 }}
animate={{ opacity: 1, y: 0, transition: { delay: 0.7 } }}
>
Expand Down
8 changes: 6 additions & 2 deletions src/components/MSE/MmsweTypoSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ import MsoTypo from "../Animate/MseTypo/MseTypo";
import Container from "../Common/Container/Container";
import HorizontalWrapper from "../Common/HorizontalWrapper/HorizontalWrapper";

const MmsweTypoSection = () => {
const MmsweTypoSection = ({
bgColor = "bg-indigo-500",
}: {
bgColor?: string;
}) => {
return (
<Container withPadding>
<HorizontalWrapper horizontalDirection={-150} activeOpacity>
<div className="relative -right-[150px] ">
<MsoTypo />
<MsoTypo bgColor={bgColor} />
</div>
</HorizontalWrapper>
</Container>
Expand Down
48 changes: 48 additions & 0 deletions src/components/Profile/ProfileCardList/ProfileCardList.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"use client";

import TitleText from "@/components/Common/TitleText/TitleText";
import SquareBox from "@/components/Ui/SquareBox/SquareBox";
import { cn, generateColor } from "@/utils";
import { Profile } from "contentlayer/generated";
import Link from "next/link";

const ProfileCardList = ({ profiles }: { profiles: Profile[] }) => {
return (
<>
{profiles.map((profile) => {
const bgColor = generateColor();

return (
<div key={profile._id}>
<Link href={`/profile/${profile.slugAsParams}`}>
<SquareBox
className={cn(
"transition ease-out cursor-pointer hover:opacity-80 hover:-translate-y-1 bg-opacity-30 min-h-[130px]",
bgColor
)}
>
<div className="flex flex-row items-center mb-2 space-x-2">
<div
className={cn(
"flex justify-center items-center h-10 w-10 rounded-full",
bgColor
)}
>
{profile.name?.trim()?.[0]}
</div>
<TitleText tag="h4" className="text-base">
{profile.name}
</TitleText>
</div>
<TitleText tag="h4" className="text-sm">
{profile.description}
</TitleText>
</SquareBox>
</Link>
</div>
);
})}
</>
);
};
export default ProfileCardList;
Loading

0 comments on commit 1656689

Please sign in to comment.