Header.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. <script setup lang="ts">
  2. /* Define properties. */
  3. // https://vuejs.org/guide/components/props.html#props-declaration
  4. const props = defineProps({
  5. data: {
  6. type: [Object],
  7. },
  8. })
  9. const search = ref(null)
  10. const isMenuOpen = ref(false)
  11. const isMobileMenuOpen = ref(false)
  12. // onMounted(() => {
  13. // console.log('Mounted!')
  14. // // Now it's safe to perform setup operations.
  15. // })
  16. // onBeforeUnmount(() => {
  17. // console.log('Before Unmount!')
  18. // // Now is the time to perform all cleanup operations.
  19. // })
  20. </script>
  21. <template>
  22. <header class="bg-indigo-600 pb-24">
  23. <div class="mx-auto max-w-3xl px-4 sm:px-6 lg:max-w-7xl lg:px-8">
  24. <div class="relative flex items-center justify-center py-3 lg:justify-between">
  25. <!-- Logo -->
  26. <div class="absolute left-0 flex-shrink-0 lg:static">
  27. <NuxtLink to="/">
  28. <span class="sr-only">Hush Your Money</span>
  29. <img
  30. class="h-8 w-auto" src="~/assets/icon.png" alt="Hush Your Money" />
  31. </NuxtLink>
  32. </div>
  33. <!-- Right section on desktop -->
  34. <div class="hidden lg:ml-4 lg:flex lg:items-center lg:pr-0.5 gap-4">
  35. <NuxtLink to="/treasury" type="button" class="relative flex-shrink-0 rounded-full p-1 text-indigo-200 hover:bg-white hover:bg-opacity-10 hover:text-white focus:outline-none focus:ring-2 focus:ring-white">
  36. <span class="absolute -inset-1.5"></span>
  37. <span class="sr-only">Open Treasury</span>
  38. <svg class="h-8 w-auto" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
  39. <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 18.75a60.07 60.07 0 0 1 15.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 0 1 3 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 0 0-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 0 1-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 0 0 3 15h-.75M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm3 0h.008v.008H18V10.5Zm-12 0h.008v.008H6V10.5Z"></path>
  40. </svg>
  41. </NuxtLink>
  42. <NuxtLink to="/diary" type="button" class="relative flex-shrink-0 rounded-full p-1 text-indigo-200 hover:bg-white hover:bg-opacity-10 hover:text-white focus:outline-none focus:ring-2 focus:ring-white">
  43. <span class="absolute -inset-1.5"></span>
  44. <span class="sr-only">Open Wealth Diary</span>
  45. <svg class="h-8 w-auto" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
  46. <path stroke-linecap="round" stroke-linejoin="round" d="M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"></path>
  47. </svg>
  48. </NuxtLink>
  49. <!-- Profile dropdown -->
  50. <div class="relative flex-shrink-0">
  51. <div>
  52. <button
  53. @click="isMenuOpen = !isMenuOpen"
  54. type="button"
  55. class="relative flex-shrink-0 rounded-full p-1 text-indigo-200 hover:bg-white hover:bg-opacity-10 hover:text-white focus:outline-none focus:ring-2 focus:ring-white"
  56. id="user-menu-button"
  57. aria-expanded="false"
  58. aria-haspopup="true"
  59. >
  60. <span class="absolute -inset-1.5"></span>
  61. <span class="sr-only">Open user menu</span>
  62. <!-- <img class="h-8 w-8 rounded-full" src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="" /> -->
  63. <svg class="h-8 w-auto" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
  64. <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"></path>
  65. </svg>
  66. </button>
  67. </div>
  68. <!--
  69. Dropdown menu, show/hide based on menu state.
  70. Entering: ""
  71. From: ""
  72. To: ""
  73. Leaving: "transition ease-in duration-75"
  74. From: "transform opacity-100 scale-100"
  75. To: "transform opacity-0 scale-95"
  76. -->
  77. <div
  78. v-if="isMenuOpen"
  79. class="absolute -right-2 z-10 mt-2 w-48 origin-top-right rounded-md bg-white py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"
  80. role="menu"
  81. aria-orientation="vertical"
  82. aria-labelledby="user-menu-button"
  83. tabindex="-1"
  84. >
  85. <!-- Active: "bg-gray-100", Not Active: "" -->
  86. <NuxtLink to="/treasury" @click="isMenuOpen = false" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-1" id="user-menu-item-0">
  87. My Treasury
  88. </NuxtLink>
  89. <!-- Active: "bg-gray-100", Not Active: "" -->
  90. <NuxtLink to="/diary" @click="isMenuOpen = false" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-1" id="user-menu-item-0">
  91. My Diary
  92. </NuxtLink>
  93. <!-- Active: "bg-gray-100", Not Active: "" -->
  94. <NuxtLink to="/profile" @click="isMenuOpen = false" class="block px-4 py-2 text-sm text-gray-700" role="menuitem" tabindex="-1" id="user-menu-item-1">
  95. My Profile
  96. </NuxtLink>
  97. <!-- Active: "bg-gray-100", Not Active: "" -->
  98. <NuxtLink to="/" @click="isMenuOpen = false" class="block px-4 py-2 text-sm text-red-600" role="menuitem" tabindex="-1" id="user-menu-item-2">
  99. End Session
  100. <svg class="inline h-6 w-auto" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
  101. <path stroke-linecap="round" stroke-linejoin="round" d="M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15M12 9l3 3m0 0-3 3m3-3H2.25"></path>
  102. </svg>
  103. </NuxtLink>
  104. </div>
  105. </div>
  106. </div>
  107. <!-- Search help & settings -->
  108. <div class="min-w-0 flex-1 px-12 lg:hidden">
  109. <div class="mx-auto w-full max-w-xs">
  110. <label for="desktop-search" class="sr-only">Search help & settings</label>
  111. <div class="relative text-white focus-within:text-gray-600">
  112. <div class="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3">
  113. <svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
  114. <path fill-rule="evenodd" d="M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z" clip-rule="evenodd" />
  115. </svg>
  116. </div>
  117. <input
  118. v-model="search"
  119. class="block w-full rounded-md border-0 bg-white/20 py-1.5 pl-10 pr-3 text-white placeholder:text-white focus:bg-white focus:text-gray-900 focus:ring-0 focus:placeholder:text-gray-500 sm:text-sm sm:leading-6"
  120. placeholder="Search help & settings"
  121. type="search"
  122. />
  123. </div>
  124. </div>
  125. </div>
  126. <!-- Menu button -->
  127. <div class="absolute right-0 flex-shrink-0 lg:hidden">
  128. <!-- Mobile menu button -->
  129. <button
  130. @click="isMobileMenuOpen = true"
  131. type="button"
  132. class="relative inline-flex items-center justify-center rounded-md bg-transparent p-2 text-indigo-200 hover:bg-white hover:bg-opacity-10 hover:text-white focus:outline-none focus:ring-2 focus:ring-white"
  133. aria-expanded="false"
  134. >
  135. <span class="absolute -inset-0.5"></span>
  136. <span class="sr-only">Open main menu</span>
  137. <!-- Menu open: "hidden", Menu closed: "block" -->
  138. <svg class="block h-8 w-auto" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
  139. <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
  140. </svg>
  141. <!-- Menu open: "block", Menu closed: "hidden" -->
  142. <svg class="hidden h-8 w-auto" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
  143. <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
  144. </svg>
  145. </button>
  146. </div>
  147. </div>
  148. <div class="hidden border-t border-white border-opacity-20 py-5 lg:block">
  149. <div class="grid grid-cols-3 items-center gap-8">
  150. <div class="col-span-2">
  151. <nav class="flex space-x-4">
  152. <!-- Current: "text-white", Default: "text-indigo-100" -->
  153. <NuxtLink to="/lobby" class="rounded-md bg-white bg-opacity-0 px-3 py-2 text-xl font-medium text-white hover:bg-opacity-10 tracking-widest" aria-current="page">
  154. Lobby
  155. </NuxtLink>
  156. <NuxtLink to="/treasury" class="rounded-md bg-white bg-opacity-0 px-3 py-2 text-xl font-medium text-white hover:bg-opacity-10 tracking-widest" aria-current="page">
  157. Treasury
  158. </NuxtLink>
  159. <NuxtLink to="/diary" class="rounded-md bg-white bg-opacity-0 px-3 py-2 text-xl font-medium text-white hover:bg-opacity-10 tracking-widest" aria-current="page">
  160. Diary
  161. </NuxtLink>
  162. <NuxtLink to="/sponsors" class="rounded-md bg-white bg-opacity-0 px-3 py-2 text-xl font-medium text-rose-300 hover:bg-opacity-10 tracking-widest">
  163. Sponsors
  164. <svg class="inline h-6 w-auto" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
  165. <path stroke-linecap="round" stroke-linejoin="round" d="M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12Z"></path>
  166. </svg>
  167. </NuxtLink>
  168. <NuxtLink to="/help" class="rounded-md bg-white bg-opacity-0 px-3 py-2 text-xl font-medium text-white hover:bg-opacity-10 tracking-widest" aria-current="page">
  169. Need help?
  170. </NuxtLink>
  171. </nav>
  172. </div>
  173. <div>
  174. <div class="mx-auto w-full max-w-md">
  175. <label for="mobile-search" class="sr-only">Search help / settings / advanced features</label>
  176. <div class="relative text-white focus-within:text-gray-600">
  177. <div class="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3">
  178. <svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
  179. <path fill-rule="evenodd" d="M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z" clip-rule="evenodd" />
  180. </svg>
  181. </div>
  182. <input
  183. id="mobile-search"
  184. class="block w-full rounded-md border-0 bg-white/20 py-1.5 pl-10 pr-3 text-white placeholder:text-white focus:bg-white focus:text-gray-900 focus:ring-0 focus:placeholder:text-gray-500 sm:text-base sm:leading-6"
  185. placeholder="Search help / settings / advanced features"
  186. type="search"
  187. name="search"
  188. />
  189. </div>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. </div>
  195. <!-- Mobile menu, show/hide based on mobile menu state. -->
  196. <div v-if="isMobileMenuOpen" class="lg:hidden">
  197. <!--
  198. Mobile menu overlay, show/hide based on mobile menu state.
  199. Entering: "duration-150 ease-out"
  200. From: "opacity-0"
  201. To: "opacity-100"
  202. Leaving: "duration-150 ease-in"
  203. From: "opacity-100"
  204. To: "opacity-0"
  205. -->
  206. <div class="fixed inset-0 z-20 bg-black bg-opacity-25" aria-hidden="true"></div>
  207. <!--
  208. Mobile menu, show/hide based on mobile menu state.
  209. Entering: "duration-150 ease-out"
  210. From: "opacity-0 scale-95"
  211. To: "opacity-100 scale-100"
  212. Leaving: "duration-150 ease-in"
  213. From: "opacity-100 scale-100"
  214. To: "opacity-0 scale-95"
  215. -->
  216. <div class="absolute inset-x-0 top-0 z-30 mx-auto w-full max-w-3xl origin-top transform p-2 transition">
  217. <div class="divide-y divide-gray-200 rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5">
  218. <div class="pb-2 pt-3">
  219. <div class="flex items-center justify-between px-4">
  220. <div>
  221. <img
  222. class="h-10 w-auto"
  223. src="~/assets/icon.png"
  224. alt="Hush Your Money"
  225. />
  226. </div>
  227. <div class="-mr-2">
  228. <button
  229. @click="isMobileMenuOpen = false"
  230. type="button"
  231. class="relative inline-flex items-center justify-center rounded-md bg-white p-2 text-gray-400 hover:bg-gray-100 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500"
  232. >
  233. <span class="absolute -inset-0.5"></span>
  234. <span class="sr-only">Close menu</span>
  235. <svg class="h-10 w-auto" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
  236. <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
  237. </svg>
  238. </button>
  239. </div>
  240. </div>
  241. <div class="mt-3 space-y-1 px-2">
  242. <NuxtLink to="/lobby" @click="isMobileMenuOpen = false" class="block rounded-md px-3 py-2 text-xl font-medium text-gray-900 hover:bg-gray-100 hover:text-gray-800">
  243. Lobby
  244. <span class="text-xs text-sky-600 uppercase">
  245. Club Flux
  246. </span>
  247. </NuxtLink>
  248. <NuxtLink to="/clubs" @click="isMobileMenuOpen = false" class="block rounded-md px-3 py-2 text-xl font-medium text-gray-900 hover:bg-gray-100 hover:text-gray-800">
  249. Clubs Directory
  250. </NuxtLink>
  251. <NuxtLink to="/sponsors" @click="isMobileMenuOpen = false" class="block rounded-md px-3 py-2 text-xl font-medium text-rose-500 hover:bg-gray-100 hover:text-rose-500">
  252. Sponsors
  253. <svg class="inline h-6 w-auto" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
  254. <path stroke-linecap="round" stroke-linejoin="round" d="M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12Z"></path>
  255. </svg>
  256. </NuxtLink>
  257. <NuxtLink to="/help" @click="isMobileMenuOpen = false" class="block rounded-md px-3 py-2 text-xl font-medium text-gray-900 hover:bg-gray-100 hover:text-gray-800">
  258. Need help?
  259. </NuxtLink>
  260. </div>
  261. </div>
  262. <div class="pb-2 pt-4">
  263. <div class="flex items-center px-5">
  264. <div class="flex-shrink-0">
  265. <img class="h-10 w-10 rounded-full" src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="" />
  266. </div>
  267. <div class="ml-3 min-w-0 flex-1">
  268. <div class="truncate text-base font-medium text-gray-800">Tom Cook</div>
  269. <div class="truncate text-sm font-medium text-gray-500">[email protected]</div>
  270. </div>
  271. <button type="button" class="relative ml-auto flex-shrink-0 rounded-full bg-white p-1 text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
  272. <span class="absolute -inset-1.5"></span>
  273. <span class="sr-only">View notifications</span>
  274. <svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
  275. <path
  276. stroke-linecap="round"
  277. stroke-linejoin="round"
  278. d="M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"
  279. />
  280. </svg>
  281. </button>
  282. </div>
  283. <div class="mt-3 space-y-1 px-2">
  284. <NuxtLink to="/treasury" @click="isMobileMenuOpen = false" class="block rounded-md px-3 py-2 text-base font-medium text-gray-900 hover:bg-gray-100 hover:text-gray-800">
  285. My Treasury
  286. </NuxtLink>
  287. <NuxtLink to="/diary" @click="isMobileMenuOpen = false" class="block rounded-md px-3 py-2 text-base font-medium text-gray-900 hover:bg-gray-100 hover:text-gray-800">
  288. My Diary
  289. </NuxtLink>
  290. <NuxtLink to="/profile" @click="isMobileMenuOpen = false" class="block rounded-md px-3 py-2 text-base font-medium text-gray-900 hover:bg-gray-100 hover:text-gray-800">
  291. My Profile
  292. </NuxtLink>
  293. <NuxtLink to="/" @click="isMobileMenuOpen = false" class="block rounded-md px-3 py-2 text-base font-medium text-red-600 hover:bg-gray-100 hover:text-gray-800">
  294. End Session
  295. <svg class="inline h-6 w-auto" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
  296. <path stroke-linecap="round" stroke-linejoin="round" d="M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15M12 9l3 3m0 0-3 3m3-3H2.25"></path>
  297. </svg>
  298. </NuxtLink>
  299. </div>
  300. </div>
  301. </div>
  302. </div>
  303. </div>
  304. </header>
  305. </template>