Adding search icon to desktop.

This commit is contained in:
sergiotarxz 2023-09-08 01:43:38 +02:00
parent 3d99dbf1cf
commit eecaba5131
5 changed files with 34 additions and 2 deletions

View File

@ -81,6 +81,12 @@ function addListenersSearch() {
if (search !== null) {
search.addEventListener('change', onSearchChange);
}
const searchIconDesktop = document.querySelector('nav.desktop a.search-icon');
if (searchIconDesktop !== null) {
searchIconDesktop.addEventListener('click', (e) => {
onFakeSearchClick(e)
})
}
}
function _port() {

View File

@ -148,6 +148,18 @@ body {
display: none; }
body nav.desktop a {
vertical-align: middle; }
body nav.desktop a.search-icon {
width: 60px;
height: 60px;
display: flex;
align-items: center;
justify-content: center; }
body nav.desktop a.search-icon img {
background: aliceblue;
border-radius: 10px;
padding: 10%;
width: 60%;
height: 60%; }
body nav.mobile-foldable {
display: none;
background: blueviolet;

View File

@ -208,6 +208,20 @@ body {
a {
vertical-align: middle;
}
a.search-icon {
width: 60px;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
img {
background: aliceblue;
border-radius: 10px;
padding: 10%;
width: 60%;
height: 60%;
}
}
}
nav.mobile-foldable {

File diff suppressed because one or more lines are too long

View File

@ -20,5 +20,5 @@ for my $category_key (@sorted_categories) {
my $selected = defined($target_category_slug) && $category->{slug} eq $target_category_slug;
%><a class="<%=$selected && "selected" %>" href="<%= '/'.$category->{slug} %>"><%==$category->{menu_text}%></a><%
}
%></nav>
%><a href="#" class="search-icon"><img alt="" src="/img/search.svg"/></a></nav>