Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/partnership #96

Merged
merged 26 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4503fc1
Adding "How to Participate ?" category
Marchand-Nicolas Jul 11, 2023
f564d2c
responsive
Marchand-Nicolas Jul 12, 2023
cedbe81
adding vertical bar
Marchand-Nicolas Jul 12, 2023
66b2584
replacing PNGs by WEBPs
Marchand-Nicolas Jul 12, 2023
360ad79
Hiding overflow
Marchand-Nicolas Jul 12, 2023
7f12cbe
fixing scrollbar
Marchand-Nicolas Jul 12, 2023
e1accc9
updating icons
Marchand-Nicolas Jul 13, 2023
64b0102
adding cards animations
Marchand-Nicolas Jul 13, 2023
bb3f961
installing react-intersection-observer
Marchand-Nicolas Jul 13, 2023
53b4b0b
Adding partnership page
Marchand-Nicolas Jul 13, 2023
b97022f
planet animation
Marchand-Nicolas Jul 13, 2023
20650c5
Implementing JediSwap Lottie
Marchand-Nicolas Jul 14, 2023
4c62dc1
Adding dots animation
Marchand-Nicolas Jul 14, 2023
5edb34f
Fixing several warnings
Marchand-Nicolas Jul 14, 2023
8e659fc
Fixing responsive
Marchand-Nicolas Jul 16, 2023
84250b4
Cleaning the code
Marchand-Nicolas Jul 16, 2023
a034489
https://github.com/starknet-id/starknet.quest/pull/96#discussion_r126…
Marchand-Nicolas Jul 16, 2023
df3eeb2
Cleaning the code
Marchand-Nicolas Jul 16, 2023
703fd90
Improving responsiveness
Marchand-Nicolas Jul 16, 2023
f038114
Cleaning class names
Marchand-Nicolas Jul 16, 2023
6e55ba9
Cleaning the code
Marchand-Nicolas Jul 16, 2023
712b9b6
Merge branch 'testnet' into feat/partnership
Marchand-Nicolas Jul 17, 2023
f4f26f3
responsive
Marchand-Nicolas Jul 17, 2023
e3af5ba
renaming
Marchand-Nicolas Jul 17, 2023
9bd2ef3
renaming
Marchand-Nicolas Jul 17, 2023
4754547
Cleaning the code
Marchand-Nicolas Jul 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions components/UI/box.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React, { FunctionComponent, ReactNode } from "react";
import styles from "../../styles/components/box.module.css";

type BoxProps = {
children: ReactNode;
};

const Box: FunctionComponent<BoxProps> = ({ children }) => {
return <div className={styles.container}>{children}</div>;
};

export default Box;
11 changes: 11 additions & 0 deletions components/UI/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ const Navbar: FunctionComponent = () => {
</div>
<div>
<ul className="hidden lg:flex uppercase items-center">
<Link href="/partnership">
<li className={styles.menuItem}>Partnership</li>
</Link>
<Link href="/">
<li className={styles.menuItem}>Quests</li>
</Link>
Expand Down Expand Up @@ -186,6 +189,14 @@ const Navbar: FunctionComponent = () => {
</div>
<div className="py-4 flex flex-col">
<ul className="uppercase text-babe-blue">
<Link href="/partnership">
<li
onClick={() => setNav(false)}
className={styles.menuItemSmall}
>
Partnership
</li>
</Link>
<Link href="/">
<li
onClick={() => setNav(false)}
Expand Down
21 changes: 21 additions & 0 deletions components/UI/stats/statElement.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React, { FunctionComponent } from "react";
import styles from "../../../styles/components/stats.module.css";
import Box from "../box";

type StatElementProps = {
name: string;
value: string;
};

const StatElement: FunctionComponent<StatElementProps> = ({ name, value }) => {
return (
<div className={styles.statElement}>
<Box>
<p className={styles.statValue}>{value}</p>
<p className={styles.statName}>{name}</p>
</Box>
</div>
);
};

export default StatElement;
30 changes: 30 additions & 0 deletions components/UI/stats/stats.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React, { FunctionComponent } from "react";
import styles from "../../../styles/components/stats.module.css";
import StatElement from "./statElement";

type StatsProps = {
title: string;
stats: {
name: string;
value: string;
}[];
};

const Stats: FunctionComponent<StatsProps> = ({ title, stats }) => {
return (
<div className={styles.container}>
<h2 className={styles.title}>{title}</h2>
<div className={styles.elementsContainer}>
{stats.map((elt, index) => (
<StatElement
key={`stats_${index}`}
name={elt.name}
value={elt.value}
/>
))}
</div>
</div>
);
};

export default Stats;
55 changes: 55 additions & 0 deletions components/UI/steps/stepElement.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import shapeStyles from "../../../styles/components/shapes.module.css";
import VerticalBar from "../../shapes/verticalBar";
import OnScrollIntoView from "../../animations/onScrollIntoView";
import styles from "../../../styles/components/steps.module.css";
import React, { FunctionComponent } from "react";

type StepElementProps = {
index: number;
step: Step;
subTitleBefore?: boolean;
steps: Step[];
};

const StepElement: FunctionComponent<StepElementProps> = ({
index,
step,
subTitleBefore = false,
steps,
}) => {
return (
<div className={styles.cardContainer}>
<div className={styles.barsContainer}>
<img className={styles.icon} src={step.icon} />
{index !== steps.length - 1 && (
<div className={styles.verticalBarContainer}>
<VerticalBar />
</div>
)}
</div>
<OnScrollIntoView animation="slideInFromTop">
<div key={"step_card_" + index} className={styles.card}>
<div className={(subTitleBefore && styles.subTitleBefore) || ""}>
{[
<h1 key={`step_${index}_title`} className={styles.title}>
{step.title}
</h1>,
<h2 key={`step_${index}_subtitle`} className={styles.subtitle}>
{step.subtitle}
</h2>,
].sort(() => (subTitleBefore ? -1 : 1))}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pourquoi cette logique ? C'est trop compliqué encore selon moi. Essayes de penser à qlq chose de plus simple dans le css notamment.

<p className={styles.description}>{step.description}</p>
</div>
<div className={styles.overlay}>
{step.overlay ? step.overlay : null}
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{   step.overlay  ?     

<div className={styles.overlay}>
            step.overlay
          </div> : null
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est mieux ça nous fait une div en moins

<div>
<img className={styles.banner} src={step.banner} />
</div>
</div>
</OnScrollIntoView>
</div>
);
};

export default StepElement;
31 changes: 31 additions & 0 deletions components/UI/steps/steps.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React, { FunctionComponent } from "react";
import styles from "../../../styles/components/steps.module.css";
import StepElement from "./stepElement";

type StepsProps = {
subTitleBefore?: boolean;
steps: Step[];
};

const Steps: FunctionComponent<StepsProps> = ({
subTitleBefore = false,
steps,
}) => {
return (
<div className={styles.container}>
<div className={styles.cards}>
{steps.map((step, index) => (
<StepElement
index={index}
step={step}
subTitleBefore={subTitleBefore}
key={"step_" + index}
steps={steps}
/>
))}
</div>
</div>
);
};

export default Steps;
37 changes: 37 additions & 0 deletions components/UI/titles/categoryTitle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React, { FunctionComponent } from "react";
import styles from "../../../styles/components/titles.module.css";
import Corner from "../../shapes/corner";
import Squares from "../../shapes/squares";

type CategoryTitleProps = {
title: string;
subtitle: string;
corner?: CornerStyle;
squares?: SquareStyle;
};

const CategoryTitle: FunctionComponent<CategoryTitleProps> = ({
title,
subtitle,
corner,
squares,
}) => {
return (
<div className={styles.container}>
{corner && (
<div className={[styles.corner, styles[corner]].join(" ")}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pq tu dois mettre deux classes je ne comprend pas ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parfois le symbole n'est pas au même endroit. Du coup la première classes "corner" applique le style commun à tous les corners, et l'autre, qui est dynamique va prendre des valeurs telles que "bottomLeft" etc

image
image
image

Après c'est la seule idée qui m'est venue à l'esprit. Mais si tu as une autre idée je suis carrément preneur, car j'ai un peu tendance à abuser sur les classes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok je vois donc là ici pour moi tu dois typer le corner de manière à ce qu'on comprenne que ce n'est pas une string mais un type Corner = bottomRight | bottomLeft | topRight | topLeft

de cette manière on comprend à quoi ça sert.

<Corner />
</div>
)}
{squares && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pareil sur le type de square.

<div className={[styles.squares, styles[squares]].join(" ")}>
<Squares />
</div>
)}
<p className={styles.categorySubtitle}>{subtitle}</p>
<h2 className={styles.categoryTitle}>{title}</h2>
</div>
);
};

export default CategoryTitle;
41 changes: 41 additions & 0 deletions components/UI/titles/mainTitle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React, { FunctionComponent } from "react";
import styles from "../../../styles/components/titles.module.css";
import Corner from "../../shapes/corner";
import Squares from "../../shapes/squares";

type MainTitleProps = {
title: string;
highlighted: string;
subtitle: string;
corner?: CornerStyle;
squares?: SquareStyle;
};

const MainTitle: FunctionComponent<MainTitleProps> = ({
title,
highlighted,
subtitle,
corner = null,
squares = null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

= null ne sert à rien.

Ce = est là pour dire si undefined je met quoi comme valeur, donc la si undefined tu met une valeur par defaut et de cette manière tu peux delete corner &&et squares &&.

Si tu veux ne pas en avoir autant ne pas mettre le composant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah oui pardon, j'avais enlevé de l'autre composant, mais apparemment j'ai oublié celui ci

}) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type

return (
<div className={[styles.container, styles.mainTitleContainer].join(" ")}>
{corner && (
<div className={[styles.corner, styles[corner]].join(" ")}>
<Corner />
</div>
)}
{squares && (
<div className={[styles.squares, styles[squares]].join(" ")}>
<Squares />
</div>
)}

<h2 className={styles.mainTitle}>
{title} <strong>{highlighted}</strong>
</h2>
<p className={styles.mainSubtitle}>{subtitle}</p>
</div>
);
};
export default MainTitle;
32 changes: 32 additions & 0 deletions components/animations/onScrollIntoView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React, { FunctionComponent } from "react";
import { useInView } from "react-intersection-observer";
import styles from "../../styles/components/animations.module.css";

type OnScrollIntoViewProps = {
animation?: string;
children: React.ReactNode;
callback?: () => void;
};

const OnScrollIntoView: FunctionComponent<OnScrollIntoViewProps> = ({
animation = "",
children,
callback,
}) => {
const [ref, inView] = useInView({
triggerOnce: true,
rootMargin: "-100px 0px",
onChange: () => callback && callback(),
});

return (
<div
ref={ref}
className={[styles[animation], inView && styles.active].join(" ")}
>
{children}
</div>
);
};

export default OnScrollIntoView;
52 changes: 52 additions & 0 deletions components/pages/home/howToParticipate.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import React from "react";
import Steps from "../../UI/steps/steps";
import CategoryTitle from "../../UI/titles/categoryTitle";
import Crosses from "../../shapes/crosses";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ne pas sauter de ligne ici

import styles from "../../../styles/components/pages/home/howToParticipate.module.css";

const HowToParticipate = () => {
return (
<section>
<CategoryTitle
title="How to Participate ?"
subtitle="Engage in the Starknet Experience: Unlock New Possibilities"
corner="topLeft"
/>
<div className={styles.stepsContainer}>
<Steps
subTitleBefore={true}
steps={[
{
title: "Get Your Stark Domain",
subtitle: "01",
description:
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
icon: "/icons/starknet.svg",
banner: "/visuals/getYourStarkDomain.webp",
},
{
title: "Collect NFTs in Starknet Quest",
subtitle: "02",
description:
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
icon: "/icons/crown.svg",
banner: "/visuals/collectNFTsInStarknetQuest.webp",
},
{
title: "Build your Starknet Land",
subtitle: "03",
description:
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
icon: "/icons/verified.svg",
banner: "/visuals/buildYourStarknetLand.webp",
},
]}
/>
<Crosses xDecal={-300} />
</div>
</section>
);
};

export default HowToParticipate;
18 changes: 18 additions & 0 deletions components/shapes/corner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from "react";
import styles from "../../styles/components/shapes.module.css";

const Corner = () => {
return (
<svg
className={[styles.shape, styles.corner].join(" ")}
width="23"
height="23"
viewBox="0 0 23 23"
fill="none"
>
<path d="M22 1L1 1L1 22" strokeWidth="2" strokeLinecap="round" />
</svg>
);
};

export default Corner;
22 changes: 22 additions & 0 deletions components/shapes/cross.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from "react";
import styles from "../../styles/components/shapes.module.css";

const Cross = () => {
return (
<svg
className={[styles.shape, styles.corner].join(" ")}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Au lieu d'utiliser .join("") il vaut mieux utiliser className={${styles.shape} ${styles.corner}}

Je trouve ça plus clean tu en penses quoi ? Si toi aussi let's go changer tous tes join("") de cette manière là !

width="9"
height="9"
viewBox="0 0 9 9"
fill="none"
>
<path
d="M1 8.5L8.5 1M1.5 1L8.5 8.5"
stroke="#66666F"
strokeLinecap="round"
/>
</svg>
);
};

export default Cross;
Loading