Feature: some styling for related tags
This commit is contained in:
parent
221bd4d4b2
commit
fcb6961f8e
|
@ -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
|
||||
},
|
||||
|
|
|
@ -394,6 +394,7 @@ body {
|
|||
padding: 5px 10px;
|
||||
text-decoration: none;
|
||||
color: #d8d4cf;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.switcher {
|
||||
|
|
|
@ -462,6 +462,7 @@ body {
|
|||
padding: 5px 10px;
|
||||
text-decoration: none;
|
||||
color: $fg;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.switcher {
|
||||
|
|
Loading…
Reference in a new issue