#109 switch svelte to SSR with go

This commit is contained in:
2024-08-21 23:33:06 +02:00
parent eac373739a
commit f3fb046749
53 changed files with 1796 additions and 6353 deletions

65
templates/app.templ Normal file
View File

@@ -0,0 +1,65 @@
package templates
templ App() {
<main class="mx-2">
<form
class="max-w-xl mx-auto flex flex-col gap-4 justify-center mt-10"
>
<h2 class="text-4xl mb-8">Track your workout</h2>
<input
id="date"
type="date"
class="input input-bordered"
value=""
name="date"
/>
<select class="select select-bordered w-full" name="type">
<option>Push Ups</option>
<option>Pull Ups</option>
</select>
<input
type="number"
class="input input-bordered"
placeholder="Sets"
name="sets"
/>
<input
type="number"
class="input input-bordered"
placeholder="Reps"
name="reps"
/>
<button class="btn btn-primary self-end">Save</button>
</form>
<!-- <div class="overflow-x-auto mx-auto max-w-screen-lg"> -->
<!-- <h2 class="text-4xl mt-14 mb-8">Workout history</h2> -->
<!-- <table class="table table-auto max-w-full"> -->
<!-- <thead> -->
<!-- <tr> -->
<!-- <th>Date</th> -->
<!-- <th>Type</th> -->
<!-- <th>Sets</th> -->
<!-- <th>Reps</th> -->
<!-- <th></th> -->
<!-- </tr> -->
<!-- </thead> -->
<!-- -->
<!-- <tbody> -->
<!-- <tr> -->
<!-- <th>{workout.date}</th> -->
<!-- <th>{workout.type}</th> -->
<!-- <th>{workout.sets}</th> -->
<!-- <th>{workout.reps}</th> -->
<!-- <th> -->
<!-- <div class="tooltip" data-tip="Delete Entry"> -->
<!-- <button on:click={() => deleteWorkout(workout.id)}> -->
<!-- <MdiDelete class="text-gray-400 text-lg"></MdiDelete> -->
<!-- </button> -->
<!-- </div> -->
<!-- </th> -->
<!-- </tr> -->
<!-- </tbody> -->
<!-- </table> -->
<!-- </div> -->
</main>
}

12
templates/header.templ Normal file
View File

@@ -0,0 +1,12 @@
package templates
templ header() {
<div class="flex justify-end items-center gap-2 py-1 px-2 md:gap-10 md:px-10 md:py-2 shadow">
<a href="/" class="flex-1 flex gap-2">
<img src="/static/favicon.svg" alt="ME-FIT logo"/>
<span>ME-FIT</span>
</a>
<a href="/signup" class="btn btn-sm">Sign Up</a>
<a href="/signin" class="btn btn-sm">Sign In</a>
</div>
}

16
templates/index.templ Normal file
View File

@@ -0,0 +1,16 @@
package templates
templ Index() {
<div class="hero bg-base-200 h-full">
<div class="hero-content text-center">
<div class="max-w-md">
<h1 class="text-5xl font-bold">Next Level Workout Tracker</h1>
<p class="py-6">
Ever wanted to track your workouts and see your progress over time? ME-FIT is the perfect
solution for you.
</p>
<a href="/app" class="btn btn-primary">Get Started</a>
</div>
</div>
</div>
}

25
templates/layout.templ Normal file
View File

@@ -0,0 +1,25 @@
package templates
templ Layout(comp templ.Component) {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>ME-FIT</title>
<link rel="icon" href="static/favicon.svg"/>
<link rel="stylesheet" href="static/css/tailwind.css"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<script defer src="https://umami.me-fit.eu/script.js" data-website-id="3c8efb09-44e4-4372-8a1e-c3bc675cd89a"></script>
</head>
<body>
<div class="h-screen flex flex-col">
@header()
<div class="flex-1">
if comp != nil {
@comp
}
</div>
</div>
</body>
</html>
}

11
templates/not_found.templ Normal file
View File

@@ -0,0 +1,11 @@
package templates
templ NotFound() {
<main class="flex h-full justify-center items-center ">
<div class="bg-error p-16 rounded-lg">
<h1 class="text-4xl text-error-content mb-5">Not Found</h1>
<p class="text-lg text-error-content mb-5">The page you are looking for does not exist.</p>
<a href="/" class="btn btn-lg btn-primary">Go back to home</a>
</div>
</main>
}