@@ -20,33 +20,37 @@ class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm fon
20
20
wire:model.live =" search"
21
21
type =" text"
22
22
placeholder =" Search..."
23
- class =" w-full rounded-md border px-4 py-2 focus:border-blue-300 focus:outline-none focus:ring sm:w-2/3 "
23
+ class =" w-full rounded-md border px-4 py-2 focus:border-blue-300 focus:outline-none focus:ring"
24
24
/>
25
25
26
26
<!-- Filter select -->
27
- <label for =" filter-select" class =" sr-only" >Filter by</label >
28
- <select
27
+ {{--
28
+ <label for="filter-select" class="sr-only">Filter by</label>
29
+ <select
29
30
id="filter-select"
30
31
wire:model.live="filter"
31
32
class="w-full rounded-md border px-4 py-2 focus:border-blue-300 focus:outline-none focus:ring sm:w-1/6"
32
- >
33
+ >
33
34
<option value="">Filter by</option>
34
35
@foreach ($this->alternativesTags as $tag)
35
- <option value =" {{ $tag -> id } }" >{{ $tag -> name } } ({{ $tag -> alternatives_count } } )</option >
36
+ <option value="{{ $tag->id }}">{{ $tag->name }} ({{ $tag->alternatives_count }})</option>
36
37
@endforeach
37
- </select >
38
+ </select>
39
+ --}}
38
40
39
- <label for =" order-select" class =" sr-only" >Order by</label >
40
41
<!-- Order select -->
41
- <select
42
+ {{--
43
+ <label for="order-select" class="sr-only">Order by</label>
44
+ <select
42
45
id="order-select"
43
46
wire:model.live="order"
44
47
class="w-full rounded-md border px-4 py-2 focus:border-blue-300 focus:outline-none focus:ring sm:w-1/6"
45
- >
48
+ >
46
49
<option value="">Order by</option>
47
50
<option value="asc">Ascending</option>
48
51
<option value="desc">Descending</option>
49
- </select >
52
+ </select>
53
+ --}}
50
54
</div >
51
55
</div >
52
56
</section >
@@ -59,23 +63,72 @@ class="w-full rounded-md border px-4 py-2 focus:border-blue-300 focus:outline-no
59
63
<div
60
64
class =" relative flex h-full cursor-pointer flex-col overflow-hidden rounded-lg bg-white shadow-sm transition-all duration-300 hover:shadow-md"
61
65
>
62
- <!-- Alternative Badge (Top Right) -->
66
+ <!-- Alternative Badge (Top Right) with Tooltip -->
63
67
<div
64
- class =" absolute right-2 top-2 z-10 flex items-center rounded-full bg-green-600 px-2 py-1 text-xs font-bold text-white"
68
+ x-data =" {
69
+ tooltipVisible: false,
70
+ tooltipText: 'NonIsraeli Alternate',
71
+ tooltipArrow: true,
72
+ tooltipPosition: 'left',
73
+ }"
74
+ x-init ="
75
+ $refs.content.addEventListener('mouseenter', () => {
76
+ tooltipVisible = true
77
+ })
78
+ $refs.content.addEventListener('mouseleave', () => {
79
+ tooltipVisible = false
80
+ })
81
+ "
82
+ class =" absolute right-2 top-2 z-20"
65
83
>
66
- <svg
67
- xmlns = " http://www.w3.org/2000/svg "
68
- class = " size-4 "
69
- x-description = " Heroicon name: solid/check-circle "
70
- viewBox = " 0 0 24 24 "
71
- fill = " currentColor "
84
+ <div
85
+ x-ref = " tooltip "
86
+ x-show = " tooltipVisible "
87
+ :class = " { 'top-0 left-1/2 -translate-x-1/2 -mt-0.5 -translate-y-full' : tooltipPosition == 'top', 'top-1/2 -translate-y-1/2 -ml-0.5 left-0 -translate-x-full' : tooltipPosition == 'left', 'bottom-0 left-1/2 -translate-x-1/2 -mb-0.5 translate-y-full' : tooltipPosition == 'bottom', 'top-1/2 -translate-y-1/2 -mr-0.5 right-0 translate-x-full' : tooltipPosition == 'right' } "
88
+ class = " absolute w-auto text-sm "
89
+ x-cloak
72
90
>
73
- <path
74
- fill-rule =" evenodd"
75
- d =" M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z"
76
- clip-rule =" evenodd"
77
- />
78
- </svg >
91
+ <div
92
+ x-show =" tooltipVisible"
93
+ x-transition
94
+ class =" relative rounded bg-black bg-opacity-90 px-2 py-1 text-white shadow-lg"
95
+ >
96
+ <p
97
+ x-text =" tooltipText"
98
+ class =" block flex-shrink-0 whitespace-nowrap text-xs"
99
+ ></p >
100
+ <div
101
+ x-ref =" tooltipArrow"
102
+ x-show =" tooltipArrow"
103
+ :class =" { 'bottom-0 -translate-x-1/2 left-1/2 w-2.5 translate-y-full' : tooltipPosition == 'top', 'right-0 -translate-y-1/2 top-1/2 h-2.5 -mt-px translate-x-full' : tooltipPosition == 'left', 'top-0 -translate-x-1/2 left-1/2 w-2.5 -translate-y-full' : tooltipPosition == 'bottom', 'left-0 -translate-y-1/2 top-1/2 h-2.5 -mt-px -translate-x-full' : tooltipPosition == 'right' }"
104
+ class =" absolute inline-flex items-center justify-center overflow-hidden"
105
+ >
106
+ <div
107
+ :class =" { 'origin-top-left -rotate-45' : tooltipPosition == 'top', 'origin-top-left rotate-45' : tooltipPosition == 'left', 'origin-bottom-left rotate-45' : tooltipPosition == 'bottom', 'origin-top-right -rotate-45' : tooltipPosition == 'right' }"
108
+ class =" h-1.5 w-1.5 transform bg-black bg-opacity-90"
109
+ ></div >
110
+ </div >
111
+ </div >
112
+ </div >
113
+
114
+ <div
115
+ x-ref =" content"
116
+ class =" relative flex cursor-pointer items-center rounded-full bg-green-600 px-2 py-1 text-xs font-bold text-white"
117
+ >
118
+ <svg
119
+ xmlns =" http://www.w3.org/2000/svg"
120
+ class =" size-4"
121
+ x-description =" Heroicon name: solid/check-circle"
122
+ viewBox =" 0 0 24 24"
123
+ fill =" currentColor"
124
+ >
125
+ <path
126
+ fill-rule =" evenodd"
127
+ d =" M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z"
128
+ clip-rule =" evenodd"
129
+ />
130
+ </svg >
131
+ </div >
79
132
</div >
80
133
81
134
<!-- Country Badge (Top Left) - Different shape and color -->
0 commit comments