NEXT craftinamerica.org. Base setup for headless wordpress https://www.craftinamerica.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. // Replace with calls to menu system
  2. <template lang="pug">
  3. nav.main.w-max
  4. .menu
  5. ul.f-row.w-max
  6. li.f-row.start
  7. router-link(to="/")
  8. img(src="../../star.svg")
  9. router-link(to="/")
  10. h1.t-serif.t-up craft in america
  11. li.f-grow
  12. li(v-for="item in menuItems")
  13. router-link(v-if="['events','exhibitions'].includes(item)" :to="`/${item}/by-current-and-upcoming`")
  14. h5.t-up {{ item }}
  15. router-link(v-else :to="`/${item}`")
  16. h5.t-up {{ item }}
  17. .mobile-menu
  18. .f-row.start
  19. router-link(to="/")
  20. img(src="../../star.svg")
  21. router-link(to="/")
  22. h1.t-serif.t-up craft in america
  23. label(for="toggle-mobile-menu" aria-label="Menu").drop-down &#9776;
  24. input(id="toggle-mobile-menu" type="checkbox").hide
  25. ul.drop-down.w-max
  26. li(v-for="item in menuItems")
  27. router-link(@click="uncheck" :to="`/${item}`")
  28. h5.t-up {{ item }}
  29. </template>
  30. <script>
  31. import { postTypes } from '@/utils/helpers'
  32. import { computed } from '@vue/runtime-core'
  33. export default {
  34. setup() {
  35. /**
  36. * Navigation items
  37. * Auto-includes declared postTypes
  38. * and extra items
  39. * TIP: Add things to the ignored array
  40. * to remove from the nav
  41. */
  42. const menuItems = computed(() => {
  43. const extras = [
  44. // 'center',
  45. // 'education',
  46. // 'resources',
  47. // 'support',
  48. // 'about',
  49. // '🔍'
  50. ]
  51. const ignored = [
  52. 'pages',
  53. 'sticky',
  54. // 'posts',
  55. ]
  56. const filtered = postTypes.filter(val => !ignored.includes(val))
  57. return [...filtered, ...extras]
  58. })
  59. const uncheck = () => {
  60. document.getElementById('toggle-mobile-menu').checked = false
  61. }
  62. return {
  63. menuItems,
  64. uncheck
  65. }
  66. },
  67. }
  68. </script>
  69. <style lang="postcss">
  70. // prettier-ignore
  71. @import '../../sss/variables.sss'
  72. @import '../../sss/theme.sss'
  73. nav.main
  74. position: sticky
  75. top: 0
  76. /* background-color: lightblue */
  77. background-color: $cia_grey
  78. word-wrap: break-word
  79. z-index: 10002
  80. .menu, .mobile-menu
  81. /* padding: $ms-0 0 */
  82. a
  83. /* text-decoration: none leave on for testing*/
  84. color: $cia_black
  85. &:hover
  86. color: $cia_darker
  87. h1
  88. font-size: $ms-2
  89. font-weight: 400
  90. color: $cia_red
  91. text-decoration: none
  92. img
  93. width: $ms-3
  94. height: $ms-3
  95. padding: 0
  96. .menu
  97. display: none
  98. h1
  99. margin: 0
  100. h5
  101. font-size: $ms--1
  102. font-weight: 400
  103. margin: 0
  104. > ul
  105. padding: 0 $ms-1
  106. .mobile-menu
  107. /* cia logotype adjust for smaller screens */
  108. img
  109. margin: $ms--7 $ms--6 0 $ms-0
  110. h1
  111. /* font-size: $ms-2 */
  112. margin: $ms--3 0 $ms--5
  113. /* hamburger menu drawer */
  114. label
  115. position: absolute
  116. right: 0
  117. top: 0
  118. padding: $ms-0
  119. &:hover
  120. color: $primary-dark
  121. cursor: pointer
  122. /* make this menu style for $small min-width 480px screen */
  123. input
  124. &.hide
  125. display: none
  126. cursor: pointer
  127. &:checked + ul
  128. display: block
  129. position: absolute
  130. width: 100%
  131. ul
  132. /* background-color: $primary-dark */
  133. background-color: $cia_grey
  134. display: none
  135. padding: $ms--1 $ms-4 0 $ms--3
  136. margin: 1px 0 0 0
  137. box-shadow: lightgrey $ms--7 $ms--7 $ms--7
  138. li
  139. /* color: $primary-light */
  140. &:hover
  141. color: $primary-dark
  142. background-color: $primary-light
  143. transition: $transition
  144. h5
  145. /* font-size: $ms-0 */
  146. /* color: $cia_black */
  147. padding: $ms--1
  148. /* padding: 0 */
  149. margin: 0
  150. @media (min-width: $large)
  151. .menu
  152. display: flex
  153. justify-content: center
  154. .mobile-menu
  155. display: none
  156. @media (min-width: $extra-large)
  157. .menu > ul
  158. max-width: $max-width
  159. </style>