feat: add two fonts (Title and Content)
All checks were successful
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 3m52s
Build Docker Image / Build-Docker-Image (push) Successful in 3m31s

This commit was merged in pull request #50.
This commit is contained in:
2025-05-04 22:11:22 +02:00
parent 7bda5237e3
commit 3a8c814f2f
10 changed files with 57 additions and 40 deletions

View File

@@ -16,6 +16,7 @@ func SecurityHeaders(serverSettings *types.Settings) func(http.Handler) http.Han
w.Header().Set("Content-Security-Policy",
"default-src 'none'; "+
"script-src 'self'; "+
"font-src 'self'; "+
"connect-src 'self'; "+
"img-src 'self'; "+
"style-src 'self'; "+

View File

@@ -3,9 +3,15 @@
@source './static/**/*.js';
@source './template/**/*.templ';
@theme {
--animate-fade: fadeOut 0.25s ease-in;
body {
@apply font-shippori
}
@theme {
--font-pirata: "Pirata One", sans-serif;
--font-shippori: "Shippori Mincho", sans-serif;
--animate-fade: fadeOut 0.25s ease-in;
@keyframes fadeOut {
0% {
opacity: 1;
@@ -16,3 +22,12 @@
}
}
@font-face {
font-family: "Pirata One";
src: url("/static/font/pirata_one/PirataOne-Regular.ttf") format("truetype");
}
@font-face {
font-family: "Shippori Mincho";
src: url("/static/font/shippori_mincho/ShipporiMincho-Medium.ttf") format("truetype");
}

View File

@@ -83,6 +83,7 @@ func TestIntegrationSecurityHeader(t *testing.T) {
value = resp.Header.Get("Content-Security-Policy")
assert.Equal(t, "default-src 'none'; "+
"script-src 'self'; "+
"font-src 'self'; "+
"connect-src 'self'; "+
"img-src 'self'; "+
"style-src 'self'; "+

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,31 +1,30 @@
package template
templ Layout(slot templ.Component, user templ.Component) {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>spend-sparrow</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"/>
<meta
name="htmx-config"
content='{
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>SpendSparrow</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" />
<meta name="htmx-config" content='{
"includeIndicatorStyles": false,
"selfRequestsOnly": true,
"allowScriptTags": false
}'
/>
}' />
<script src="/static/js/htmx.min.js"></script>
<script src="/static/js/toast.js"></script>
</head>
<body hx-headers='{"csrf-token": "CSRF_TOKEN"}'>
</head>
<body hx-headers='{"csrf-token": "CSRF_TOKEN"}'>
<div class="h-screen flex flex-col">
<div class="flex justify-end items-center gap-2 py-1 px-2 h-12 md:gap-10 md:px-10 md:py-2 shadow-sm">
<a href="/" class="flex-1 flex gap-2">
<img class="w-6" src="/static/favicon.svg" alt="Spend Sparrow logo"/>
<span class="text-xl font-bold">SpendSparrow</span>
<img class="w-6" src="/static/favicon.svg" alt="SpendSparrow logo" />
<span class="text-4xl font-bold font-pirata">SpendSparrow</span>
</a>
@user
</div>
@@ -40,6 +39,7 @@ templ Layout(slot templ.Component, user templ.Component) {
New message arrived.
</div>
</div>
</body>
</html>
</body>
</html>
}