-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Frontend - Styling autocomplete #670
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
90b4c90
Styling autocomplete
Roene-JustBetter cafc646
Make resize larger | Fix comment
Roene-JustBetter 995f797
Update comment
Roene-JustBetter d91bd5c
Added v-else and added :key
Roene-JustBetter f8cf4ae
Merge branch 'master' of github.com:rapidez/core into feature/fronten…
Roene-JustBetter 1040a6b
Merge branch 'master' of github.com:rapidez/core into feature/fronten…
Roene-JustBetter f875e94
Removed .css for imports
Roene-JustBetter 298e857
Merge branch 'master' of github.com:rapidez/core into feature/fronten…
Roene-JustBetter 4c230d6
Feedback autocomplete
Roene-JustBetter 0b7aa90
Revert wrong changes
Roene-JustBetter 34a28cb
Replaced z-index for correct name
Roene-JustBetter ed2dffb
Update search autocomplete visual and functional
Roene-JustBetter d6a4474
Update translations | Dynamic generate height for autocomplete | Remo…
Roene-JustBetter f9f6936
Change config back to original
Roene-JustBetter 5971e4f
Changed size back to 3 & removed it from categories as it is not need…
Roene-JustBetter 43616f6
Merge branch 'master' of github.com:rapidez/core into feature/fronten…
Roene-JustBetter e917f23
Update autocomplete with new colors & z-indexes
Roene-JustBetter 6419204
Apply fixes from Prettier
Roene-JustBetter 4ec268b
Revert file
Roene-JustBetter 6be26cc
Added translations
Roene-JustBetter b1cd21f
Added border in header back
Roene-JustBetter cbca0f2
Merge branch 'feature/frontend-autocomplete' of github.com:rapidez/co…
Roene-JustBetter dac772a
Added translation
Roene-JustBetter d5b8939
Added missing translations
Roene-JustBetter 5794063
Added padding bottom in header for small screens
Roene-JustBetter 63a3e9f
Update resources/views/layouts/partials/header/autocomplete.blade.php
Roene-JustBetter c29c2ef
Update resources/views/layouts/partials/header/autocomplete.blade.php
Roene-JustBetter 51cf8c7
Update resources/views/layouts/partials/header/autocomplete/no-result…
Roene-JustBetter 922a839
Changed slot-scope
Roene-JustBetter 05f7078
Addec v-bind:
Roene-JustBetter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.search-input + div div[groupposition='right'] { | ||
@apply size-6 right-16 cursor-pointer z-50 !-translate-y-1/2 !top-1/2 !absolute; | ||
|
||
.cancel-icon { | ||
@apply hidden; | ||
} | ||
} | ||
|
||
.search-input + div div[groupposition='right'] div[isclearicon='true']::before { | ||
@apply size-6; | ||
content: ''; | ||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M4.20986 4.38708L4.29286 4.29308C4.46505 4.1209 4.69415 4.01747 4.93718 4.00219C5.18021 3.98691 5.42046 4.06083 5.61286 4.21008L5.70686 4.29308L11.9999 10.5851L18.2929 4.29308C18.3851 4.19757 18.4955 4.12139 18.6175 4.06898C18.7395 4.01657 18.8707 3.98898 19.0035 3.98783C19.1362 3.98668 19.2679 4.01198 19.3908 4.06226C19.5137 4.11254 19.6254 4.18679 19.7193 4.28069C19.8131 4.37458 19.8874 4.48623 19.9377 4.60913C19.988 4.73202 20.0133 4.8637 20.0121 4.99648C20.011 5.12926 19.9834 5.26048 19.931 5.38249C19.8786 5.50449 19.8024 5.61483 19.7069 5.70708L13.4149 12.0001L19.7069 18.2931C19.879 18.4653 19.9825 18.6944 19.9978 18.9374C20.013 19.1804 19.9391 19.4207 19.7899 19.6131L19.7069 19.7071C19.5347 19.8793 19.3056 19.9827 19.0625 19.998C18.8195 20.0133 18.5793 19.9393 18.3869 19.7901L18.2929 19.7071L11.9999 13.4151L5.70686 19.7071C5.51826 19.8892 5.26566 19.99 5.00346 19.9878C4.74126 19.9855 4.49045 19.8803 4.30504 19.6949C4.11963 19.5095 4.01447 19.2587 4.01219 18.9965C4.00991 18.7343 4.1107 18.4817 4.29286 18.2931L10.5849 12.0001L4.29286 5.70708C4.12068 5.53489 4.01725 5.30579 4.00197 5.06276C3.98669 4.81974 4.06061 4.57949 4.20986 4.38708Z' fill='%232E4A56'/%3E%3C/svg%3E"); | ||
} | ||
|
||
mark { | ||
@apply bg-transparent text-inherit font-bold; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
resources/views/components/autocomplete/magnifying-glass.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{{-- This is the search icon in the autocomplete --}} | ||
<div {{ $attributes->twMerge('transition-colors duration-300 rounded-lg bg-muted absolute right-1 inset-y-1 w-11 pointer-events-none flex items-center justify-center text z-header-autocomplete-button') }}> | ||
<x-heroicon-o-magnifying-glass class="size-5" /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{{-- This title is shown in the search autocomplete above the products and categories --}} | ||
<div {{ $attributes->twMerge('text-muted text-xs font-semibold pb-2 px-5') }}> | ||
{{ $slot }} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 46 additions & 32 deletions
78
resources/views/layouts/partials/header/autocomplete.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
resources/views/layouts/partials/header/autocomplete/all-results.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="font-sans px-5"> | ||
<x-rapidez::button.primary | ||
v-bind:href="'/search?q=' + dataSearchScope.value" | ||
class="relative group flex items-center gap-x-4 w-full text-sm" | ||
> | ||
<span>@lang('View all products')</span> | ||
</x-rapidez::button.primary> | ||
</div> |
14 changes: 6 additions & 8 deletions
14
resources/views/layouts/partials/header/autocomplete/categories.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
resources/views/layouts/partials/header/autocomplete/no-results.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<div class="font-bold text text-lg break-all"> | ||
@lang('No results found for :searchterm', ['searchterm' => '<span class="text-primary">"@{{ value }}"</span>']) | ||
</div> | ||
<div class="flex flex-col text-sm pt-7"> | ||
<span class="font-bold">@lang('Have you tried:')</span> | ||
<ul class="flex flex-col pt-1.5 gap-y-1 *:flex *:gap-x-2 *:items-center"> | ||
<li> | ||
<x-heroicon-s-check class="size-4"/> | ||
@lang('Check the spelling of your search term') | ||
</li> | ||
<li> | ||
<x-heroicon-s-check class="size-4"/> | ||
@lang('Make your search term less specific') | ||
</li> | ||
<li> | ||
<x-heroicon-s-check class="size-4"/> | ||
@lang('Use other search terms') | ||
</li> | ||
</ul> | ||
</div> |
32 changes: 21 additions & 11 deletions
32
resources/views/layouts/partials/header/autocomplete/products.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
<ul class="gap-5 grid md:grid-cols-2"> | ||
<li v-for="suggestion in suggestions" :key="suggestion.source._id"> | ||
<a :href="suggestion.source.url | url" class="flex flex-wrap flex-1"> | ||
<img :src="resizedPath(suggestion.source.thumbnail + '.webp', '80x80')" class="self-center object-contain w-14 aspect-square" /> | ||
<div class="flex flex-1 flex-wrap px-2"> | ||
<strong class="hyphens block w-full" v-html="highlight(suggestion, 'name')"></strong> | ||
<div class="self-end">@{{ suggestion.source.price | price }}</div> | ||
</div> | ||
</a> | ||
</li> | ||
</ul> | ||
<div class="pt-4 pb-2"> | ||
<x-rapidez::autocomplete.title>@lang('Products')</x-rapidez::autocomplete.title> | ||
<ul class="gap-2 flex flex-col"> | ||
<li v-for="suggestion in dataSearchScope.data" :key="suggestion.source._id"> | ||
<a v-bind:href="suggestion.source.url | url" class="group relative flex flex-wrap py-2"> | ||
<img :src="'/storage/{{ config('rapidez.store') }}/resizes/200/magento/catalog/product' + suggestion.source.thumbnail + '.webp'" class="shrink-0 self-center object-contain size-16 mix-blend-multiply" /> | ||
<div class="flex flex-1 justify-center flex-col px-2"> | ||
<div class="text-sm font-medium font-sans hyphens-auto line-clamp-2 w-full" v-html="autocompleteScope.highlight(suggestion, 'name')"></div> | ||
<div class="flex items-center gap-x-0.5 mt-0.5"> | ||
<div v-if="suggestion.source.special_price" class="text-muted font-sans line-through text-xs"> | ||
@{{ suggestion.source.price | price }} | ||
</div> | ||
<div class="text-sm text font-sans font-bold"> | ||
@{{ (suggestion.source.special_price || suggestion.source.price) | price }} | ||
</div> | ||
</div> | ||
</div> | ||
</a> | ||
</li> | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested the case local:
Tested running
yarn dev
&yarn prod