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: [MarginFrontend] Home page #634

Merged
merged 8 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
1 change: 1 addition & 0 deletions margin_frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"@tailwindcss/vite": "^4.0.8",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"eslint-plugin-react": "^7.37.4",
"react": "^19.0.0",
Expand Down
23 changes: 4 additions & 19 deletions margin_frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
import { useState } from 'react'
import "./index.css"
import { cn } from "./utils/cn.ts";
import "./index.css";
import { Home } from "./routes/index.tsx";

function App() {
const [count, setCount] = useState(0)

return (
<div className={cn("flex", "items-center", "justify-center", "min-h-screen", "w-full", "bg-gray-800")}>
<div className={cn("flex", "flex-col", "items-center", "justify-center", "gap-4")}>
<h1 className={cn("font-bold", "text-3xl", "text-white")}>Margin frontend</h1>
<button
className={cn("bg-blue-400", "flex", "text-xl", "items-center", "justify-center", "w-full", "hover:shadow-lg hover:shadow-blue-200/20 hover:-translate-y-0.5 transition", "py-2", "rounded-xl", "text-white")}
onClick={() => setCount((count) => count + 1)}
>
count is {count}
</button>
</div>
</div>
)
return <Home />;
}

export default App
export default App;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
105 changes: 105 additions & 0 deletions margin_frontend/src/index.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,107 @@
@import "tailwindcss";

@font-face {
font-family: "InstrumentSans";
src: url("./assets/fonts/Instrument_Sans/static/InstrumentSans-Regular.ttf")
format("truetype");
font-weight: 400; /* Regular */
font-style: normal;
}

@font-face {
font-family: "InstrumentSans";
src: url("./assets/fonts/Instrument_Sans/static/InstrumentSans-Medium.ttf")
format("truetype");
font-weight: 500; /* Medium */
font-style: normal;
}

@font-face {
font-family: "InstrumentSans";
src: url("./assets/fonts/Instrument_Sans/static/InstrumentSans-SemiBold.ttf")
format("truetype");
font-weight: 600; /* Semibold */
font-style: normal;
}

@font-face {
font-family: "InstrumentSans";
src: url("./assets/fonts/Instrument_Sans/static/InstrumentSans-Bold.ttf")
format("truetype");
font-weight: 700; /* Bold */
font-style: normal;
}

@font-face {
font-family: "BricolageGrotesque";
src: url("./assets/fonts/Bricolage_Grotesque/static/BricolageGrotesque-Regular.ttf")
format("truetype");
font-weight: 400; /* Light */
font-style: normal;
}

@font-face {
font-family: "BricolageGrotesque";
src: url("./assets/fonts/Bricolage_Grotesque/static/BricolageGrotesque-Medium.ttf")
format("truetype");
font-weight: 400; /* Regular */
font-style: normal;
}

@font-face {
font-family: "BricolageGrotesque";
src: url("./assets/fonts/Bricolage_Grotesque/static/BricolageGrotesque-SemiBold.ttf")
format("truetype");
font-weight: 600; /* Medium */
font-style: normal;
}

@font-face {
font-family: "BricolageGrotesque";
src: url("./assets/fonts/Bricolage_Grotesque/static/BricolageGrotesque-Bold.ttf")
format("truetype");
font-weight: 700; /* SemiBold */
font-style: normal;
}

@font-face {
font-family: "PilotCommandSpaced";
src: url("./assets/fonts/Pilot-Command-Spaced/pilotcommandspaced.ttf")
format("truetype");
font-weight: 500; /* Light */
font-style: normal;
}

@theme {
/* Fonts */
--text-instrumentsans: "InstrumentSans";
--font-family: "BricolageGrotesque";
--third-family: "PilotCommandSpaced";

/* Colors */
--text: #fffcfc;
--logo-text: #fff;
--nav-text-color: #b4b4b4;
--seperator: #252525;
--button-outline-border: #4f4f4f;
--header-text-color: #e5e5e5;

/* Gradients */
/* --second-gradient-from: #e01dee; */

/* Other */
--header-text-size: 64px;
--header-text-lineheight: 68.35px;
--thumb-image: url("./assets/icons/slider-thumb.svg");
--purple-border: 1px solid #201338;
--midnight-purple-border: 1px solid #36294e;
--midnight-purple-hover-border: 1px solid #5b4b80;
--font-weight-sm: 400;
--font-weight-md: 500;
--font-weight-lg: 600;
--font-weight-xl: 700;
}

.logo {
color: var(--text);
}
49 changes: 49 additions & 0 deletions margin_frontend/src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { Button } from "../ui/core/button";
import { Footer } from "../ui/layout/footer";
import { Header } from "../ui/layout/header";

export function Home() {
return (
<div className="flex flex-col w-screen min-h-screen bg-black md:justify-between">
<Header />
<Content />
<Footer />
</div>
);
}

function Content() {
return (
<div className="mt-[100px] md:mt-0 pb-[112px] md:pb-0">
<h1 className="hidden md:block text-center text-[64px] font-[PilotCommandSpaced] uppercase text-[#e5e5e5]">
Trade, Earn, Grow
</h1>
<div className="space-y-8 md:hidden">
<h1 className="text-center text-[64px] font-[PilotCommandSpaced] uppercase text-[#e5e5e5]">
Trade
</h1>
<div className="h-3.5 w-3.5 rounded-full bg-white mx-auto" />
<h1 className="text-center text-[64px] font-[PilotCommandSpaced] uppercase text-[#e5e5e5]">
Earn
</h1>
<div className="h-3.5 w-3.5 rounded-full bg-white mx-auto" />
<h1 className="text-center text-[64px] font-[PilotCommandSpaced] uppercase text-[#e5e5e5]">
Grow
</h1>
</div>

<p className="w-10/12 mx-auto mt-4 text-center font-[BricolageGrotesque] text-sm md:text-base font-medium text-[var(--text)]">
Trade smarter, earn bigger, and grow your portfolio with confidence.
</p>
<div className="flex justify-center mt-12">
<Button
variant={"outline"}
size={"lg"}
className="w-[219px] text-[var(--text)] uppercase text-sm font-normal "
>
Launch app
</Button>
</div>
</div>
);
}
56 changes: 56 additions & 0 deletions margin_frontend/src/ui/core/button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { cva, type VariantProps } from "class-variance-authority";
import { ReactNode } from "react";

// Define button variants using CVA
const buttonVariants = cva(
"inline-flex items-center justify-center cursor-pointer rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none",
{
variants: {
variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/90",
destructive:
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
outline:
"border border-[var(--button-outline-border)] text-[var(--text)] bg-background hover:bg-accent hover:text-accent-foreground",
secondary:
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
sm: "h-8 px-3 text-sm",
md: "h-14 text-sm",
lg: "h-[72px] text-xl font-normal",
},
},
defaultVariants: {
variant: "default",
size: "md",
},
}
);

// Define props for the Button component
export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
children: ReactNode;
}

// Button component
export function Button({
className,
variant,
size,
children,
...props
}: ButtonProps) {
return (
<button
className={buttonVariants({ variant, size, className: className ?? "" })}
{...props}
>
{children}
</button>
);
}
30 changes: 30 additions & 0 deletions margin_frontend/src/ui/layout/footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const socials = [
{
icon: "./src/assets/images/DiscordLogo.png",
link: "https://discord.com/",
},
{
icon: "./src/assets/images/XLogo.png",
link: "https://twitter.com/SpotNet_123",
},
{
icon: "./src/assets/images/TelegramLogo.png",
link: "https://t.me/djeck_vorobey1",
},
];
export function Footer() {
return (
<div className="hidden md:w-11/12 xl:w-[1280px] px-10 pb-10 pt-6 mx-auto h-[88px] md:flex justify-between">
<h4 className="logo uppercase font-[InstrumentSans] text-white font-bold text-[13px] leading-[15.86px]">
Margin
</h4>
<div className="flex items-center h-6 gap-6">
{socials.map((social, index) => (
<a href={social.link} key={index}>
<img src={social.icon} alt="" className="w-6 h-6" />
</a>
))}
</div>
</div>
);
}
43 changes: 43 additions & 0 deletions margin_frontend/src/ui/layout/header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React from "react";
import { Button } from "../core/button";

const navlink = [
{
title: "Pool",
link: "/pool",
},
{
title: "Trade",
link: "/trade",
},
];
export function Header() {
return (
<div className="h-[88px] md:h-[120px] flex items-center justify-between px-4 md:px-14 lg:px-20 w-full">
<h4 className="logo uppercase font-[InstrumentSans] text-white font-bold text-[13px] leading-[15.86px]">
Margin
</h4>
<nav className="items-center hidden gap-4 md:flex">
{navlink.map((link, index) => (
<React.Fragment>
<div className={""} key={index}>
<a
href={link.link}
className="text-[#B4B4B4] text-sm font-normal font-[BricolageGrotesque]"
>
{link.title}
</a>
</div>
{index === 0 && <div className="w-[2px] h-[18px] bg-[#252525]" />}
</React.Fragment>
))}
</nav>
<Button
variant={"outline"}
className="h-12 w-[161px] text-[var(--text)] uppercase text-sm font-normal mt-1"
>
Connect Wallet
</Button>
</div>
);
}
Loading