|
54 | 54 | {{- site.data.locales[include.lang].layout[page.layout] | default: page.layout | capitalize -}} |
55 | 55 | {% endif %} |
56 | 56 | </div> |
| 57 | + {% comment %} Container for buttons {% endcomment %} |
| 58 | + <div class="d-flex"> |
| 59 | + {% unless site.theme_mode %} |
| 60 | + <button |
| 61 | + type="button" |
| 62 | + class="btn btn-link nav-link" |
| 63 | + aria-label="Switch Mode" |
| 64 | + id="mode-toggle" |
| 65 | + onClick="iconSwap()" |
| 66 | + > |
| 67 | + {% comment %} <i class="fas fa-adjust"></i> {% endcomment %} |
| 68 | + <i class="bi bi-brightness-high-fill"></i> |
| 69 | + </button> |
| 70 | + {% endunless %} |
| 71 | + <button type="button" id="search-trigger" class="btn btn-link" aria-label="Search"> |
| 72 | + <i class="fas fa-search fa-fw"></i> |
| 73 | + </button> |
57 | 74 |
|
58 | | - <button type="button" id="search-trigger" class="btn btn-link" aria-label="Search"> |
59 | | - <i class="fas fa-search fa-fw"></i> |
60 | | - </button> |
61 | | - |
62 | | - <search id="search" class="align-items-center ms-3 ms-lg-0"> |
63 | | - <i class="fas fa-search fa-fw"></i> |
64 | | - <input |
65 | | - class="form-control" |
66 | | - id="search-input" |
67 | | - type="search" |
68 | | - aria-label="search" |
69 | | - autocomplete="off" |
70 | | - placeholder="{{ site.data.locales[include.lang].search.hint | capitalize }}..." |
71 | | - > |
72 | | - </search> |
73 | | - <button type="button" class="btn btn-link text-decoration-none" id="search-cancel"> |
74 | | - {{- site.data.locales[include.lang].search.cancel -}} |
75 | | - </button> |
| 75 | + <search id="search" class="align-items-center"> |
| 76 | + <i class="fas fa-search fa-fw"></i> |
| 77 | + <input |
| 78 | + class="form-control" |
| 79 | + id="search-input" |
| 80 | + type="search" |
| 81 | + aria-label="search" |
| 82 | + autocomplete="off" |
| 83 | + placeholder="{{ site.data.locales[include.lang].search.hint | capitalize }}..." |
| 84 | + > |
| 85 | + </search> |
| 86 | + <button type="button" class="btn btn-link text-decoration-none" id="search-cancel"> |
| 87 | + {{- site.data.locales[include.lang].search.cancel -}} |
| 88 | + </button> |
| 89 | + {% comment %} Theme button {% endcomment %} |
| 90 | + </div> |
76 | 91 | </div> |
77 | 92 | </header> |
| 93 | + |
| 94 | +<script> |
| 95 | + $toggle = document.getElementById('mode-toggle'); |
| 96 | + if (Theme.visualState == 'dark') { |
| 97 | + $toggle.innerHTML = '<i class="bi bi-brightness-high-fill"></i>'; |
| 98 | + } else if (Theme.visualState == 'light') { |
| 99 | + $toggle.innerHTML = '<i class="bi bi-moon-stars"></i>'; |
| 100 | + } |
| 101 | + function iconSwap() { |
| 102 | + if (Theme.visualState == 'dark') { |
| 103 | + $toggle.innerHTML = '<i class="bi bi-moon-stars"></i>'; |
| 104 | + } else if (Theme.visualState == 'light') { |
| 105 | + $toggle.innerHTML = '<i class="bi bi-brightness-high-fill"></i>'; |
| 106 | + } |
| 107 | + } |
| 108 | +</script> |
0 commit comments