fixes
All checks were successful
build / build (push) Successful in 9m39s
release-tag / release-image (push) Successful in 15m35s

This commit is contained in:
Tijl 2024-09-05 20:42:17 +02:00
parent babe977b5d
commit 0f5c93a68c
Signed by: tijl
GPG Key ID: DAE24BFCD722F053
8 changed files with 45 additions and 25 deletions

View File

@ -33,7 +33,7 @@ func Setup() {
a.Get("/app/uploader", func(c *fiber.Ctx) error { a.Get("/app/uploader", func(c *fiber.Ctx) error {
_, err := user.GetSession(c) _, err := user.GetSession(c)
if err != nil { if err != nil {
return c.Redirect("/auth?redirect=/app/uploader", http.StatusUnauthorized) return c.Redirect("/auth?redirect=" + c.Path())
} }
data := *web.Common(c) data := *web.Common(c)
data["Title"] = "tmp" data["Title"] = "tmp"

View File

@ -59,16 +59,21 @@ var services = []Service{
} }
func servicesHandler(c *fiber.Ctx) error { func servicesHandler(c *fiber.Ctx) error {
_, err := user.GetSession(c)
if err != nil {
return c.Redirect("/auth?redirect=" + c.Path())
}
data := *web.Common(c) data := *web.Common(c)
data["Title"] = i18n.Translate(c, "services") data["Title"] = i18n.Translate(c, "services")
data["Services"] = services data["Services"] = services
data["DefaultService"] = "element"
return c.Render("services", data, "layouts/base") return c.Render("services", data, "layouts/base")
} }
func serviceHandler(c *fiber.Ctx) error { func serviceHandler(c *fiber.Ctx) error {
_, err := user.GetSession(c) _, err := user.GetSession(c)
if err != nil { if err != nil {
return c.Next() return c.Redirect("/auth?redirect=" + c.Path())
} }
for _, service := range services { for _, service := range services {
if service.Slug == c.Params("service") { if service.Slug == c.Params("service") {
@ -81,7 +86,7 @@ func serviceHandler(c *fiber.Ctx) error {
func serviceInfoHandler(c *fiber.Ctx) error { func serviceInfoHandler(c *fiber.Ctx) error {
_, err := user.GetSession(c) _, err := user.GetSession(c)
if err != nil { if err != nil {
return c.Next() return c.Redirect("/auth?redirect=" + c.Path())
} }
for _, service := range services { for _, service := range services {
if service.Slug == c.Params("service") { if service.Slug == c.Params("service") {

View File

@ -14,11 +14,11 @@ module.exports = {
primary: "#f7931a", primary: "#f7931a",
secondary: "#804df3", // #804df3 secondary: "#804df3", // #804df3
accent: "#66c4fa", // #66c4fa accent: "#66c4fa", // #66c4fa
neutral: "#f7931a", // #212121 neutral: "#212121", // #212121
//"base-100": "#181818", // previously 171717 //"base-100": "#181818", // previously 171717
"base-100": "#0B0908", "base-100": "#0B0908",
"base-200": "#0B0908", // previously 151515 "base-200": "#0B0908", // previously 151515
"base-300": "#121212", // previously 121212 "base-300": "#151515", // previously 121212
info: "#0ea5e9", info: "#0ea5e9",
success: "#22c55e", success: "#22c55e",
warning: "#FBBD23", warning: "#FBBD23",

View File

@ -6,6 +6,15 @@
.btn:not(.btn-ghost) { .btn:not(.btn-ghost) {
@apply border-base-300 border-2; @apply border-base-300 border-2;
} }
.btn:not(.btn-primary) {
@apply hover:bg-base-300;
}
.input {
@apply border-2 border-base-300;
}
.active {
@apply !bg-primary !text-black;
}
} }
@layer base { @layer base {
@ -25,11 +34,12 @@
} }
@font-face { @font-face {
font-family: 'CantarellVF'; font-family: 'Cantarell', sans-serif;
src: url('/static/fonts/Cantarell-VF.woff2'), format('woff2'); src: url('/static/fonts/Cantarell-VF.woff2'), format('woff2');
font-weight: Regular; font-weight: Regular;
font-style: normal; font-style: normal;
font-display: swap; font-display: swap;
font-weight: 1 1000;
} }

View File

@ -2,7 +2,7 @@
<div class="grid gap-4"> <div class="grid gap-4">
{{range .Posts}} {{range .Posts}}
<a href="/blog/{{.Meta.Slug}}" <a href="/blog/{{.Meta.Slug}}"
class="card posts-item bg-base-100 border-[2px] border-base-300 shadow-xl cursor-pointer"> class="card posts-item bg-base-100 border-[2px] border-base-300 hover:bg-base-300 shadow-xl cursor-pointer">
<div class="card-body"> <div class="card-body">
<header class="card-title"> <header class="card-title">
<h2 class="card-title text-2xl">{{.Meta.Title}}</h2> <h2 class="card-title text-2xl">{{.Meta.Title}}</h2>

View File

@ -0,0 +1 @@
<button class="btn">Hello Button</button>

View File

@ -1,5 +1,5 @@
<nav hx-boost="true" class="z-[100] flex fixed mx-auto w-full md:w-[80%] lg:w-[75%]"> <nav hx-boost="true" class="flex fixed mx-auto w-full md:w-[80%] lg:w-[75%] z-[102]">
<div class="mt-4 mx-4 rounded-2xl shadow-xl bg-base-100 border-base-300 border-[2px] navbar"> <div class="mt-4 mx-4 rounded-2xl shadow-xl bg-base-100 border-base-300 border-[2px] navbar z-[103]">
<div class="flex-1"> <div class="flex-1">
<a href="/" class="btn btn-ghost font-mono text-xl">tijl.dev</a> <a href="/" class="btn btn-ghost font-mono text-xl">tijl.dev</a>
</div> </div>
@ -13,9 +13,9 @@
</svg> </svg>
</summary> </summary>
<ul <ul
class="mt-2 z-[101] menu dropdown-content bg-base-100 border-2 border-base-300 border-t-none rounded-t-none rounded-box w-52 p-3 shadow-xl gap-1"> class="menu dropdown-content bg-base-100 border-2 border-base-300 rounded-t-none rounded-box w-52 p-3 shadow-xl gap-1 mt-2">
<li> <li>
<a class='flex gap-4 {{if eq .Path "/"}}active{{end}}' href="/"> <a class='hover:bg-base-300 flex gap-4 {{if eq .Path "/"}}active{{end}}' href="/">
<span class="w-5 text-center"> <span class="w-5 text-center">
{{icon "home" }} {{icon "home" }}
</span> </span>
@ -23,7 +23,7 @@
</a> </a>
</li> </li>
<li> <li>
<a class='flex gap-4 {{if eq .Path "/blog"}}active{{end}}' href="/blog"> <a class='hover:bg-base-300 flex gap-4 {{if eq .Path "/blog"}}active{{end}}' href="/blog">
<span class=" w-5 text-center"> <span class=" w-5 text-center">
{{icon "blog"}} {{icon "blog"}}
</span> </span>
@ -31,7 +31,8 @@
</a> </a>
</li> </li>
<li> <li>
<a class='flex gap-4 {{if eq .Path "/projects"}}active{{end}}' href="/projects"> <a class='hover:bg-base-300 flex gap-4 {{if eq .Path "/projects"}}active{{end}}'
href="/projects">
<span class="w-5 text-center"> <span class="w-5 text-center">
{{icon "projects"}} {{icon "projects"}}
</span> </span>
@ -40,7 +41,8 @@
</li> </li>
{{if .SignedIn}} {{if .SignedIn}}
<li> <li>
<a class='flex gap-4 {{if eq .Path "/services"}}active{{end}}' href="/services"> <a class='hover:bg-base-300 flex gap-4 {{if eq .Path "/services"}}active{{end}}'
href="/services">
<span class="w-5 text-center"> <span class="w-5 text-center">
{{icon "services"}} {{icon "services"}}
</span> </span>
@ -49,16 +51,17 @@
</li> </li>
{{end}} {{end}}
<li> <li>
<a class='flex gap-4 {{if eq .Path "/about"}}active{{end}}' href="/about"> <a class='hover:bg-base-300 flex gap-4 {{if eq .Path "/about"}}active{{end}}' href="/about">
<span class="w-5 text-center"> <span class="w-5 text-center">
{{icon "about"}} {{icon "about"}}
</span> </span>
<span class="text-base">{{.T.about}}</span> <span class="text-base">{{.T.about}}</span>
</a> </a>
</li> </li>
<li class="flex-none"> <li>
<details class="dropdown"> <details>
<summary><button type="menu" class="flex gap-4"> <summary class="hover:bg-base-300">
<button class="flex gap-4">
<span class="w-5 text-center"> <span class="w-5 text-center">
{{icon "language"}} {{icon "language"}}
</span> </span>
@ -66,10 +69,9 @@
</button> </button>
</summary> </summary>
<ul <ul>
class="menu dropdown-content z-[102] bg-base-100 border-2 border-base-300 rounded-box w-48 p-3 shadow-xl gap-1">
<li> <li>
<a class='flex gap-4 {{if eq .Language "en"}}active{{end}}' <a class='mt-1 gap-4 hover:bg-base-300 flex {{if eq .Language "en"}}active{{end}}'
href="/settings?lang=en&redirect={{.Path}}"> href="/settings?lang=en&redirect={{.Path}}">
<span class="w-5 h-5 text-center"> <span class="w-5 h-5 text-center">
🇬🇧 🇬🇧
@ -80,7 +82,7 @@
</a> </a>
</li> </li>
<li> <li>
<a class='flex gap-4 {{if eq .Language "nl"}}active{{end}}' <a class='mt-1 gap-4 hover:bg-base-300 flex {{if eq .Language "nl"}}active{{end}}'
href="/settings?lang=nl&redirect={{.Path}}"> href="/settings?lang=nl&redirect={{.Path}}">
<span class="w-5 h-5 text-center"> <span class="w-5 h-5 text-center">
🇳🇱 🇳🇱
@ -89,13 +91,12 @@
{{.T.dutch}} {{.T.dutch}}
</span> </span>
</a> </a>
</li>
</ul> </ul>
</details> </details>
</li> </li>
<li> <li>
{{if .SignedIn}} {{if .SignedIn}}
<a class='flex gap-4 {{if eq .Path "/account"}}active{{end}}' href="/account"> <a class='hover:bg-base-300 flex gap-4 {{if eq .Path "/account"}}active{{end}}' href="/account">
<span class="w-5 text-center"> <span class="w-5 text-center">
{{icon "login"}} {{icon "login"}}
</span> </span>

View File

@ -65,6 +65,9 @@
} }
} }
}) })
} else {
window.location = window.location + "#" + `{{.DefaultService}}`
hashChange()
} }
} }