|
49 | 49 | :class="{'flex': open, 'hidden': !open}" |
50 | 50 | class="hidden flex-grow flex-col pb-4 md:flex md:flex-row md:justify-end md:pb-0" |
51 | 51 | > |
| 52 | + {{ range site.Menus.main }} |
| 53 | + {{ if (eq "complexdropdown" .Pre) }} |
| 54 | + <div @click.away="open = false" class="relative" x-data="{ open: false }"> |
| 55 | + <button @click="open = !open" |
| 56 | + class="flex flex-row items-center w-full px-4 py-2 mt-2 text-sm font-semibold text-left bg-transparent rounded-lg dark-mode:focus:text-white dark-mode:hover:text-white dark-mode:focus:bg-gray-600 dark-mode:hover:bg-gray-600 md:w-auto md:inline md:mt-0 md:ml-4 hover:text-white focus:text-white hover:bg-primary-600 focus:bg-primary-600 focus:outline-none focus:shadow-outline"> |
| 57 | + <span>{{ .Name }}</span> |
| 58 | + <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" |
| 59 | + class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"> |
| 60 | + <path fill-rule="evenodd" |
| 61 | + d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" |
| 62 | + clip-rule="evenodd"></path> |
| 63 | + </svg> |
| 64 | + </button> |
| 65 | + <div x-show="open" x-transition:enter="transition ease-out duration-100" |
| 66 | + x-transition:enter-start="transform opacity-0 scale-95" |
| 67 | + x-transition:enter-end="transform opacity-100 scale-100" |
| 68 | + x-transition:leave="transition ease-in duration-75" |
| 69 | + x-transition:leave-start="transform opacity-100 scale-100" |
| 70 | + x-transition:leave-end="transform opacity-0 scale-95" |
| 71 | + class="absolute right-0 z-30 w-full mt-2 origin-top-right md:max-w-sm md:w-screen"> |
| 72 | + <div class="px-2 pt-2 pb-4 bg-white rounded-md shadow-lg text-zinc-900"> |
| 73 | + <div class="grid grid-cols-1 gap-4"> |
| 74 | + {{ range (index site.Menus .Identifier) }} |
| 75 | + <a class="flex items-start p-2 bg-transparent rounded-lg group row hover:text-white focus:text-white hover:bg-primary-600 focus:bg-primary-700 focus:outline-none focus:shadow-outline" |
| 76 | + href="{{ .URL | absLangURL }}"> |
| 77 | + <div class="p-3 text-white bg-primary-600 rounded-lg group-hover:bg-gray-900"> |
| 78 | + {{ if (eq .Pre "stars") }} |
| 79 | + <svg fill="none" stroke="currentColor" stroke-linecap="round" |
| 80 | + stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" |
| 81 | + class="w-4 h-4 md:h-6 md:w-6"> |
| 82 | + <path |
| 83 | + d="M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"> |
| 84 | + </path> |
| 85 | + </svg> |
| 86 | + {{ else if (eq .Pre "comments") }} |
| 87 | + <svg fill="none" stroke="currentColor" stroke-linecap="round" |
| 88 | + stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" |
| 89 | + class="w-4 h-4 md:h-6 md:w-6"> |
| 90 | + <path |
| 91 | + d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"> |
| 92 | + </path> |
| 93 | + </svg> |
| 94 | + {{ else }} |
| 95 | + <svg fill="none" stroke="currentColor" stroke-linecap="round" |
| 96 | + stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" |
| 97 | + class="w-4 h-4 md:h-6 md:w-6"> |
| 98 | + <path d="M11 3.055A9.001 9.001 0 1020.945 13H11V3.055z"> |
| 99 | + </path> |
| 100 | + <path d="M20.488 9H15V3.512A9.025 9.025 0 0120.488 9z"> |
| 101 | + </path> |
| 102 | + </svg> |
| 103 | + {{ end }} |
| 104 | + |
| 105 | + </div> |
| 106 | + <div class="ml-3"> |
| 107 | + <p class="font-semibold">{{ .Name }}</p> |
| 108 | + <p class="text-sm">{{ .Post }}</p> |
| 109 | + </div> |
| 110 | + </a> |
| 111 | + {{ end }} |
| 112 | + </div> |
| 113 | + </div> |
| 114 | + </div> |
| 115 | + </div> |
| 116 | + {{ else if (eq "dropdown" .Pre) }} |
| 117 | + <div @click.away="open = false" class="relative" x-data="{ open: false }"> |
| 118 | + <button @click="open = !open" |
| 119 | + class="flex flex-row items-center w-full px-4 py-2 mt-2 text-sm font-semibold text-left bg-transparent rounded-lg md:w-auto md:inline md:mt-0 md:ml-4 hover:text-white focus:text-white hover:bg-primary-600 focus:bg-primary-600 focus:outline-none focus:shadow-outline"> |
| 120 | + <span>{{ .Name }}</span> |
| 121 | + <svg fill="currentColor" viewBox="0 0 20 20" :class="{'rotate-180': open, 'rotate-0': !open}" |
| 122 | + class="inline w-4 h-4 mt-1 ml-1 transition-transform duration-200 transform md:-mt-1"> |
| 123 | + <path fill-rule="evenodd" |
| 124 | + d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" |
| 125 | + clip-rule="evenodd"></path> |
| 126 | + </svg> |
| 127 | + </button> |
| 128 | + <div x-show="open" x-transition:enter="transition ease-out duration-100" |
| 129 | + x-transition:enter-start="transform opacity-0 scale-95" |
| 130 | + x-transition:enter-end="transform opacity-100 scale-100" |
| 131 | + x-transition:leave="transition ease-in duration-75" |
| 132 | + x-transition:leave-start="transform opacity-100 scale-100" |
| 133 | + x-transition:leave-end="transform opacity-0 scale-95" |
| 134 | + class="absolute right-0 z-30 w-full mt-2 origin-top-right rounded-md shadow-lg md:w-48"> |
| 135 | + <div class="px-2 py-2 text-primary-900 bg-white rounded-md shadow"> |
| 136 | + {{ range (index site.Menus .Identifier) }} |
| 137 | + <a class="block px-4 py-2 mt-2 text-sm font-semibold bg-transparent rounded-lg md:mt-0 hover:text-white focus:text-white hover:bg-primary-600 focus:bg-primary-600 focus:outline-none focus:shadow-outline" |
| 138 | + href="{{ .URL | absLangURL }}">{{- .Name -}}</a> |
| 139 | + {{ end }} |
| 140 | + </div> |
| 141 | + </div> |
| 142 | + </div> |
| 143 | + {{ else }} |
| 144 | + <a class="px-4 py-2 mt-2 text-sm font-semibold rounded-lg md:mt-0 md:ml-4 hover:text-white focus:text-white hover:bg-primary-600 focus:bg-primary-700 focus:outline-none focus:shadow-outline" |
| 145 | + href="{{ .URL | absLangURL }}" title="{{ .Title | default .Name }}"> |
| 146 | + {{ .Name }} |
| 147 | + </a> |
| 148 | + {{ end }} |
| 149 | + {{ end }} |
52 | 150 | <button |
53 | 151 | id="theme-toggle" |
54 | 152 | type="button" |
|
0 commit comments