trivial fixes

This commit is contained in:
bronkuu 2026-06-02 23:39:03 +02:00
parent 8512c9e3d7
commit dd50d34703
17 changed files with 25 additions and 31 deletions

BIN
.DS_Store vendored

Binary file not shown.

2
.gitignore vendored
View file

@ -1,2 +1,4 @@
www www
docker-compose.yml docker-compose.yml
todo.txt
.DS_Store

View file

@ -71,11 +71,11 @@
} }
} }
top: 0; transform: translateY(0);
transition: top 0.2s; transition: transform 0.2s;
&:hover { &:hover {
top: -10px; transform: translateY(-10px);
& img { & img {
scale: 1.1; scale: 1.1;

3
html/doc.go Normal file
View file

@ -0,0 +1,3 @@
//go:generate templ generate
package html

View file

@ -7,7 +7,7 @@ import (
"piekarnikgosi/utils" "piekarnikgosi/utils"
) )
func processFilename(input string) (src, dst string) { func imageSrcDst(input string) (src, dst string) {
src = "img/" + input src = "img/" + input
hash := sha256.Sum256([]byte(input)) hash := sha256.Sum256([]byte(input))
dst = "www/images/" + hex.EncodeToString(hash[:])[:16] + ".avif" dst = "www/images/" + hex.EncodeToString(hash[:])[:16] + ".avif"
@ -15,7 +15,7 @@ func processFilename(input string) (src, dst string) {
} }
func ProcessImage(fileName string) string { func ProcessImage(fileName string) string {
dst, err := utils.CopyFile(processFilename(fileName)) dst, err := utils.CopyIfNotExists(imageSrcDst(fileName))
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)

View file

@ -15,7 +15,7 @@ import (
"piekarnikgosi/utils" "piekarnikgosi/utils"
) )
func processFilename(input string) (src, dst string) { func imageSrcDst(input string) (src, dst string) {
src = "img/" + input src = "img/" + input
hash := sha256.Sum256([]byte(input)) hash := sha256.Sum256([]byte(input))
dst = "www/images/" + hex.EncodeToString(hash[:])[:16] + ".avif" dst = "www/images/" + hex.EncodeToString(hash[:])[:16] + ".avif"
@ -23,7 +23,7 @@ func processFilename(input string) (src, dst string) {
} }
func ProcessImage(fileName string) string { func ProcessImage(fileName string) string {
dst, err := utils.CopyFile(processFilename(fileName)) dst, err := utils.CopyIfNotExists(imageSrcDst(fileName))
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)

View file

@ -156,7 +156,7 @@ templ Kawiarnia() {
<h3>Słodkości</h3> <h3>Słodkości</h3>
<ul> <ul>
<p>Codziennie pieczemy coś innego! Zapytaj obsługę o dzisiejsze smaki.</p> <p>Codziennie pieczemy coś innego! Zapytaj obsługę o dzisiejsze smaki.</p>
<li><p>Domowe ciasta</p><span>10 - 20 LN</span></li> <li><p>Domowe ciasta</p><span>10 - 20 PLN</span></li>
<li><p>Deserki</p><span>5 - 15 PLN</span></li> <li><p>Deserki</p><span>5 - 15 PLN</span></li>
<li><p>Mini Pavlova</p><span>12 PLN</span></li> <li><p>Mini Pavlova</p><span>12 PLN</span></li>
</ul> </ul>
@ -185,7 +185,6 @@ templ Kawiarnia() {
<li><p>Cytryna</p><span>10 PLN</span></li> <li><p>Cytryna</p><span>10 PLN</span></li>
<li><p>Imbir</p><span>10 PLN</span></li> <li><p>Imbir</p><span>10 PLN</span></li>
<li><p>Owocowa</p><span>10 PLN</span></li> <li><p>Owocowa</p><span>10 PLN</span></li>
<li><p>Cappucino</p><span>10 PLN</span></li>
<li><p>Ice Tea</p><span>18 PLN</span></li> <li><p>Ice Tea</p><span>18 PLN</span></li>
</ul> </ul>
</div> </div>

File diff suppressed because one or more lines are too long

BIN
img/.DS_Store vendored

Binary file not shown.

Binary file not shown.

BIN
img/wyroby/.DS_Store vendored

Binary file not shown.

13
main.go
View file

@ -99,13 +99,20 @@ func ensureDir() {
} }
} }
func mustCopy(src, dst string) {
_, err := utils.CopyIfNotExists(src, dst)
if err != nil {
log.Fatalf("copying %s: %s", src, err)
}
}
func main() { func main() {
ensureDir() ensureDir()
generateHTML() generateHTML()
mergeStyles() mergeStyles()
utils.CopyFile("img/favicon.avif", "www/images/favicon.avif") mustCopy("img/favicon.avif", "www/images/favicon.avif")
utils.CopyFile("img/logo.svg", "www/images/logo.svg") mustCopy("img/logo.svg", "www/images/logo.svg")
utils.CopyFile("js/portfolio.js", "www/portfolio.js") mustCopy("js/portfolio.js", "www/portfolio.js")
log.Println("listening on :8000") log.Println("listening on :8000")
log.Fatal(http.ListenAndServe(":8000", http.FileServer(http.Dir("www")))) log.Fatal(http.ListenAndServe(":8000", http.FileServer(http.Dir("www"))))
} }

BIN
resources/.DS_Store vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,17 +0,0 @@
sernik klasyczny
sernik królewski
pleśniak
leśny mech z musem truskawkowym
snickers
mleczna kanapka
3 bit
biszkoptowe z kremem i owocami w galaretce
kora orzechowa
nutelowiec z wiśniami
karpatka
mobile version
fix header alignement in wyroby
lody
portfolio
reszta ciast

View file

@ -6,7 +6,7 @@ import (
"os" "os"
) )
func CopyFile(src, dst string) (string, error) { func CopyIfNotExists(src, dst string) (string, error) {
_, err := os.Stat(dst) _, err := os.Stat(dst)
if err == nil { if err == nil {
return dst, nil return dst, nil