diff options
| author | Anhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me> | 2024-11-14 14:58:05 +0100 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me> | 2024-11-14 14:58:05 +0100 |
| commit | fce56f5088e27c0865d3a2d03936039e1a21059a (patch) | |
| tree | f96f915d21a15a5f6accec7bc0459a06c0aa2025 | |
| parent | 83a7fc5cf8eda929eef75305ec8435ecd228d2f4 (diff) | |
feat(style): harmonize button color
| -rw-r--r-- | data.go | 16 | ||||
| -rw-r--r-- | schema.json | 18 | ||||
| -rw-r--r-- | templates/page/index.gohtml | 10 |
3 files changed, 8 insertions, 36 deletions
@@ -50,12 +50,8 @@ type ButtonColor struct { } type Link struct { - 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"` + Link string `json:"link"` + Content string `json:"content"` } type Legal struct { @@ -91,11 +87,3 @@ func (b *ButtonColor) GetTextColor() template.CSS { func (b *ButtonColor) GetBackground() template.CSS { return template.CSS("--background: " + b.Background + ";--background-hover: " + b.BackgroundHover + ";") } - -func (l *Link) GetLinkColor() template.CSS { - return template.CSS("--text-color: " + l.TextColor + ";--text-color-hover: " + l.TextColorHover + ";") -} - -func (l *Link) GetBackground() template.CSS { - return template.CSS("--background: " + l.Color + ";--background-hover: " + l.ColorHover + ";") -} diff --git a/schema.json b/schema.json index 1ef362b..d84d5b2 100644 --- a/schema.json +++ b/schema.json @@ -115,33 +115,17 @@ "items": { "type": "object", "properties": { - "color": { - "type": "string" - }, - "color_hover": { - "type": "string" - }, "content": { "type": "string" }, "link": { "type": "string" - }, - "text_color": { - "type": "string" - }, - "text_color_hover": { - "type": "string" } }, "additionalProperties": false, "required": [ "link", - "content", - "color", - "text_color", - "color_hover", - "text_color_hover" + "content" ] } }, diff --git a/templates/page/index.gohtml b/templates/page/index.gohtml index dee6782..a3ca7df 100644 --- a/templates/page/index.gohtml +++ b/templates/page/index.gohtml @@ -12,14 +12,14 @@ <p class="description"> {{ .Description }} </p> - <div class="links"> + <div class="links" style="{{ .Color.Button.GetBackground }}{{ .Color.Button.GetTextColor }}"> {{ range $link := .Links }} - <div class="link" style="{{ .GetBackground }}"> - <a href="{{ .Link }}" style="{{ .GetLinkColor }}">{{ .Content }}</a> + <div class="link"> + <a href="{{ .Link }}">{{ .Content }}</a> </div> {{ end }} - <div class="link" style="{{ .Color.Button.GetBackground }}"> - <a href="/tags" style="{{ .Color.Button.GetTextColor }}">Tags</a> + <div class="link"> + <a href="/tags">Tags</a> </div> </div> </main> |
