1
0
mirror of https://github.com/avinal/box-box.git synced 2026-01-11 22:18:33 +05:30

feat: put some colors in the world

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
This commit is contained in:
2025-01-01 17:13:08 +05:30
parent e5f7f9e53e
commit 54b5b091fe
6 changed files with 70 additions and 26 deletions

View File

@@ -1,5 +1,6 @@
{{- $color := (index (shuffle (slice "cyan" "teal" "pink" "rose" "fuchsia" "purple" "violet" "indigo" "emerald" "yellow" "amber" "red")) 0) }}
<div
class="relative overflow-auto px-4 ring-1 ring-gray-800 mt-5 text-center text-light text-gray-500"
class="relative overflow-auto px-4 ring-1 ring-gray-800 mt-5 text-center text-light text-gray-500 hover:text-black hover:bg-{{ $color }}-400"
>
<span
><a href="https://github.com/avinal/box-box">Box Box</a> | A

View File

@@ -1,4 +1,9 @@
{{- $color := (index (shuffle (slice "cyan" "teal" "pink" "rose" "fuchsia" "purple" "violet" "indigo" "emerald" "yellow" "amber" "red")) 0) }}
<div class="py-4">
<h1 class="text-xl font-bold font-mono bg-gradient-to-r to-black from-white">{{ site.Title }}</h1>
<h1
class="text-xl font-bold font-mono bg-gradient-to-r to-black hover:to-{{ $color }}-400 from-white"
>
{{ site.Title }}
</h1>
</div>
{{ partial "menu.html" (dict "menuID" "main" "page" .) }}

View File

@@ -22,13 +22,14 @@
{{- $page := .page }}
{{- range .menuEntries }}
{{- $attrs := dict "href" .URL }}
{{- $color := (index (shuffle (slice "cyan" "teal" "pink" "rose" "fuchsia" "purple" "violet" "indigo" "emerald" "yellow" "amber" "red")) 0) }}
{{- $classes := "min-width flex items-center justify-center border border-black text-center shadow-md shadow-gray-600" }}
{{- if $page.IsMenuCurrent .Menu . }}
{{- $classes = (printf "%s %s" $classes "bg-black text-white active") }}
{{- $attrs = merge $attrs (dict "aria-current" "page") }}
{{- else }}
{{- $classes = (printf "%s %s" $classes "bg-white text-black ancestor hover:text-white hover:bg-black") }}
{{- $classes = (printf "%s %s hover:bg-%s-400" $classes "bg-white text-black ancestor" $color) }}
{{- $attrs = merge $attrs (dict "aria-current" "true") }}
{{- end }}