basic structure and a bit of content
Some checks failed
Build and docker image / Build (pull_request) Failing after 14s
Some checks failed
Build and docker image / Build (pull_request) Failing after 14s
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import * as elements from "typed-html";
|
||||
|
||||
const HomeLayout = ({ children }: elements.Children) => `
|
||||
const BaseHTML = ({ children }: elements.Children) => `
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<script src="https://unpkg.com/htmx.org@1.9.5"></script>
|
||||
@@ -12,4 +12,4 @@ const HomeLayout = ({ children }: elements.Children) => `
|
||||
</body>
|
||||
`;
|
||||
|
||||
export { HomeLayout }
|
||||
export { BaseHTML }
|
||||
20
frontend/src/components/footer.tsx
Normal file
20
frontend/src/components/footer.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { FooterLink } from "../structs/footer_link";
|
||||
|
||||
const Footer = ({ footer_links }: {footer_links: FooterLink[]}) => {
|
||||
return (
|
||||
<footer class={'w-full h-32 bg-gray-800 flex items-center justify-center'}>
|
||||
{footer_links.map((link) => {
|
||||
return (
|
||||
<a href={link.url} class={'mx-2'}>
|
||||
<i class={`fas fa-${
|
||||
link.icon_name
|
||||
} text-white`}></i>
|
||||
</a>
|
||||
);
|
||||
}
|
||||
)}
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
|
||||
export { Footer }
|
||||
20
frontend/src/components/hero.tsx
Normal file
20
frontend/src/components/hero.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
const Hero = () => {
|
||||
return (
|
||||
<div class="bg-gradient-to-r from-purple-700 via-blue-900 to-red-500 w-screen h-screen" id="hero">
|
||||
<div class="flex flex-col items-center justify-center h-full">
|
||||
<div class="text-6xl font-bold text-white">Welcome to <span class="font-mono">moll.re</span></div>
|
||||
<div class="text-2xl text-white">An exciting journey!</div>
|
||||
<button class="px-4 py-2 my-4 text-lg font-semibold text-white bg-blue-500 rounded hover:bg-blue-600">
|
||||
Explore
|
||||
</button>
|
||||
<div class="mt-4 animate-bounce">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-white animate-bounce" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 14l-7 7m0 0l-7-7m7 7V3"></path>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export { Hero}
|
||||
20
frontend/src/components/navigation.tsx
Normal file
20
frontend/src/components/navigation.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
const Navigation = () => {
|
||||
return(
|
||||
<nav id={'header'} class={'flex-no-wrap sticky w-screen py-2 shadow-black/5'}>
|
||||
<ul class="flex">
|
||||
<li class="mr-3">
|
||||
<a class="inline-block border border-blue-500 rounded py-1 px-3 bg-blue-500 text-white" href="#">Active Pill</a>
|
||||
</li>
|
||||
<li class="mr-3">
|
||||
<a class="inline-block border border-white rounded hover:border-gray-200 text-blue-500 hover:bg-gray-200 py-1 px-3" href="#">Pill</a>
|
||||
</li>
|
||||
<li class="mr-3">
|
||||
<a class="inline-block py-1 px-3 text-gray-400 cursor-not-allowed" href="#">Disabled Pill</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
);
|
||||
};
|
||||
|
||||
export { Navigation }
|
||||
24
frontend/src/components/timeline.tsx
Normal file
24
frontend/src/components/timeline.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import * as elements from "typed-html";
|
||||
import { TimelineCard } from "./timeline_card";
|
||||
import { TimelineItem } from "../structs/timeline_item";
|
||||
|
||||
const Timeline = ({ timeline_items }: {timeline_items: TimelineItem[]}) => {
|
||||
return (
|
||||
<div class={'container md:p-3'}>
|
||||
<div class="flex flex-col items-center justify-center">
|
||||
<div class="text-6xl font-bold text-black">Timeline</div>
|
||||
<div class="text-2xl text-black">A little about us</div>
|
||||
<ol class="relative border-s border-gray-200 dark:border-gray-700">
|
||||
{timeline_items.map((item, index) => (
|
||||
// <div class={`card ${index % 2 === 0 ? 'left' : 'right'}`}>
|
||||
<li class={`mb-10 ms-6 p-4 rounded-lg shadow-md ${index % 2 === 0 ? 'bg-white' : 'bg-gray-200'}`}>
|
||||
<TimelineCard {...item}/>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export { Timeline }
|
||||
22
frontend/src/components/timeline_card.tsx
Normal file
22
frontend/src/components/timeline_card.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import * as elements from "typed-html";
|
||||
|
||||
import { TimelineItem } from "../structs/timeline_item";
|
||||
|
||||
|
||||
|
||||
const TimelineCard = ({ date_start, date_end, title, description, icon_name}: TimelineItem) => {
|
||||
return (
|
||||
<div>
|
||||
<span class="absolute flex items-center justify-center w-6 h-6 bg-blue-100 rounded-full -start-3 ring-8 ring-white dark:ring-gray-900 dark:bg-blue-900">
|
||||
<svg class="w-2.5 h-2.5 text-blue-800 dark:text-blue-300" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M20 4a2 2 0 0 0-2-2h-2V1a1 1 0 0 0-2 0v1h-3V1a1 1 0 0 0-2 0v1H6V1a1 1 0 0 0-2 0v1H2a2 2 0 0 0-2 2v2h20V4ZM0 18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8H0v10Zm5-8h10a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z"/>
|
||||
</svg>
|
||||
</span>
|
||||
<h3 class="mb-1 text-lg font-semibold text-gray-900">{ title }</h3>
|
||||
<time class="block mb-2 text-sm font-normal leading-none text-gray-400 dark:text-gray-500">{ date_start.toLocaleDateString() } - { date_end.toLocaleDateString() }</time>
|
||||
<p class="text-base font-normal text-gray-500 dark:text-gray-400">{ description }</p>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export { TimelineCard }
|
||||
@@ -2,26 +2,112 @@ import { Elysia } from "elysia";
|
||||
import { html } from "@elysiajs/html";
|
||||
import { staticPlugin } from "@elysiajs/static";
|
||||
|
||||
// import { autoroutes } from "elysia-autoroutes";
|
||||
// import { Store } from "./store";
|
||||
// // @ts-ignore
|
||||
// import data from "../package.json";
|
||||
import { BaseHTML } from "./base";
|
||||
import { LandingPage } from "./pages/landing";
|
||||
|
||||
import { HomeLayout } from "./layout";
|
||||
import { Landing } from "./landing";
|
||||
import { TimelineItem } from "./structs/timeline_item";
|
||||
import { FooterLink } from "./structs/footer_link";
|
||||
|
||||
const timeline_items: TimelineItem[] = [
|
||||
{
|
||||
date_start: new Date(),
|
||||
date_end: new Date(),
|
||||
title: "First",
|
||||
description: "Description number 1",
|
||||
icon_name: "world",
|
||||
},
|
||||
{
|
||||
date_start: new Date(),
|
||||
date_end: new Date(),
|
||||
title: "Hello",
|
||||
description: "Description number 2",
|
||||
icon_name: "world",
|
||||
},
|
||||
{
|
||||
date_start: new Date(),
|
||||
date_end: new Date(),
|
||||
title: "Hello",
|
||||
description: "Longer description number 3",
|
||||
icon_name: "world",
|
||||
},
|
||||
{
|
||||
date_start: new Date(),
|
||||
date_end: new Date(),
|
||||
title: "Hello",
|
||||
description: "Very looooooooooong description number 4",
|
||||
icon_name: "world",
|
||||
},
|
||||
{
|
||||
date_start: new Date(),
|
||||
date_end: new Date(),
|
||||
title: "Hello",
|
||||
description: "Description number 5",
|
||||
icon_name: "world",
|
||||
},
|
||||
{
|
||||
date_start: new Date(),
|
||||
date_end: new Date(),
|
||||
title: "Hello",
|
||||
description: "Description number 6",
|
||||
icon_name: "world",
|
||||
},
|
||||
{
|
||||
date_start: new Date(),
|
||||
date_end: new Date(),
|
||||
title: "Hello",
|
||||
description: "Description number 7",
|
||||
icon_name: "world",
|
||||
},
|
||||
{
|
||||
date_start: new Date(),
|
||||
date_end: new Date(),
|
||||
title: "Hello",
|
||||
description: "Description number 8",
|
||||
icon_name: "world",
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
const footer_links: FooterLink[] = [
|
||||
{
|
||||
icon_name: "github",
|
||||
title: "Github",
|
||||
url: "https://github.com",
|
||||
},
|
||||
{
|
||||
icon_name: "twitter",
|
||||
title: "Twitter",
|
||||
url: "https://twitter.com",
|
||||
},
|
||||
{
|
||||
icon_name: "linkedin",
|
||||
title: "LinkedIn",
|
||||
url: "https://linkedin.com",
|
||||
},
|
||||
{
|
||||
icon_name: "instagram",
|
||||
title: "Instagram",
|
||||
url: "https://instagram.com",
|
||||
},
|
||||
{
|
||||
icon_name: "facebook",
|
||||
title: "Facebook",
|
||||
url: "https://facebook.com",
|
||||
},
|
||||
];
|
||||
|
||||
const content = {
|
||||
'timeline_items': timeline_items,
|
||||
'footer_links': footer_links,
|
||||
};
|
||||
|
||||
export const server = new Elysia()
|
||||
.use(html())
|
||||
.use(staticPlugin())
|
||||
// .get("/public/htmx.js", () =>
|
||||
// Bun.file("node_modules/htmx.org/dist/htmx.min.js"),
|
||||
// )
|
||||
// .state("store", new Store())
|
||||
// .state("version", data.version)
|
||||
.onError(({ code, error }) => {
|
||||
console.error(code, error);
|
||||
})
|
||||
.get("/", ({html}) => html(<HomeLayout><Landing></Landing></HomeLayout>))
|
||||
.get("/", ({html}) => html(<BaseHTML><LandingPage{content}/></BaseHTML>))
|
||||
.post("/clicked", ()=> <div>Hello?</div>)
|
||||
|
||||
.listen(Bun.env["PORT"] ?? 3000);
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import * as elements from "typed-html";
|
||||
|
||||
const Landing = ({ children }: elements.Children) => `
|
||||
<button hx-post="/clicked" hx-swap="outerHTML" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
|
||||
Click me
|
||||
</button>
|
||||
${children}
|
||||
`;
|
||||
|
||||
export { Landing }
|
||||
20
frontend/src/pages/landing.tsx
Normal file
20
frontend/src/pages/landing.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import * as elements from "typed-html";
|
||||
import { Timeline } from "../components/timeline";
|
||||
import { Navigation } from "../components/navigation";
|
||||
import { Hero } from "../components/hero";
|
||||
import { Footer } from "../components/footer";
|
||||
|
||||
|
||||
const LandingPage = ({ content }: Dict) => {
|
||||
return (
|
||||
<div class={'w-full h-full'}>
|
||||
<Hero />
|
||||
<Navigation />
|
||||
<Timeline {content['timeline_items']}/>
|
||||
<Footer {content['footer_links']}/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
export { LandingPage }
|
||||
0
frontend/src/pages/portfolio.tsx
Normal file
0
frontend/src/pages/portfolio.tsx
Normal file
7
frontend/src/structs/footer_link.tsx
Normal file
7
frontend/src/structs/footer_link.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
type FooterLink = {
|
||||
icon_name: string;
|
||||
title: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
export { FooterLink }
|
||||
9
frontend/src/structs/timeline_item.tsx
Normal file
9
frontend/src/structs/timeline_item.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
type TimelineItem = {
|
||||
date_start: Date;
|
||||
date_end: Date;
|
||||
title: string;
|
||||
description: string;
|
||||
icon_name: string;
|
||||
}
|
||||
|
||||
export { TimelineItem }
|
||||
Reference in New Issue
Block a user