Feature: some styling for related tags

This commit is contained in:
VnPower 2023-06-07 19:51:47 +07:00
parent 221bd4d4b2
commit fcb6961f8e
Signed by: vnpower
GPG key ID: 881DE3DEB966106C
3 changed files with 2 additions and 18 deletions

View file

@ -3,26 +3,12 @@ package handler
import (
"fmt"
"html/template"
"math/rand"
"pixivfe/configs"
"regexp"
"strconv"
"strings"
)
func GetRandomColor() string {
// Some color shade I generated
colors := []string{
// Green
"#3cc223",
"#55dc3d",
"#7be468",
}
// Randomly choose one and return
return colors[rand.Intn(len(colors))]
}
func GetTemplateFunctions() template.FuncMap {
return template.FuncMap{
"inc": func(n int) int {
@ -143,10 +129,6 @@ func GetTemplateFunctions() template.FuncMap {
return template.HTML(parsedString)
},
"randomColor": func() string {
return GetRandomColor()
},
"isEmpty": func(s string) bool {
return len(s) < 1
},

View file

@ -394,6 +394,7 @@ body {
padding: 5px 10px;
text-decoration: none;
color: #d8d4cf;
font-weight: bold;
}
.switcher {

View file

@ -462,6 +462,7 @@ body {
padding: 5px 10px;
text-decoration: none;
color: $fg;
font-weight: bold;
}
.switcher {