navigation.blade.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <nav x-data="{ open: false }" class="bg-burnt shadow">
  2. <!-- Primary Navigation Menu -->
  3. <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
  4. <div class="flex justify-between h-16">
  5. <div class="flex">
  6. <!-- Logo -->
  7. <div class="shrink-0 flex items-center">
  8. <a href="{{ route('home') }}">
  9. <x-application-logo class="block h-14 w-auto fill-current text-fogra hover:text-yelmax font-bold" />
  10. </a>
  11. </div>
  12. <!-- Navigation Links -->
  13. <div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
  14. <x-nav-link class="text-fogra" :href="route('vorschlag')" :active="request()->routeIs('vorschlag')">
  15. {{ __('Vorschläge') }}
  16. </x-nav-link>
  17. <x-nav-link class="text-fogra" :href="route('gesehen')" :active="request()->routeIs('gesehen')">
  18. {{ __('Archiv') }}
  19. </x-nav-link>
  20. <x-nav-link class="text-fogra" :href="route('neu')" :active="request()->routeIs('neu')">
  21. {{ __('Film vorschlagen') }}
  22. </x-nav-link>
  23. </div>
  24. </div>
  25. <!-- Settings Dropdown -->
  26. <div class="hidden sm:flex sm:items-center sm:ml-6">
  27. @if (Auth::check())
  28. <x-dropdown align="right" width="48">
  29. <x-slot name="trigger">
  30. <button class="flex items-center text-sm font-medium text-fogra hover:text-yelmax hover:border-yelmax focus:outline-none focus:text-yelmax focus:border-yelmax transition duration-150 ease-in-out">
  31. <div>{{ Auth::user()->name }}</div>
  32. <div class="ml-1">
  33. <svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
  34. <path fill-rule="evenodd" 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" clip-rule="evenodd" />
  35. </svg>
  36. </div>
  37. </button>
  38. </x-slot>
  39. <x-slot name="content">
  40. <!-- Authentication -->
  41. <form method="POST" action="{{ route('logout') }}">
  42. @csrf
  43. <x-dropdown-link :href="route('logout')"
  44. onclick="event.preventDefault();
  45. this.closest('form').submit();">
  46. {{ __('Log Out') }}
  47. </x-dropdown-link>
  48. </form>
  49. </x-slot>
  50. </x-dropdown>
  51. @else
  52. <div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
  53. <x-nav-link :href="route('login')" :active="request()->routeIs('login')">
  54. {{ __('login') }}
  55. </x-nav-link>
  56. </div>
  57. @endif
  58. </div>
  59. <!-- Hamburger -->
  60. <div class="-mr-2 flex items-center sm:hidden">
  61. <button @click="open = ! open" class="inline-flex items-center justify-center p-2 rounded-md text-fogra hover:text-yelmax focus:outline-none transition duration-150 ease-in-out">
  62. <svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
  63. <path :class="{'hidden': open, 'inline-flex': ! open }" class="inline-flex" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
  64. <path :class="{'hidden': ! open, 'inline-flex': open }" class="hidden" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
  65. </svg>
  66. </button>
  67. </div>
  68. </div>
  69. </div>
  70. <!-- Responsive Navigation Menu -->
  71. <div :class="{'block': open, 'hidden': ! open}" class="hidden sm:hidden">
  72. <div class="pt-2 pb-3 space-y-1">
  73. <x-responsive-nav-link :href="route('vorschlag')" :active="request()->routeIs('vorschlag')">
  74. {{ __('Vorschläge') }}
  75. </x-responsive-nav-link>
  76. <x-responsive-nav-link :href="route('neu')" :active="request()->routeIs('neu')">
  77. {{ __('Film vorschlagen') }}
  78. </x-responsive-nav-link>
  79. <x-responsive-nav-link :href="route('gesehen')" :active="request()->routeIs('gesehen')">
  80. {{ __('Archiv') }}
  81. </x-responsive-nav-link>
  82. </div>
  83. <!-- Responsive Settings Options -->
  84. <div class="pt-4 pb-1 border-t border-field">
  85. @if (Auth::check())
  86. <div class="px-4">
  87. <div class="font-medium text-base text-fogra">{{ Auth::user()->name }}</div>
  88. <div class="font-medium text-sm text-field">{{ Auth::user()->email }}</div>
  89. </div>
  90. <div class="mt-3 space-y-1">
  91. <!-- Authentication -->
  92. <form method="POST" action="{{ route('logout') }}">
  93. @csrf
  94. <x-responsive-nav-link :href="route('logout')"
  95. onclick="event.preventDefault();
  96. this.closest('form').submit();">
  97. {{ __('Log Out') }}
  98. </x-responsive-nav-link>
  99. </form>
  100. </div>
  101. @else
  102. <x-responsive-nav-link :href="route('login')" :active="request()->routeIs('login')">
  103. {{ __('Login') }}
  104. </x-responsive-nav-link>
  105. @endif
  106. </div>
  107. </div>
  108. </nav>