aboutsummaryrefslogtreecommitdiff
path: root/data.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-11-10 00:43:24 +0100
committerAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-11-10 00:43:24 +0100
commit6a177e466334086b26689429e3da5a8bfba449de (patch)
treeb4d4d400f3c33ad233056e6808017905097eae4e /data.go
parent8129d4f13d4c25874e48394fce8b3dccb123a92b (diff)
feat(link): change color on hover
Diffstat (limited to 'data.go')
-rw-r--r--data.go18
1 files changed, 10 insertions, 8 deletions
diff --git a/data.go b/data.go
index 6bf89af..d085b99 100644
--- a/data.go
+++ b/data.go
@@ -36,10 +36,12 @@ type BackgroundColor struct {
}
type Link struct {
- Link string `json:"link"`
- Content string `json:"content"`
- Color string `json:"color"`
- TextColor string `json:"text_color"`
+ Link string `json:"link"`
+ Content string `json:"content"`
+ Color string `json:"color"`
+ TextColor string `json:"text_color"`
+ ColorHover string `json:"color_hover"`
+ TextColorHover string `json:"text_color_hover"`
}
type Legal struct {
@@ -60,17 +62,17 @@ func (d *Data) GetBackground() template.CSS {
}
func (d *Data) GetBackgroundImage() template.CSS {
- return template.CSS("background-image: url(" + golatt.GetStaticPath(d.Image) + ");")
+ return template.CSS("--background-image: url(" + golatt.GetStaticPath(d.Image) + ");")
}
func (d *Data) GetTextColor() template.CSS {
- return template.CSS("color: " + d.Color.Text + ";")
+ return template.CSS("--text-color: " + d.Color.Text + ";")
}
func (l *Link) GetLinkColor() template.CSS {
- return template.CSS("color: " + l.TextColor + ";")
+ return template.CSS("--text-color: " + l.TextColor + ";--text-color-hover: " + l.TextColorHover + ";")
}
func (l *Link) GetBackground() template.CSS {
- return template.CSS("background: " + l.Color + ";")
+ return template.CSS("--background: " + l.Color + ";--background-hover: " + l.ColorHover + ";")
}