Skip to content

Commit 31ed589

Browse files
committed
mobile Search improvement
1 parent f373477 commit 31ed589

File tree

4 files changed

+91
-0
lines changed

4 files changed

+91
-0
lines changed

frontend-build/scss/modules.scss

+34
Original file line numberDiff line numberDiff line change
@@ -423,4 +423,38 @@ table.ccgn-profile {
423423
font-weight: bold;
424424
}
425425
}
426+
}
427+
.search-mobile-container {
428+
position: fixed;
429+
width: 100%;
430+
top: -3rem;
431+
padding: 2rem 1rem 1rem 1rem;
432+
background-color: $primary-color;
433+
transition: all .5s ease-in-out;
434+
opacity: 0;
435+
.search-form {
436+
position: relative;
437+
margin-top: .5rem;
438+
.search-field {
439+
height: 3rem;
440+
padding: .5rem;
441+
background-color: $white;
442+
border: 0;
443+
border-bottom: 1px solid $black;
444+
box-shadow: none;
445+
@include placeholder {
446+
color: $dark-gray;
447+
}
448+
}
449+
.fa-search {
450+
position: absolute;
451+
right: .5rem;
452+
top: .5rem;
453+
font-size: 1.5rem;
454+
}
455+
}
456+
&.open {
457+
top: 3.5rem;
458+
opacity: 1;
459+
}
426460
}

themes/cc-commoners/assets/css/style.css

+39
Original file line numberDiff line numberDiff line change
@@ -4513,6 +4513,45 @@ table.ccgn-profile {
45134513
font-size: 1.1rem;
45144514
font-weight: bold; }
45154515

4516+
.search-mobile-container {
4517+
position: fixed;
4518+
width: 100%;
4519+
top: -3rem;
4520+
padding: 2rem 1rem 1rem 1rem;
4521+
background-color: #efbe01;
4522+
-webkit-transition: all .5s ease-in-out;
4523+
transition: all .5s ease-in-out;
4524+
opacity: 0; }
4525+
.search-mobile-container .search-form {
4526+
position: relative;
4527+
margin-top: .5rem; }
4528+
.search-mobile-container .search-form .search-field {
4529+
height: 3rem;
4530+
padding: .5rem;
4531+
background-color: #fefefe;
4532+
border: 0;
4533+
border-bottom: 1px solid #0a0a0a;
4534+
-webkit-box-shadow: none;
4535+
box-shadow: none; }
4536+
.search-mobile-container .search-form .search-field.placeholder {
4537+
color: #8a8a8a; }
4538+
.search-mobile-container .search-form .search-field:-moz-placeholder {
4539+
color: #8a8a8a; }
4540+
.search-mobile-container .search-form .search-field::-moz-placeholder {
4541+
color: #8a8a8a; }
4542+
.search-mobile-container .search-form .search-field:-ms-input-placeholder {
4543+
color: #8a8a8a; }
4544+
.search-mobile-container .search-form .search-field::-webkit-input-placeholder {
4545+
color: #8a8a8a; }
4546+
.search-mobile-container .search-form .fa-search {
4547+
position: absolute;
4548+
right: .5rem;
4549+
top: .5rem;
4550+
font-size: 1.5rem; }
4551+
.search-mobile-container.open {
4552+
top: 3.5rem;
4553+
opacity: 1; }
4554+
45164555
@media screen and (max-width: 39.99875em) {
45174556
.home .page-body {
45184557
padding-top: 2.9rem; }

themes/cc-commoners/assets/js/cc-commoners.js

+10
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,19 @@ jQuery(document).ready(function($){
179179
$('.menu-mobile-container').toggleClass('hide');
180180
return false;
181181
});
182+
$('.open-mobile-search').on('click', function(e){
183+
e.preventDefault();
184+
$('.search-mobile-container').toggleClass('open');
185+
return false;
186+
})
182187
$('.menu-mobile-container').find('.close').on('click', function (e) {
183188
e.preventDefault();
184189
$(this).parent().addClass('hide');
185190
return false;
186191
});
192+
$('.search-mobile-container').find('.close').on('click', function (e) {
193+
e.preventDefault();
194+
$('.search-mobile-container').removeClass('open');
195+
return false;
196+
});
187197
});

themes/cc-commoners/header.php

+8
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@
6868
?>
6969
</nav>
7070
</div>
71+
<div class="search-mobile-container">
72+
<a class="close" href="#">
73+
<button class="close-button search" aria-label="Close alert" type="button" data-close>
74+
<span aria-hidden="true">&times;</span>
75+
</button>
76+
</a>
77+
<?php get_search_form(); ?>
78+
</div>
7179
<header class="site-header hide-for-small-only" >
7280
<div class="grid-container">
7381
<div class="grid-x grid-padding-x align-center">

0 commit comments

Comments
 (0)