From bb70a3b022bf974fdabc0dfab952f7f765bc3c39 Mon Sep 17 00:00:00 2001 From: Fabiano Date: Thu, 14 Jun 2018 12:58:33 -0300 Subject: [PATCH] Change banner to function and add js to display show and hide form. --- src/assets/js/js.js | 21 +++++++++++++++++++- src/functions.php | 30 +++++++++++++++++++++++++++++ src/header.php | 5 +++++ src/template-parts/bannerHeader.php | 17 ++++------------ 4 files changed, 59 insertions(+), 14 deletions(-) diff --git a/src/assets/js/js.js b/src/assets/js/js.js index c42ab80..6ee72ad 100644 --- a/src/assets/js/js.js +++ b/src/assets/js/js.js @@ -52,6 +52,23 @@ jQuery(document).ready(function( $ ) { }); }); + $('.showInput').on('click', function(){ + $('.tainacan-form-search').removeClass('d-none'); + $('.tainacan-form-search').addClass('d-flex'); + $(this).addClass('d-none'); + $('.tainacan-form-search').animate({opacity: '1'}, "slow"); + /* if($.trim($('.tainacan-input-search').val()).length){ + $('#btn-reset').removeClass('d-none'); + }else{ + $('#btn-reset').addClass('d-none'); + } */ + }); + $('.tainacan-input-search').on('blur', function(){ + $('.tainacan-form-search').animate({opacity: '0'}, "slow", function(){ + $('.showInput').removeClass('d-none'); + }); + }); + var config = { attributes: true, childList: true, @@ -62,4 +79,6 @@ jQuery(document).ready(function( $ ) { }); - +function showInput(){ + this.removeClass = 'd-none'; +} diff --git a/src/functions.php b/src/functions.php index 104fb5d..e0d2b3d 100644 --- a/src/functions.php +++ b/src/functions.php @@ -167,6 +167,36 @@ function tainacan_get_logo() { } } +function tainacan_get_form_search(){ + if(wp_is_mobile()){ + $input = 'border-0'; + $reset = 'border-0'; + $submit = 'border-0'; + }else{ + $input = 'border-right-0 rounded-0'; + $reset = 'border-left-0 border-right-0 rounded-0'; + $submit = 'border border-left-0 rounded-0'; + } + + $form = ''; + $form .= ''; + return $form; +} + /** * Change logo class function * diff --git a/src/header.php b/src/header.php index 4f7052e..69e3cd1 100644 --- a/src/header.php +++ b/src/header.php @@ -17,6 +17,11 @@
+ + diff --git a/src/template-parts/bannerHeader.php b/src/template-parts/bannerHeader.php index 5403013..9d1771e 100644 --- a/src/template-parts/bannerHeader.php +++ b/src/template-parts/bannerHeader.php @@ -1,16 +1,7 @@ - +
class="page-header header-filter clear-filter page-height" style="background-image: url('')"class="page-header header-filter clear-filter" style="background-image: url('/assets/images/capa.png')">