WIP: Major Update 0.2 #3
8 changed files with 70 additions and 27 deletions
Small fixes, Fix lint, Expand dropdown to have correct style and add icon
commit
c1d8ff9049
|
|
@ -1,20 +1,28 @@
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
|
|
||||||
import Referencelink from "@/components/ui/Referencelink";
|
|
||||||
import RoundedContainer from "@/components/ui/RoundedContainer";
|
import RoundedContainer from "@/components/ui/RoundedContainer";
|
||||||
|
import NavLink from "@/components/ui/NavLink";
|
||||||
|
|
||||||
export default function Hannah() {
|
export default function Hannah() {
|
||||||
return (
|
return (
|
||||||
<div className="flex h-full w-full justify-center py-10">
|
<div className="flex h-full w-full justify-center py-10">
|
||||||
<RoundedContainer slim={false}>
|
<RoundedContainer slim={false}>
|
||||||
<div className="flex w-full flex-row justify-between">
|
<div className="flex w-full flex-row justify-between">
|
||||||
<Referencelink name={"Projects"} link={"/Hannah/Projects"} />
|
<NavLink name={"Projects"} link={"/Hannah/Projects"} />
|
||||||
<Referencelink name={"CV"} link={"/Hannah/CV"} />
|
<NavLink name={"CV"} link={"/Hannah/CV"} />
|
||||||
</div>
|
</div>
|
||||||
<div className="flex w-full flex-col space-y-2 py-10">
|
<div className="flex w-full flex-col space-y-2 py-10">
|
||||||
<h1 className="text-2xl font-bold">Hi!</h1>
|
<h1 className="text-2xl font-bold">Hi!</h1>
|
||||||
<p>{"I'm Hannah, and I made this website! It's currently very much in it's early stages, but I am actively developing it and soon it'll hopefully contain some good examples of what I do. Besides being a place to display my projects, it also acts as a hub for the different services I've incorporated into our home web ecosystem, or HomeLab."}</p>
|
<p>
|
||||||
<p>{"If you came here from a job application, chances are you'll want to take a look at the Projects tab. As said It's still fairly new, but it'll give you a good example of what I put my time into! Just press the \"Projects\" button if you're interested"}</p>
|
{
|
||||||
|
"I'm Hannah, and I made this website! It's currently very much in it's early stages, but I am actively developing it and soon it'll hopefully contain some good examples of what I do. Besides being a place to display my projects, it also acts as a hub for the different services I've incorporated into our home web ecosystem, or HomeLab."
|
||||||
|
}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
{
|
||||||
|
"If you came here from a job application, chances are you'll want to take a look at the Projects tab. As said It's still fairly new, but it'll give you a good example of what I put my time into! Just press the \"Projects\" button if you're interested"
|
||||||
|
}
|
||||||
|
</p>
|
||||||
<p>{"In the meantime, here's a picture of my cat :D"}</p>
|
<p>{"In the meantime, here's a picture of my cat :D"}</p>
|
||||||
<Image
|
<Image
|
||||||
src="/Missy.jpg"
|
src="/Missy.jpg"
|
||||||
|
|
@ -26,5 +34,5 @@ export default function Hannah() {
|
||||||
</div>
|
</div>
|
||||||
</RoundedContainer>
|
</RoundedContainer>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,14 @@ import RoundedContainer from "@/components/ui/RoundedContainer";
|
||||||
|
|
||||||
export default function Components() {
|
export default function Components() {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col items-center gap-4 w-full h-full">
|
<div className="flex flex-col items-center gap-4 w-full h-full px-10">
|
||||||
|
<h1>Dropdown</h1>
|
||||||
|
<Dropdown title="Dropdown" mode="DARK">
|
||||||
|
<NavLink name="Home" link="/" />
|
||||||
|
<NavLink name="Admin" link="/Admin" />
|
||||||
|
<NavLink name="Hannah" link="/Hannah" />
|
||||||
|
</Dropdown>
|
||||||
|
|
||||||
<h1>Button</h1>
|
<h1>Button</h1>
|
||||||
<Button
|
<Button
|
||||||
title={"Button"}
|
title={"Button"}
|
||||||
|
|
@ -49,11 +56,6 @@ export default function Components() {
|
||||||
<p>More Contents</p>
|
<p>More Contents</p>
|
||||||
</div>
|
</div>
|
||||||
</RoundedContainer>
|
</RoundedContainer>
|
||||||
|
|
||||||
<h1>Dropdown</h1>
|
|
||||||
<Dropdown>
|
|
||||||
<p>Hello!</p>
|
|
||||||
</Dropdown>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
|
|
||||||
import RoundedContainer from "@/components/ui/RoundedContainer";
|
import RoundedContainer from "@/components/ui/RoundedContainer";
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
<main className="flex items-center justify-center w-full bg-zinc-200 font-sans dark:bg-slate-800">
|
<main className="flex items-center justify-center w-full bg-zinc-200 font-sans dark:bg-slate-800">
|
||||||
<RoundedContainer>
|
<RoundedContainer slim={false}>
|
||||||
<Image
|
<Image
|
||||||
className="dark:invert"
|
className="dark:invert"
|
||||||
src="/next.svg"
|
src="/next.svg"
|
||||||
|
|
@ -19,7 +19,8 @@ export default function Home() {
|
||||||
Welcome to the Dagemark Server
|
Welcome to the Dagemark Server
|
||||||
</h1>
|
</h1>
|
||||||
<p className="max-w-md text-lg leading-8 text-zinc-600 dark:text-zinc-400 italic">
|
<p className="max-w-md text-lg leading-8 text-zinc-600 dark:text-zinc-400 italic">
|
||||||
Design In Progress, current layout and theme may change, have a good day :D
|
Design In Progress, current layout and theme may change, have a good
|
||||||
|
day :D
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</RoundedContainer>
|
</RoundedContainer>
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,25 @@
|
||||||
import { ComponentProps } from "react";
|
import { ComponentProps } from "react";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
type ButtonProps = ComponentProps<"button"> & {
|
type ButtonProps = ComponentProps<"button"> & {
|
||||||
title: string;
|
title: string;
|
||||||
mode?: "DARK" | "LIGHT";
|
mode?: "DARK" | "LIGHT";
|
||||||
|
icon?: React.ReactElement;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function Button({
|
export default function Button({
|
||||||
title,
|
title,
|
||||||
mode = "LIGHT",
|
mode = "LIGHT",
|
||||||
|
icon,
|
||||||
...props
|
...props
|
||||||
}: ButtonProps) {
|
}: ButtonProps) {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
{...props}
|
{...props}
|
||||||
className={`${mode == "LIGHT" ? "bg-slate-400 dark:bg-slate-800 border-slate-800 hover:bg-slate-500" : "bg-gray-400 dark:bg-slate-900 dark:border-slate-900 border-slate-400 hover:bg-slate-600"} border-4 border-double cursor-pointer font-medium py-2 px-4 rounded-lg shadow-md transition duration-200 ease-in-out`}
|
className={`${mode == "LIGHT" ? "bg-slate-400 dark:bg-slate-800 border-slate-800 hover:bg-slate-500" : "bg-gray-400 dark:bg-slate-900 dark:border-slate-900 border-slate-400 hover:bg-slate-600"} flex flex-row items-center border-4 border-double cursor-pointer font-medium py-2 px-4 rounded-lg shadow-md transition duration-200 ease-in-out`}
|
||||||
>
|
>
|
||||||
{title}
|
{title}
|
||||||
|
{icon}
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,47 @@
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import Button from "./Button";
|
import React from "react";
|
||||||
|
import { ArrowRightIcon } from "@heroicons/react/24/outline";
|
||||||
|
|
||||||
export default function Dropdown({ children }: { children: React.ReactNode }) {
|
import Button from "./Button";
|
||||||
|
import RoundedContainer from "./RoundedContainer";
|
||||||
|
|
||||||
|
export default function Dropdown({
|
||||||
|
title,
|
||||||
|
mode,
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
title?: string;
|
||||||
|
mode?: "DARK" | "LIGHT";
|
||||||
|
children: React.ReactNode;
|
||||||
|
}) {
|
||||||
const [dropped, setDropped] = useState<boolean>(false);
|
const [dropped, setDropped] = useState<boolean>(false);
|
||||||
|
const [degrees, setDegrees] = useState<number>(0);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Button
|
<Button
|
||||||
title="Drop down"
|
title={title ? title : ""}
|
||||||
mode="DARK"
|
mode={mode}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setDropped(!dropped);
|
setDropped(!dropped);
|
||||||
|
if (degrees < 90) {
|
||||||
|
setDegrees(90);
|
||||||
|
} else {
|
||||||
|
setDegrees(0);
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
></Button>
|
icon={
|
||||||
{dropped && <div>{children}</div>}
|
<ArrowRightIcon
|
||||||
|
className={`size-4 transition-transform rotate-${degrees}`}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<RoundedContainer
|
||||||
|
slim={true}
|
||||||
|
className={`${!dropped && "invisible"} absolute z-10 flex flex-col gap-2 transition-discrete duration-150 ease-out`}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</RoundedContainer>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ export default function Form({
|
||||||
<form action={action}>
|
<form action={action}>
|
||||||
<RoundedContainer slim={false}>
|
<RoundedContainer slim={false}>
|
||||||
{children}
|
{children}
|
||||||
<Button title={submitText} type="submit"></Button>
|
<Button title={submitText} type="submit" />
|
||||||
</RoundedContainer>
|
</RoundedContainer>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,16 @@ export default function RoundedContainer({
|
||||||
children,
|
children,
|
||||||
slim = true,
|
slim = true,
|
||||||
direction = "column",
|
direction = "column",
|
||||||
|
className,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
slim?: boolean;
|
slim?: boolean;
|
||||||
direction?: "column" | "row";
|
direction?: "column" | "row";
|
||||||
|
className?: string;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`flex ${slim ? "max-w-6xl" : "max-w-3xl"} rounded-4xl ${direction == "column" ? "flex-col" : "flex-row"} items-center py-8 px-8 bg-gray-400 dark:bg-slate-900 sm:items-start`}
|
className={`flex ${slim ? "max-w-6xl py-3 px-3" : "max-w-3xl py-6 px-6"} rounded-2xl ${direction == "column" ? "flex-col" : "flex-row"} items-center bg-gray-400 dark:bg-slate-900 sm:items-start ${className}`}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
import { RequestInit } from "next/dist/server/web/spec-extension/request";
|
import { RequestInit } from "next/dist/server/web/spec-extension/request";
|
||||||
|
|
||||||
import logger from "../logging/logger";
|
|
||||||
|
|
||||||
const FRONTEND_URL = process.env.NEXT_PUBLIC_FRONTEND_URL;
|
const FRONTEND_URL = process.env.NEXT_PUBLIC_FRONTEND_URL;
|
||||||
|
|
||||||
export async function cmFetch<T>(
|
export async function cmFetch<T>(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue