From f42b65e3f295a0830acab070250307ae0869bc5b Mon Sep 17 00:00:00 2001 From: Severyn Kozak Date: Thu, 15 May 2014 09:23:03 -0400 Subject: [PATCH] Integrate advanced search form with existing UI. Add: static/js/index.js -Add a `jQuery` callback to `fadeIn()` and `fadeOut()` the advanced-search form. templates/index.html, static/sass/index.sass -Add advanced-search form toggling button markup and styling. --- static/js/index.js | 18 ++++++++++++++++-- static/sass/_variables.sass | 3 +++ static/sass/index.sass | 38 +++++++++++++++++++++++++++----------- templates/index.html | 6 ++++-- 4 files changed, 50 insertions(+), 15 deletions(-) diff --git a/static/js/index.js b/static/js/index.js index fb0d090..77e6641 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -1,8 +1,22 @@ /* - * @file Manages all library initialization, query entry, server - * querying, and results diplay for `index.html`. + * @file Manages all library initialization, jQuery callbacks, query entry + * callbacks, server querying, and results diplay for `index.html`. */ +var advancedSearchDiv = $("div#advanced-search"); +var advancedSearchButton = $("button#advanced-search"); +advancedSearchDiv.hide(); +advancedSearchButton.click(function(){ + if(!advancedSearchDiv.hasClass("visible")){ + advancedSearchDiv.fadeIn(500); + advancedSearchDiv.addClass("visible"); + } + else { + advancedSearchDiv.fadeOut(300); + advancedSearchDiv.removeClass("visible"); + } +}); + $(function() { $("#date-last-modified").datepicker(); $("#date-created").datepicker(); diff --git a/static/sass/_variables.sass b/static/sass/_variables.sass index 9a875e3..e9101b7 100644 --- a/static/sass/_variables.sass +++ b/static/sass/_variables.sass @@ -5,3 +5,6 @@ $baseColor1: #A31F34 $baseColor2: #8A8B8C $baseColor3: #C2C0BF + +$lightBlue: #4D90FE +$blue: #3177EB diff --git a/static/sass/index.sass b/static/sass/index.sass index 7348b4b..bd383bf 100644 --- a/static/sass/index.sass +++ b/static/sass/index.sass @@ -6,7 +6,7 @@ @import variables .ui-datepicker - font-size: 0.7em + font-size: 70% .twitter-typeahead width: 100% @@ -52,7 +52,7 @@ div#search-field width: 34% #title - font-size: 4em + font-size: 400% padding-bottom: 0.5em text-align: center @@ -68,14 +68,32 @@ div#search-field form#search-bar - input[type="text"] + input[type="text"], button + @extend .t3 @include vendor(box-sizing, border-box) - border: 1px solid $baseColor1 - font-size: 1.1em + border: 1px solid $baseColor2 + font-size: 110% margin-bottom: 0px padding: 6px - width: 100% + width: 80% + + &:hover + border-color: $baseColor1 + + button + background-color: $lightBlue + border: 1px solid $baseColor2 + color: white + display: inline + white-space: nowrap + overflow: hidden + width: 20% + + &.clicked, &:hover + @extend .t3 + + background-color: $blue div#advanced-search background-color: white @@ -83,9 +101,7 @@ div#search-field margin: 0px overflow: auto padding: 0px - - &.visible - padding-bottom: 30px + display: none >div @include vendor(box-sizing, border-box) @@ -107,13 +123,13 @@ div#search-field label display: block - font-size: 1.1em + font-size: 110% input[type="text"] @extend .t2 border-color: $baseColor3 - font-size: 1em + font-size: 100% padding: 4px width: 100% diff --git a/templates/index.html b/templates/index.html index 901c6b8..eaaf5ff 100644 --- a/templates/index.html +++ b/templates/index.html @@ -18,7 +18,7 @@ = endblock = block body -
+
bit«