Skip to content

Commit 43b6fd1

Browse files
authored
create a website for embodi (#182)
2 parents 60b7d24 + 9474e36 commit 43b6fd1

23 files changed

+1065
-37
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ jobs:
4242
- name: Unit Test
4343
run: pnpm run test:ci
4444
- name: Build && publint
45+
env:
46+
#TODO: Change this later
47+
VITE_FORMURL: http://localhost:3011/f/random
4548
run: pnpm run prepublishOnly
4649
- name: Publish Dry Run
4750
run: pnpm -r publish --dry-run --no-git-checks

.github/workflows/playwright.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ jobs:
2626
- name: Install dependencies
2727
run: pnpm install
2828
- name: Build Embodi
29+
env:
30+
#TODO: Change this later
31+
VITE_FORMURL: http://localhost:3011/f/random
2932
run: pnpm run build
3033
- name: Install Playwright Browsers
3134
run: pnpm run test:e2e:init

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ node_modules/
66
packages/e2e/playwright-report/
77

88
packages/e2e/test-results/
9+
10+
.env*

packages/site/.embodi.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineConfig } from "embodi";
2+
import tailwindcss from "@tailwindcss/vite";
3+
4+
export default defineConfig({
5+
publicDir: "./public",
6+
layoutDir: "./__layout",
7+
source: "/content",
8+
plugins: [tailwindcss()],
9+
});

packages/site/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
---
3+
4+
# Embodi skeleton project
5+
6+
This project was created with `embodi` a static site generator.
7+
8+
Run `npm run dev` to start developing and `npm run build`to build a production ready version.

packages/site/__layout/Home.svelte

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<script>
2+
import Header from './comp/Header.svelte';
3+
import Footer from './comp/Footer.svelte';
4+
import InputFrame from './comp/InputFrame.svelte';
5+
import Input from './comp/Input.svelte';
6+
import Button from './comp/Button.svelte';
7+
import { Send, Mail } from 'lucide-svelte';
8+
import "../app.css";
9+
10+
let { data, children } = $props();
11+
</script>
12+
13+
<Header showName={false}>
14+
</Header>
15+
<main>
16+
<div class="markdown">
17+
{@render children?.()}
18+
</div>
19+
<form method="POST" action={import.meta.env.VITE_FORMURL}>
20+
<InputFrame>
21+
<Mail />
22+
<Input name="email" placeholder="Your mail address" />
23+
<Button type="sumbit"><Send size={16} /></Button>
24+
</InputFrame>
25+
</form>
26+
27+
</main>
28+
<Footer>
29+
</Footer>
30+
31+
<style>
32+
@reference "tailwindcss/theme";
33+
34+
main {
35+
@apply max-w-3xl mx-auto p-4 min-h-full;
36+
@apply flex flex-col gap-4 items-center justify-center;
37+
}
38+
39+
.markdown {
40+
@apply text-center;
41+
}
42+
43+
:global(h1) {
44+
@apply text-5xl font-bold mb-4;
45+
}
46+
47+
:global(h2) {
48+
@apply text-3xl font-bold mb-4;
49+
}
50+
</style>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
@reference "tailwindcss/theme";
2+
3+
button {
4+
@apply flex flex-row items-center justify-center gap-2 text-nowrap;
5+
@apply cursor-pointer p-3;
6+
@apply rounded-lg focus:ring-2 focus:ring-teal-600 focus:outline-none;
7+
}
8+
9+
button:enabled {
10+
@apply transform transition-all duration-300 ease-in-out hover:scale-105;
11+
}
12+
13+
button:not(.transparent) {
14+
@apply bg-teal-400 shadow-md;
15+
16+
&.error {
17+
@apply bg-red-400;
18+
}
19+
20+
&:enabled {
21+
@apply hover:bg-teal-500;
22+
}
23+
}
24+
25+
button.transparent {
26+
@apply bg-transparent text-teal-700;
27+
28+
&.error {
29+
@apply text-red-700;
30+
}
31+
32+
&:enabled {
33+
@apply hover:text-teal-800;
34+
}
35+
}
36+
37+
:global(.dark) {
38+
button:not(.transparent) {
39+
@apply bg-teal-800 hover:bg-teal-700;
40+
41+
&.error {
42+
@apply hover:bg-red-700;
43+
}
44+
45+
&:enabled {
46+
@apply hover:bg-teal-700;
47+
}
48+
}
49+
50+
button.transparent {
51+
@apply text-teal-600;
52+
53+
&.error {
54+
@apply text-red-400;
55+
}
56+
57+
&:enabled {
58+
@apply hover:text-teal-500;
59+
}
60+
}
61+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<script lang="ts">
2+
const { children, transparent = false, error = false, disabled = false, ...props } = $props();
3+
</script>
4+
5+
<button disabled={error === true || disabled === true} class:error class:transparent {...props}>
6+
{@render children()}
7+
</button>
8+
9+
<style>
10+
@import './Button.css';
11+
</style>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<script>
2+
import { Github } from 'lucide-svelte';
3+
</script>
4+
5+
<footer>
6+
7+
<a
8+
title="Link to source code on github"
9+
href="https://github.com/embodijs/generator"
10+
target="_blank"
11+
rel="noopener noreferrer"><Github /></a
12+
>
13+
<span>This site is build with embodi by <a href="https://dropanote.de">CordlessWool</a></span>
14+
</footer>
15+
16+
<style>
17+
@reference "tailwindcss/theme";
18+
footer {
19+
@apply my-3 flex flex-wrap items-center justify-center gap-y-5 text-zinc-600;
20+
@apply divide-x-2 divide-zinc-600;
21+
}
22+
23+
footer > * {
24+
@apply px-5;
25+
}
26+
27+
:global(.dark) {
28+
footer {
29+
@apply text-zinc-400;
30+
}
31+
}
32+
a {
33+
@apply underline-offset-4 hover:font-bold hover:underline;
34+
@apply transform transition-all duration-300 ease-in-out hover:scale-105;
35+
}
36+
</style>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<script lang="ts">
2+
import type { Snippet } from 'svelte';
3+
import ToggleTheme from './ToggleTheme.svelte';
4+
5+
type Props = {
6+
children?: Snippet;
7+
showName?: boolean;
8+
};
9+
10+
const { children, showName = true }: Props = $props();
11+
</script>
12+
13+
<header class:name={showName}>
14+
{#if showName}
15+
<a href="/" class="name">embodi</a>
16+
{/if}
17+
<nav>
18+
<ToggleTheme />
19+
{@render children?.()}
20+
</nav>
21+
</header>
22+
23+
<style>
24+
@reference "tailwindcss/theme";
25+
header {
26+
@apply flex items-center justify-end gap-3 p-3;
27+
}
28+
29+
header.name {
30+
@apply justify-between;
31+
}
32+
33+
header > .name {
34+
@apply justify-self-start text-2xl font-bold;
35+
}
36+
37+
nav {
38+
@apply flex items-center gap-3;
39+
}
40+
nav :global(button),
41+
nav :global(a) {
42+
@apply cursor-pointer underline-offset-4 hover:font-bold hover:underline;
43+
@apply transform transition-all duration-300 ease-in-out hover:scale-105;
44+
}
45+
</style>

0 commit comments

Comments
 (0)