| Davit Tabidze | 71eecce | 2024-06-25 15:00:55 +0400 | [diff] [blame^] | 1 | {{ define "main" }} |
| 2 | <div class="facts-content"> |
| 3 | {{ $facts := where .Site.Pages "Section" "facts" }} |
| 4 | {{ $individualFacts := where $facts "Kind" "page" }} |
| 5 | {{ $sortedFacts := sort $individualFacts "File.BaseFileName" "asc" }} |
| 6 | <!-- 4x4 GRID --> |
| 7 | <div class="grid-container" data-facts='[ |
| 8 | {{ range $i, $fact := $sortedFacts }} |
| 9 | {{ if $i }},{{ end }}{ |
| 10 | "params": {{ jsonify $fact.Params }} |
| 11 | } |
| 12 | {{ end }} |
| 13 | ]'> |
| 14 | {{ range $i, $fact := $sortedFacts }} |
| 15 | {{ $className := printf "fact-%d" (add $i 1) }} |
| 16 | <div id="fact-{{ $i }}" class="facts {{ $className }} {{ if eq $i 0 }}active-fact{{ end }}" |
| 17 | onclick="handleImageChange('{{ $fact.Params.image }}', {{ $i }}, '{{ $fact.Title }}')" |
| 18 | onmouseover="handleMouseover('{{ $fact.Params.image }}', {{ $i }}, '{{ $fact.Title }}')"> |
| 19 | <h3 class="fact-title">{{ $fact.Title }}</h3> |
| 20 | {{ $fact.Content }} |
| 21 | </div> |
| 22 | {{ end }} |
| 23 | <!-- 1 Large Box 3x3 --> |
| 24 | {{ $firstFact := index $sortedFacts 0 }} |
| 25 | <div id="factImageBox" class="fact-image-box"> |
| 26 | <img id="factImage" src="/images/fact-1.png" alt="{{ $firstFact.Title }}" class="fact-image"> |
| 27 | </div> |
| 28 | </div> |
| 29 | </div> |
| 30 | <div class="footer-form"> |
| 31 | {{ partial "register-form.html" . }} |
| 32 | </div> |
| 33 | <script src="/js/main.js"></script> |
| 34 | {{ end }} |