Skip to content
This repository was archived by the owner on Jan 24, 2022. It is now read-only.

Commit 668242a

Browse files
committed
search page & Add dropdown
1 parent 0d9eb9a commit 668242a

File tree

3 files changed

+416
-8
lines changed

3 files changed

+416
-8
lines changed

source/_layouts/nav.blade.php

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="flex flex-col space-y-2 lg:space-y-0 lg:flex-row lg:space-x-6 xl:space-x-8 lg:items-center">
2-
<a class="text-primary hover:underline" href="#">Home</a>
3-
<a class="text-gray-500 hover:text-primary hover:underline" href="#">Components</a>
2+
<a class="text-primary hover:underline" href="/">Home</a>
3+
<a class="text-gray-500 hover:text-primary hover:underline" href="/components">Components</a>
44
<a class="text-gray-500 hover:text-primary hover:underline" href="#">Featured</a>
55
<a class="text-gray-500 hover:text-primary hover:underline" href="#">Blog</a>
66
<a class="text-gray-500 hover:text-primary hover:underline" href="#">Cheatsheet</a>
@@ -16,9 +16,35 @@
1616
<a href="#" class="px-4 py-2 text-sm font-semibold text-center text-white rounded-md bg-primary hover:bg-teal-300">
1717
Submit new component
1818
</a>
19-
20-
<button class="flex items-center justify-center space-x-2 focus:outline-none">
21-
<img class="object-cover w-8 h-8 border-2 rounded-full border-primary lg:w-10 lg:h-10 " src="https://images.unsplash.com/photo-1502767882403-636aee14f873?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80" alt="avatar">
22-
<span class="font-medium text-gray-800 lg:hidden">Jane Doe</span>
23-
</button>
19+
20+
<div class="relative" @mouseover="dropdown = true" @mouseover.away="dropdown = false" x-data="{ dropdown: true }">
21+
<!-- Dropdown toggle button -->
22+
<button class="flex items-center justify-center space-x-2 focus:outline-none">
23+
<img class="object-cover w-8 h-8 border-2 rounded-full border-primary lg:w-10 lg:h-10 " src="https://images.unsplash.com/photo-1502767882403-636aee14f873?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80" alt="avatar">
24+
<span class="font-medium text-gray-800 lg:hidden">Jane Doe</span>
25+
</button>
26+
27+
<!-- Dropdown menu -->
28+
<div
29+
x-show="dropdown"
30+
x-transition:enter="transition ease-out duration-100 transform"
31+
x-transition:enter-start="opacity-0 scale-95"
32+
x-transition:enter-end="opacity-100 scale-100"
33+
x-transition:leave="transition ease-in duration-75 transform"
34+
x-transition:leave-start="opacity-100 scale-100"
35+
x-transition:leave-end="opacity-0 scale-95"
36+
class="absolute right-0 z-20 w-48 py-1 mt-2 bg-white border border-gray-100 rounded-md shadow-xl dark:bg-gray-800">
37+
<a href="#" class="block px-4 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 transform dark:text-gray-300 hover:bg-primary hover:text-white dark:hover:text-white">
38+
your profile
39+
</a>
40+
41+
<a href="#" class="block px-4 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 transform dark:text-gray-300 hover:bg-primary hover:text-white dark:hover:text-white">
42+
Settings
43+
</a>
44+
<hr>
45+
<a href="#" class="block px-4 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 transform dark:text-gray-300 hover:bg-primary hover:text-white dark:hover:text-white">
46+
Log Out
47+
</a>
48+
</div>
49+
</div>
2450
</div>

source/index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="mt-6 bg-white border rounded-md lg:w-96 focus-within:ring ring-primary focus-within:border-teal-500">
1313
<div class="flex flex-wrap justify-between md:flex-row">
1414
<input type="name" class="flex-1 p-2 m-1 text-gray-700 border-none appearance-none focus:outline-none focus:placeholder-transparent focus:ring-0" placeholder="Search Components">
15-
<button class="flex justify-center w-full p-2 m-1 text-white transition-colors duration-200 transform rounded-md bg-primary lg:w-auto hover:bg-teal-300">
15+
<button class="flex justify-center w-full p-2 m-1 text-white transition-colors duration-200 transform rounded-md bg-primary lg:w-auto hover:bg-teal-300 focus:outline-none focus:bg-teal-300">
1616
<svg class="w-6 h-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
1717
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
1818
</svg>

0 commit comments

Comments
 (0)