navbar, homepage init, first nivo chart

This commit is contained in:
2024-02-25 01:15:49 -05:00
parent 5aac68b937
commit 8960e3a247
20 changed files with 1104 additions and 273 deletions
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/app/globals.css",
"baseColor": "slate",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}
+15 -4
View File
@@ -9,19 +9,30 @@
"lint": "next lint" "lint": "next lint"
}, },
"dependencies": { "dependencies": {
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/sortable": "^8.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@nivo/line": "^0.84.0",
"@radix-ui/react-slot": "^1.0.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"lucide-react": "^0.338.0",
"next": "14.1.0",
"next-themes": "^0.2.1",
"react": "^18", "react": "^18",
"react-dom": "^18", "react-dom": "^18",
"next": "14.1.0" "tailwind-merge": "^2.2.1",
"tailwindcss-animate": "^1.0.7"
}, },
"devDependencies": { "devDependencies": {
"typescript": "^5",
"@types/node": "^20", "@types/node": "^20",
"@types/react": "^18", "@types/react": "^18",
"@types/react-dom": "^18", "@types/react-dom": "^18",
"autoprefixer": "^10.0.1", "autoprefixer": "^10.0.1",
"eslint": "^8",
"eslint-config-next": "14.1.0",
"postcss": "^8", "postcss": "^8",
"tailwindcss": "^3.3.0", "tailwindcss": "^3.3.0",
"eslint": "^8", "typescript": "^5"
"eslint-config-next": "14.1.0"
} }
} }
+533 -111
View File
File diff suppressed because it is too large Load Diff
+42 -24
View File
@@ -2,32 +2,50 @@
@tailwind components; @tailwind components;
@tailwind utilities; @tailwind utilities;
@layer base {
:root { :root {
--foreground-rgb: 0, 0, 0; --background: 0 0% 100%;
--background-start-rgb: 214, 219, 220; --foreground: 20 14.3% 4.1%;
--background-end-rgb: 255, 255, 255; --card: 0 0% 100%;
--card-foreground: 20 14.3% 4.1%;
--popover: 0 0% 100%;
--popover-foreground: 20 14.3% 4.1%;
--primary: 47.9 95.8% 53.1%;
--primary-foreground: 26 83.3% 14.1%;
--secondary: 60 4.8% 95.9%;
--secondary-foreground: 24 9.8% 10%;
--muted: 60 4.8% 95.9%;
--muted-foreground: 25 5.3% 44.7%;
--accent: 60 4.8% 95.9%;
--accent-foreground: 24 9.8% 10%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 60 9.1% 97.8%;
--border: 20 5.9% 90%;
--input: 20 5.9% 90%;
--ring: 20 14.3% 4.1%;
--radius: 0.5rem;
} }
@media (prefers-color-scheme: dark) { .dark {
:root { --background: 20 14.3% 4.1%;
--foreground-rgb: 255, 255, 255; --foreground: 60 9.1% 97.8%;
--background-start-rgb: 0, 0, 0; --card: 20 14.3% 4.1%;
--background-end-rgb: 0, 0, 0; --card-foreground: 60 9.1% 97.8%;
} --popover: 20 14.3% 4.1%;
} --popover-foreground: 60 9.1% 97.8%;
--primary: 47.9 95.8% 53.1%;
body { --primary-foreground: 26 83.3% 14.1%;
color: rgb(var(--foreground-rgb)); --secondary: 12 6.5% 15.1%;
background: linear-gradient( --secondary-foreground: 60 9.1% 97.8%;
to bottom, --muted: 12 6.5% 15.1%;
transparent, --muted-foreground: 24 5.4% 63.9%;
rgb(var(--background-end-rgb)) --accent: 12 6.5% 15.1%;
) --accent-foreground: 60 9.1% 97.8%;
rgb(var(--background-start-rgb)); --destructive: 0 62.8% 30.6%;
} --destructive-foreground: 60 9.1% 97.8%;
--border: 12 6.5% 15.1%;
@layer utilities { --input: 12 6.5% 15.1%;
.text-balance { --ring: 35.5 91.7% 32.9%;
text-wrap: balance;
} }
} }
View File
+16 -3
View File
@@ -1,8 +1,11 @@
import type { Metadata } from "next"; import type { Metadata } from "next";
import { Inter } from "next/font/google"; import { Red_Hat_Display } from "next/font/google";
import "./globals.css"; import "./globals.css";
import Navbar from "@/components/nav/Navbar";
import { cn } from "@/lib/utils";
import { ThemeProvider } from "@/components/theme/theme-providers";
const inter = Inter({ subsets: ["latin"] }); const red_hat = Red_Hat_Display({ subsets: ["latin"] });
export const metadata: Metadata = { export const metadata: Metadata = {
title: "Create Next App", title: "Create Next App",
@@ -16,7 +19,17 @@ export default function RootLayout({
}>) { }>) {
return ( return (
<html lang="en"> <html lang="en">
<body className={inter.className}>{children}</body> <body className={cn("min-h-screen antialiased", red_hat.className)}>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
<Navbar />
{children}
</ThemeProvider>
</body>
</html> </html>
); );
} }
+3 -107
View File
@@ -1,113 +1,9 @@
import Image from "next/image"; import HomePageGrid from "@/components/grid/HomePageGrid";
export default function Home() { export default function Home() {
return ( return (
<main className="flex min-h-screen flex-col items-center justify-between p-24"> <main className="h-screen">
<div className="z-10 max-w-5xl w-full items-center justify-between font-mono text-sm lg:flex"> <HomePageGrid />
<p className="fixed left-0 top-0 flex w-full justify-center border-b border-gray-300 bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30">
Get started by editing&nbsp;
<code className="font-mono font-bold">src/app/page.tsx</code>
</p>
<div className="fixed bottom-0 left-0 flex h-48 w-full items-end justify-center bg-gradient-to-t from-white via-white dark:from-black dark:via-black lg:static lg:h-auto lg:w-auto lg:bg-none">
<a
className="pointer-events-none flex place-items-center gap-2 p-8 lg:pointer-events-auto lg:p-0"
href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
By{" "}
<Image
src="/vercel.svg"
alt="Vercel Logo"
className="dark:invert"
width={100}
height={24}
priority
/>
</a>
</div>
</div>
<div className="relative flex place-items-center before:absolute before:h-[300px] before:w-full sm:before:w-[480px] before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-full sm:after:w-[240px] after:translate-x-1/3 after:bg-gradient-conic after:from-sky-200 after:via-blue-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-blue-700 before:dark:opacity-10 after:dark:from-sky-900 after:dark:via-[#0141ff] after:dark:opacity-40 before:lg:h-[360px] z-[-1]">
<Image
className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] dark:invert"
src="/next.svg"
alt="Next.js Logo"
width={180}
height={37}
priority
/>
</div>
<div className="mb-32 grid text-center lg:max-w-5xl lg:w-full lg:mb-0 lg:grid-cols-4 lg:text-left">
<a
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className={`mb-3 text-2xl font-semibold`}>
Docs{" "}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
Find in-depth information about Next.js features and API.
</p>
</a>
<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className={`mb-3 text-2xl font-semibold`}>
Learn{" "}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
Learn about Next.js in an interactive course with&nbsp;quizzes!
</p>
</a>
<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className={`mb-3 text-2xl font-semibold`}>
Templates{" "}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}>
Explore starter templates for Next.js.
</p>
</a>
<a
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className={`mb-3 text-2xl font-semibold`}>
Deploy{" "}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className={`m-0 max-w-[30ch] text-sm opacity-50 text-balance`}>
Instantly deploy your Next.js site to a shareable URL with Vercel.
</p>
</a>
</div>
</main> </main>
); );
} }
+63
View File
@@ -0,0 +1,63 @@
"use client";
import React from "react";
import { ResponsiveLine } from "@nivo/line";
function PortfolioChart({ data }: any) {
return (
<ResponsiveLine
data={data}
margin={{ top: 50, right: 110, bottom: 50, left: 60 }}
xScale={{ type: "point" }}
yScale={{
type: "linear",
min: "auto",
max: "auto",
stacked: true,
reverse: false,
}}
yFormat=" >-.2f"
curve="monotoneX"
axisTop={null}
axisRight={{
tickSize: 5,
tickPadding: 5,
tickRotation: 0,
legend: "",
legendOffset: 0,
truncateTickAt: 0,
}}
axisBottom={{
tickSize: 0,
tickPadding: 0,
tickRotation: -1,
legend: "",
legendOffset: 36,
legendPosition: "middle",
truncateTickAt: 0,
}}
axisLeft={null}
enableGridX={false}
colors={{ scheme: "yellow_orange_brown" }}
enablePoints={false}
pointSize={10}
pointColor={{ theme: "background" }}
pointBorderWidth={2}
pointBorderColor={{ from: "serieColor" }}
pointLabelYOffset={-12}
crosshairType="cross"
useMesh={true}
legends={[]}
motionConfig={{
mass: 1,
tension: 250,
friction: 1,
clamp: true,
precision: 0.01,
velocity: 0,
}}
/>
);
}
export default PortfolioChart;
+23
View File
@@ -0,0 +1,23 @@
import React from "react";
import PortfolioChart from "../charts/PortfolioChart";
import Portfolio from "../modules/Portfolio";
function HomePageGrid() {
return (
<div className="h-screen px-4 grid grid-rows-3 grid-cols-12 gap-4">
<div className="rounded-2xl col-span-4 sm:col-span-4 bg-gray-900">
<Portfolio />
</div>
<div className="rounded-2xl col-span-4 sm:col-span-4 bg-gray-900">2</div>
<div className="rounded-2xl col-span-4 sm:col-span-4 bg-gray-900">3</div>
<div className="rounded-2xl col-span-4 sm:col-span-6 bg-gray-900">1</div>
<div className="rounded-2xl col-span-4 sm:col-span-6 bg-gray-900">2</div>
<div className="rounded-2xl col-span-4 sm:col-span-3 bg-gray-900">1</div>
<div className="rounded-2xl col-span-4 sm:col-span-3 bg-gray-900">2</div>
<div className="rounded-2xl col-span-4 sm:col-span-3 bg-gray-900">3</div>
<div className="rounded-2xl col-span-4 sm:col-span-3 bg-gray-900">4</div>
</div>
);
}
export default HomePageGrid;
View File
+15
View File
@@ -0,0 +1,15 @@
import React from "react";
interface ModuleProps {
title: string;
}
function Module({ title }: ModuleProps) {
return (
<div className="h-full w-full flex flex-row">
<div className="h-10 text-xl">{title}</div>
</div>
);
}
export default Module;
+123
View File
@@ -0,0 +1,123 @@
import React from "react";
import PortfolioChart from "../charts/PortfolioChart";
import Module from "./Module";
function Portfolio() {
const data = [
{
"id": "japan",
"color": "hsl(173, 70%, 50%)",
"data": [
{
"x": "plane",
"y": 274,
},
{
"x": "helicopter",
"y": 197,
},
{
"x": "boat",
"y": 175,
},
{
"x": "train",
"y": 181,
},
{
"x": "subway",
"y": 54,
},
{
"x": "bus",
"y": 91,
},
{
"x": "car",
"y": 68,
},
{
"x": "moto",
"y": 244,
},
{
"x": "bicycle",
"y": 298,
},
{
"x": "horse",
"y": 286,
},
{
"x": "skateboard",
"y": 0,
},
{
"x": "others",
"y": 214,
},
],
},
{
"id": "france",
"color": "hsl(346, 70%, 50%)",
"data": [
{
"x": "plane",
"y": 166,
},
{
"x": "helicopter",
"y": 147,
},
{
"x": "boat",
"y": 276,
},
{
"x": "train",
"y": 132,
},
{
"x": "subway",
"y": 165,
},
{
"x": "bus",
"y": 47,
},
{
"x": "car",
"y": 27,
},
{
"x": "moto",
"y": 40,
},
{
"x": "bicycle",
"y": 80,
},
{
"x": "horse",
"y": 274,
},
{
"x": "skateboard",
"y": 109,
},
{
"x": "others",
"y": 211,
},
],
},
];
return (
// ADD MODULE
<PortfolioChart data={data} />
);
}
export default Portfolio;
+21
View File
@@ -0,0 +1,21 @@
import React from "react";
import { Button } from "../ui/button";
import { link } from "fs";
function NavPages() {
return (
<div className="flex justify-between gap-8 px-8">
<Button variant="link" className="text-white font-bold">
HOME
</Button>
<Button variant="link" className="text-white font-bold">
PORTFOLIO
</Button>
<Button variant="link" className="text-white font-bold">
RESEARCH
</Button>
</div>
);
}
export default NavPages;
+27
View File
@@ -0,0 +1,27 @@
import React from "react";
import { Button } from "../ui/button";
import NavbarSearch from "./NavbarSearch";
import { Circle, icons } from "lucide-react";
import NavPages from "./NavPages";
function Navbar() {
return (
<div className="h-16 p-4 w-screen flex flex-row justify-between items-center">
<div className="flex">
<Button variant="linkNoUnderline" className="text-3xl font-bold">
YellowBird
</Button>
<NavPages />
</div>
<div className="flex">
<NavbarSearch />
<Button className="rounded-full" size="icon">
ME
</Button>
</div>
</div>
);
}
export default Navbar;
+25
View File
@@ -0,0 +1,25 @@
import React from "react";
import { Input } from "../ui/input";
import { Button } from "../ui/button";
import { Search } from "lucide-react";
function NavbarSearch() {
return (
<div className="flex items-center px-4">
<div className="">
<Input
className="rounded-full rounded-r-none min-w-80 bg-inherit border-primary p-4"
type="search"
placeholder="Search"
/>
</div>
<div className="">
<Button type="submit" className="w-14 rounded-full rounded-l-none">
<Search size={16} />
</Button>
</div>
</div>
);
}
export default NavbarSearch;
+9
View File
@@ -0,0 +1,9 @@
"use client";
import * as React from "react";
import { ThemeProvider as NextThemesProvider } from "next-themes";
import { type ThemeProviderProps } from "next-themes/dist/types";
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
}
+57
View File
@@ -0,0 +1,57 @@
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "@/lib/utils";
const buttonVariants = cva(
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
{
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-input 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",
linkNoUnderline: "text-primary",
},
size: {
default: "h-10 px-4 py-2",
sm: "h-9 rounded-md px-3",
lg: "h-11 rounded-md px-8",
icon: "h-10 w-10",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
);
export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean;
}
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button";
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
);
}
);
Button.displayName = "Button";
export { Button, buttonVariants };
+25
View File
@@ -0,0 +1,25 @@
import * as React from "react";
import { cn } from "@/lib/utils";
export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {}
const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, type, ...props }, ref) => {
return (
<input
type={type}
className={cn(
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
className
)}
ref={ref}
{...props}
/>
);
}
);
Input.displayName = "Input";
export { Input };
+6
View File
@@ -0,0 +1,6 @@
import { type ClassValue, clsx } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
+72 -12
View File
@@ -1,20 +1,80 @@
import type { Config } from "tailwindcss"; import type { Config } from "tailwindcss"
const config: Config = { const config = {
darkMode: ["class"],
content: [ content: [
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}", './pages/**/*.{ts,tsx}',
"./src/components/**/*.{js,ts,jsx,tsx,mdx}", './components/**/*.{ts,tsx}',
"./src/app/**/*.{js,ts,jsx,tsx,mdx}", './app/**/*.{ts,tsx}',
'./src/**/*.{ts,tsx}',
], ],
prefix: "",
theme: { theme: {
container: {
center: true,
padding: "2rem",
screens: {
"2xl": "1400px",
},
},
extend: { extend: {
backgroundImage: { colors: {
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))", border: "hsl(var(--border))",
"gradient-conic": input: "hsl(var(--input))",
"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))", ring: "hsl(var(--ring))",
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
primary: {
DEFAULT: "hsl(var(--primary))",
foreground: "hsl(var(--primary-foreground))",
},
secondary: {
DEFAULT: "hsl(var(--secondary))",
foreground: "hsl(var(--secondary-foreground))",
},
destructive: {
DEFAULT: "hsl(var(--destructive))",
foreground: "hsl(var(--destructive-foreground))",
},
muted: {
DEFAULT: "hsl(var(--muted))",
foreground: "hsl(var(--muted-foreground))",
},
accent: {
DEFAULT: "hsl(var(--accent))",
foreground: "hsl(var(--accent-foreground))",
},
popover: {
DEFAULT: "hsl(var(--popover))",
foreground: "hsl(var(--popover-foreground))",
},
card: {
DEFAULT: "hsl(var(--card))",
foreground: "hsl(var(--card-foreground))",
},
},
borderRadius: {
lg: "var(--radius)",
md: "calc(var(--radius) - 2px)",
sm: "calc(var(--radius) - 4px)",
},
keyframes: {
"accordion-down": {
from: { height: "0" },
to: { height: "var(--radix-accordion-content-height)" },
},
"accordion-up": {
from: { height: "var(--radix-accordion-content-height)" },
to: { height: "0" },
},
},
animation: {
"accordion-down": "accordion-down 0.2s ease-out",
"accordion-up": "accordion-up 0.2s ease-out",
}, },
}, },
}, },
plugins: [], plugins: [require("tailwindcss-animate")],
}; } satisfies Config
export default config;
export default config