init wompum header image

This commit is contained in:
Drew
2025-03-06 22:09:53 -07:00
parent 0be059b269
commit 1a7f4521f5
11 changed files with 358 additions and 15 deletions

View File

@ -0,0 +1,12 @@
<div class="wompum-container">
<div class="wompum-grid"
data-metadata="{{ jsonify .Params }}"
>
<!-- Grid will be populated by JavaScript -->
<!-- 7x5 = 35 cells total -->
</div>
</div>
<script src="/js/sigil.js"></script>
<script src="/js/colorCalculator.js"></script>
<script src="/js/wompum.js"></script>

View File

@ -0,0 +1,9 @@
<style>
:root {
{{ range $colorName, $shades := site.Data.colors }}
{{ range $shade, $value := $shades }}
--{{ $colorName }}-{{ $shade }}: {{ $value }};
{{ end }}
{{ end }}
}
</style>

View File

@ -0,0 +1,25 @@
{{/* Partial: create_sigil.html */}}
{{- $input := . -}} <!-- The input string will be passed into the partial -->
{{- $vowels := "aeiouAEIOU" -}} <!-- List of vowels to remove -->
{{- $seen := dict -}} <!-- Dictionary to track characters we've already encountered -->
{{- $output := "" -}} <!-- Variable to store the resulting sigil -->
{{- $chars := split (replaceRE "[^a-zA-Z]" "" $input) "" -}} <!-- Remove non-alphabetic characters and split the input string into a slice of characters -->
{{- /* Step 1: Remove vowels */ -}}
{{- range $i, $char := $chars -}}
{{- if not (in $vowels $char) -}}
{{- /* Step 2: Remove repeating letters */ -}}
{{- if not (index $seen $char) -}}
{{- $seen = merge $seen (dict $char true) -}}
{{- $output = printf "%s%s" $output $char -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- $output = upper $output -}}
{{ $output = split $output "" }}
{{ $output = apply $output "printf" "%#x" "." }}
{{ $output = apply $output "int" "." }}
{{- $output -}}<br>