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.

216 lines
10 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <!-- Main navigation container -->
  2. <nav
  3. class="flex-no-wrap relative flex w-full items-center justify-between bg-neutral-100 py-2 shadow-lg shadow-black/5 dark:bg-neutral-800 dark:shadow-black/10 lg:flex-wrap lg:justify-start lg:py-4"
  4. data-te-navbar-ref>
  5. <div class="flex w-full flex-wrap items-center justify-between px-3">
  6. <!-- Hamburger button for mobile view -->
  7. <button
  8. class="block border-0 bg-transparent px-2 text-neutral-500 hover:no-underline hover:shadow-none focus:no-underline focus:shadow-none focus:outline-none focus:ring-0 dark:text-neutral-200 lg:hidden"
  9. type="button"
  10. data-te-collapse-init
  11. data-te-target="#navbarSupportedContent1"
  12. aria-controls="navbarSupportedContent1"
  13. aria-expanded="false"
  14. aria-label="Toggle navigation">
  15. <!-- Hamburger icon -->
  16. <span class="[&>svg]:w-7">
  17. <svg
  18. xmlns="http://www.w3.org/2000/svg"
  19. viewBox="0 0 24 24"
  20. fill="currentColor"
  21. class="h-7 w-7">
  22. <path
  23. fill-rule="evenodd"
  24. d="M3 6.75A.75.75 0 013.75 6h16.5a.75.75 0 010 1.5H3.75A.75.75 0 013 6.75zM3 12a.75.75 0 01.75-.75h16.5a.75.75 0 010 1.5H3.75A.75.75 0 013 12zm0 5.25a.75.75 0 01.75-.75h16.5a.75.75 0 010 1.5H3.75a.75.75 0 01-.75-.75z"
  25. clip-rule="evenodd" />
  26. </svg>
  27. </span>
  28. </button>
  29. <!-- Collapsible navigation container -->
  30. <div
  31. class="!visible hidden flex-grow basis-[100%] items-center lg:!flex lg:basis-auto"
  32. id="navbarSupportedContent1"
  33. data-te-collapse-item>
  34. <!-- Logo -->
  35. <a
  36. class="pl-2 mb-4 mr-2 mt-3 flex items-center text-neutral-900 hover:text-neutral-900 focus:text-neutral-900 dark:text-neutral-200 dark:hover:text-neutral-400 dark:focus:text-neutral-400 lg:mb-0 lg:mt-0"
  37. href="/">
  38. <img
  39. src="https://www.tailwind-kit.com/icons/rocket.svg"
  40. style="height: 25px"
  41. alt=""
  42. loading="lazy" />
  43. </a>
  44. <!-- Left navigation links -->
  45. <ul
  46. class="list-style-none mr-auto flex flex-col pl-0 lg:flex-row"
  47. data-te-navbar-nav-ref>
  48. <li class="mb-4 lg:mb-0 lg:pr-2" data-te-nav-item-ref>
  49. <!-- Dashboard link -->
  50. <a
  51. class="text-neutral-500 hover:text-neutral-700 focus:text-neutral-700 disabled:text-black/30 dark:text-neutral-200 dark:hover:text-neutral-300 dark:focus:text-neutral-300 lg:px-2 [&.active]:text-black/90 dark:[&.active]:text-zinc-400"
  52. href="/"
  53. data-te-nav-link-ref
  54. >Home</a
  55. >
  56. </li>
  57. <li class="mb-4 lg:mb-0 lg:pr-2" data-te-nav-item-ref>
  58. <!-- Dashboard link -->
  59. <a
  60. class="text-neutral-500 hover:text-neutral-700 focus:text-neutral-700 disabled:text-black/30 dark:text-neutral-200 dark:hover:text-neutral-300 dark:focus:text-neutral-300 lg:px-2 [&.active]:text-black/90 dark:[&.active]:text-zinc-400"
  61. href="/main/about"
  62. data-te-nav-link-ref
  63. >About</a
  64. >
  65. </li>
  66. </ul>
  67. </div>
  68. <!-- Right elements -->
  69. <div class="relative flex items-center">
  70. <!-- Cart Icon -->
  71. <a
  72. class="mr-4 text-neutral-500 hover:text-neutral-700 focus:text-neutral-700 disabled:text-black/30 dark:text-neutral-200 dark:hover:text-neutral-300 dark:focus:text-neutral-300 [&.active]:text-black/90 dark:[&.active]:text-neutral-400"
  73. href="#">
  74. <span class="[&>svg]:w-5">
  75. <svg
  76. xmlns="http://www.w3.org/2000/svg"
  77. viewBox="0 0 24 24"
  78. fill="currentColor"
  79. class="h-5 w-5">
  80. <path
  81. d="M2.25 2.25a.75.75 0 000 1.5h1.386c.17 0 .318.114.362.278l2.558 9.592a3.752 3.752 0 00-2.806 3.63c0 .414.336.75.75.75h15.75a.75.75 0 000-1.5H5.378A2.25 2.25 0 017.5 15h11.218a.75.75 0 00.674-.421 60.358 60.358 0 002.96-7.228.75.75 0 00-.525-.965A60.864 60.864 0 005.68 4.509l-.232-.867A1.875 1.875 0 003.636 2.25H2.25zM3.75 20.25a1.5 1.5 0 113 0 1.5 1.5 0 01-3 0zM16.5 20.25a1.5 1.5 0 113 0 1.5 1.5 0 01-3 0z" />
  82. </svg>
  83. </span>
  84. </a>
  85. <!-- Container with two dropdown menus -->
  86. <div class="relative" data-te-dropdown-ref>
  87. <!-- First dropdown trigger -->
  88. <a
  89. class="hidden-arrow mr-4 flex items-center text-neutral-500 hover:text-neutral-700 focus:text-neutral-700 disabled:text-black/30 dark:text-neutral-200 dark:hover:text-neutral-300 dark:focus:text-neutral-300 [&.active]:text-black/90 dark:[&.active]:text-neutral-400"
  90. href="#"
  91. id="dropdownMenuButton1"
  92. role="button"
  93. data-te-dropdown-toggle-ref
  94. aria-expanded="false">
  95. <!-- Dropdown trigger icon -->
  96. <span class="[&>svg]:w-5">
  97. <svg
  98. xmlns="http://www.w3.org/2000/svg"
  99. viewBox="0 0 24 24"
  100. fill="currentColor"
  101. class="h-5 w-5">
  102. <path
  103. fill-rule="evenodd"
  104. d="M5.25 9a6.75 6.75 0 0113.5 0v.75c0 2.123.8 4.057 2.118 5.52a.75.75 0 01-.297 1.206c-1.544.57-3.16.99-4.831 1.243a3.75 3.75 0 11-7.48 0 24.585 24.585 0 01-4.831-1.244.75.75 0 01-.298-1.205A8.217 8.217 0 005.25 9.75V9zm4.502 8.9a2.25 2.25 0 104.496 0 25.057 25.057 0 01-4.496 0z"
  105. clip-rule="evenodd" />
  106. </svg>
  107. </span>
  108. <!-- Notification counter -->
  109. <span
  110. class="border-red-700 border-2 shadow-lg absolute -mt-2.5 ml-2 rounded-full bg-danger px-[0.45em] py-[0.2em] text-[0.6rem] leading-none bg-red-300 text-black"
  111. >
  112. 2
  113. </span
  114. >
  115. </a>
  116. <!-- First dropdown menu -->
  117. <ul
  118. class="absolute left-auto right-0 z-[1000] float-left m-0 mt-1 hidden min-w-max list-none overflow-hidden rounded-lg border-none bg-white bg-clip-padding text-left text-base shadow-lg dark:bg-neutral-700 [&[data-te-dropdown-show]]:block"
  119. aria-labelledby="dropdownMenuButton1"
  120. data-te-dropdown-menu-ref>
  121. <!-- First dropdown menu items -->
  122. <li>
  123. <a
  124. class="block w-full whitespace-nowrap bg-transparent px-4 py-2 text-sm font-normal text-neutral-700 hover:bg-neutral-100 active:text-neutral-800 active:no-underline disabled:pointer-events-none disabled:bg-transparent disabled:text-neutral-400 dark:text-neutral-200 dark:hover:bg-white/30"
  125. href="#"
  126. data-te-dropdown-item-ref
  127. >Action</a
  128. >
  129. </li>
  130. <li>
  131. <a
  132. class="block w-full whitespace-nowrap bg-transparent px-4 py-2 text-sm font-normal text-neutral-700 hover:bg-neutral-100 active:text-neutral-800 active:no-underline disabled:pointer-events-none disabled:bg-transparent disabled:text-neutral-400 dark:text-neutral-200 dark:hover:bg-white/30"
  133. href="#"
  134. data-te-dropdown-item-ref
  135. >Another action</a
  136. >
  137. </li>
  138. <li>
  139. <a
  140. class="block w-full whitespace-nowrap bg-transparent px-4 py-2 text-sm font-normal text-neutral-700 hover:bg-neutral-100 active:text-neutral-800 active:no-underline disabled:pointer-events-none disabled:bg-transparent disabled:text-neutral-400 dark:text-neutral-200 dark:hover:bg-white/30"
  141. href="#"
  142. data-te-dropdown-item-ref
  143. >Something else here</a
  144. >
  145. </li>
  146. </ul>
  147. </div>
  148. <!-- Second dropdown container -->
  149. <div class="relative" data-te-dropdown-ref>
  150. <!-- Second dropdown trigger -->
  151. <a
  152. class="hidden-arrow flex items-center whitespace-nowrap transition duration-150 ease-in-out motion-reduce:transition-none"
  153. href="#"
  154. id="dropdownMenuButton2"
  155. role="button"
  156. data-te-dropdown-toggle-ref
  157. aria-expanded="false">
  158. <!-- User avatar -->
  159. <img
  160. src="https://tecdn.b-cdn.net/img/new/avatars/2.jpg"
  161. class="rounded-full shadow-lg"
  162. style="height: 25px; width: 25px"
  163. alt=""
  164. loading="lazy" />
  165. </a>
  166. <!-- Second dropdown menu -->
  167. <ul
  168. class="absolute left-auto right-0 z-[1000] float-left m-0 mt-1 hidden min-w-max list-none overflow-hidden rounded-lg border-none bg-white bg-clip-padding text-left text-base shadow-lg dark:bg-neutral-700 [&[data-te-dropdown-show]]:block"
  169. aria-labelledby="dropdownMenuButton2"
  170. data-te-dropdown-menu-ref>
  171. <!-- Second dropdown menu items -->
  172. <li>
  173. <a
  174. class="block w-full whitespace-nowrap bg-transparent px-4 py-2 text-sm font-normal text-neutral-700 hover:bg-neutral-100 active:text-neutral-800 active:no-underline disabled:pointer-events-none disabled:bg-transparent disabled:text-neutral-400 dark:text-neutral-200 dark:hover:bg-white/30"
  175. href="#"
  176. data-te-dropdown-item-ref
  177. >Action</a
  178. >
  179. </li>
  180. <li>
  181. <a
  182. class="block w-full whitespace-nowrap bg-transparent px-4 py-2 text-sm font-normal text-neutral-700 hover:bg-neutral-100 active:text-neutral-800 active:no-underline disabled:pointer-events-none disabled:bg-transparent disabled:text-neutral-400 dark:text-neutral-200 dark:hover:bg-white/30"
  183. href="#"
  184. data-te-dropdown-item-ref
  185. >Another action</a
  186. >
  187. </li>
  188. <li>
  189. <a
  190. class="block w-full whitespace-nowrap bg-transparent px-4 py-2 text-sm font-normal text-neutral-700 hover:bg-neutral-100 active:text-neutral-800 active:no-underline disabled:pointer-events-none disabled:bg-transparent disabled:text-neutral-400 dark:text-neutral-200 dark:hover:bg-white/30"
  191. href="#"
  192. data-te-dropdown-item-ref
  193. >Something else here</a
  194. >
  195. </li>
  196. </ul>
  197. </div>
  198. </div>
  199. </div>
  200. </nav>
  201. <div class="m-5">
  202. <% if current_user %>
  203. User <%= current_user['email'] %> logged in
  204. <%= button_to "Log out", destroy_user_session_path, method: :delete, class: 'btn-primary' %>
  205. <% else %>
  206. Not yet logged in!
  207. <%= button_to 'sign up', new_user_registration_path, class: 'btn-primary' %>
  208. <%= button_to 'sign in', new_user_session_path, class: 'btn-primary' %>
  209. <%end%>
  210. </div>