1
0

Header.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 isShowingMobile = ref(false)
  10. // onMounted(() => {
  11. // console.log('Mounted!')
  12. // // Now it's safe to perform setup operations.
  13. // })
  14. // onBeforeUnmount(() => {
  15. // console.log('Before Unmount!')
  16. // // Now is the time to perform all cleanup operations.
  17. // })
  18. </script>
  19. <template>
  20. <header class="bg-white">
  21. <nav class="mx-auto flex max-w-7xl items-center justify-between p-6 lg:px-8" aria-label="Global">
  22. <div class="flex flex-1">
  23. <div class="hidden lg:flex lg:gap-x-12">
  24. <NuxtLink to="/playground" class="text-lg font-semibold leading-6 text-gray-900">
  25. Playground
  26. </NuxtLink>
  27. <NuxtLink to="/showcase" class="text-lg font-semibold leading-6 text-gray-900">
  28. Showcase
  29. </NuxtLink>
  30. <NuxtLink to="/about" class="text-lg font-semibold leading-6 text-gray-900">
  31. About
  32. </NuxtLink>
  33. </div>
  34. <div class="flex lg:hidden">
  35. <button type="button" class="-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700">
  36. <span class="sr-only">Open main menu</span>
  37. <svg class="h-10 w-auto" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
  38. <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
  39. </svg>
  40. </button>
  41. </div>
  42. </div>
  43. <NuxtLink to="/" class="-m-1.5 p-1.5">
  44. <span class="sr-only">Your Company</span>
  45. <img class="h-8 w-auto" src="~/assets/icon.png" alt="" />
  46. </NuxtLink>
  47. <div class="hidden lg:flex flex-1 justify-end">
  48. <NuxtLink to="https://gogs.hos.im/nyusternie/librescript" target="_blank" class="text-lg font-semibold leading-6 text-gray-900">
  49. View Source <span aria-hidden="true">&rarr;</span>
  50. </NuxtLink>
  51. </div>
  52. </nav>
  53. <!-- Mobile menu, show/hide based on menu open state. -->
  54. <div v-if="isShowingMobile" class="lg:hidden" role="dialog" aria-modal="true">
  55. <!-- Background backdrop, show/hide based on slide-over state. -->
  56. <div class="fixed inset-0 z-10"></div>
  57. <div class="fixed inset-y-0 left-0 z-10 w-full overflow-y-auto bg-white px-6 py-6">
  58. <div class="flex items-center justify-between">
  59. <div class="flex flex-1">
  60. <button type="button" class="-m-2.5 rounded-md p-2.5 text-gray-700">
  61. <span class="sr-only">Close menu</span>
  62. <svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
  63. <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
  64. </svg>
  65. </button>
  66. </div>
  67. <NuxtLink to="/" class="-m-1.5 p-1.5">
  68. <span class="sr-only">Your Company</span>
  69. <img class="h-8 w-auto" src="~/assets/icon.png" alt="" />
  70. </NuxtLink>
  71. <div class="flex flex-1 justify-end">
  72. <a href="javascript://" class="text-sm font-semibold leading-6 text-gray-900">Log in <span aria-hidden="true">&rarr;</span></a>
  73. </div>
  74. </div>
  75. <div class="mt-6 space-y-2">
  76. <NuxtLink to="/playground" class="-mx-3 block rounded-lg px-3 py-2 text-base font-semibold leading-7 text-gray-900 hover:bg-gray-50">
  77. Playground
  78. </NuxtLink>
  79. <NuxtLink to="/showcase" class="-mx-3 block rounded-lg px-3 py-2 text-base font-semibold leading-7 text-gray-900 hover:bg-gray-50">
  80. Showcase
  81. </NuxtLink>
  82. <NuxtLink to="/about" class="-mx-3 block rounded-lg px-3 py-2 text-base font-semibold leading-7 text-gray-900 hover:bg-gray-50">
  83. About
  84. </NuxtLink>
  85. </div>
  86. </div>
  87. </div>
  88. </header>
  89. </template>