init wompum header image
This commit is contained in:
12
layouts/partials/article-wompum.html
Normal file
12
layouts/partials/article-wompum.html
Normal 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>
|
9
layouts/partials/css-variables.html
Normal file
9
layouts/partials/css-variables.html
Normal file
@ -0,0 +1,9 @@
|
||||
<style>
|
||||
:root {
|
||||
{{ range $colorName, $shades := site.Data.colors }}
|
||||
{{ range $shade, $value := $shades }}
|
||||
--{{ $colorName }}-{{ $shade }}: {{ $value }};
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
}
|
||||
</style>
|
25
layouts/partials/sigil.html
Normal file
25
layouts/partials/sigil.html
Normal 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>
|
Reference in New Issue
Block a user