flippy puffer
Jes Olson j3s@c3f.net
Fri, 18 Nov 2022 20:27:50 -0800
2 files changed,
24 insertions(+),
1 deletions(-)
M
main.go
→
main.go
@@ -103,7 +103,8 @@ return template.Template{}, err
} funcMap := template.FuncMap{ - "randomheaderphrase": randomJesPhrase, + "randomheaderphrase": randomJesPhrase, + "randomrotationdegrees": randomRotationDegrees, } tmpl, err := template.New("unimportant").Funcs(funcMap).ParseFiles(layoutPath, requestedPath)@@ -262,6 +263,11 @@ fmt.Fprintf(w, "<tr><td>")
fmt.Fprintf(w, `<a href="%s">%s</a>`, p.Link, p.Title) fmt.Fprintf(w, "</tr></td>") } +} + +func randomRotationDegrees() int { + rand.Seed(time.Now().UnixNano()) + return rand.Intn(500 - -500) + -500 } func randomJesPhrase() string {
M
templates/layout.html
→
templates/layout.html
@@ -16,6 +16,23 @@ max-width: 500px;
margin: 0 auto; padding: 0; } + + @keyframes lol { + from{ + transform: rotate(0deg); + } + to { + transform: rotate({{ randomrotationdegrees }}deg); + } + } + + #header img { + animation: lol; + animation-duration: 1s; + animation-timing-function: ease; + animation-fill-mode: forwards; + animation-delay: 5s; + } #header { font-family: monospace;