mirror of
https://github.com/kremalicious/blog.git
synced 2025-02-14 21:10:25 +01:00
bounce search field
This commit is contained in:
parent
373753b09e
commit
88381fc19d
@ -35,7 +35,7 @@ var siteNavigation = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// show search
|
// show search
|
||||||
$searcharea.addClass('ready');
|
$searcharea.removeClass('ready bounceOutUp').addClass('ready bounceInDown');
|
||||||
$searchfield.focus();
|
$searchfield.focus();
|
||||||
if ( $searchfield.val().length ) {
|
if ( $searchfield.val().length ) {
|
||||||
$searchpop.removeClass('hide');
|
$searchpop.removeClass('hide');
|
||||||
@ -48,7 +48,7 @@ var siteNavigation = {
|
|||||||
|
|
||||||
// bind the hide controls
|
// bind the hide controls
|
||||||
$(document).bind('click.hidethepop', function() {
|
$(document).bind('click.hidethepop', function() {
|
||||||
$searcharea.removeClass('ready');
|
$searcharea.removeClass('bounceInDown');
|
||||||
$searchpop.addClass('hide');
|
$searchpop.addClass('hide');
|
||||||
|
|
||||||
// unbind the hide controls
|
// unbind the hide controls
|
||||||
@ -78,7 +78,7 @@ var siteNavigation = {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
// hide search area
|
// hide search area
|
||||||
$searcharea.removeClass('ready');
|
$searcharea.removeClass('bounceInDown').addClass('bounceOutUp');
|
||||||
$searchpop.addClass('hide');
|
$searchpop.addClass('hide');
|
||||||
|
|
||||||
// empty search field
|
// empty search field
|
||||||
|
@ -42,3 +42,48 @@ gpuacceleration()
|
|||||||
opacity: 1
|
opacity: 1
|
||||||
100%
|
100%
|
||||||
opacity: 0
|
opacity: 0
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bounce
|
||||||
|
//
|
||||||
|
// taken and adapted from
|
||||||
|
// http://daneden.github.io/animate.css/
|
||||||
|
////////////////////////////////////
|
||||||
|
|
||||||
|
// Down
|
||||||
|
@keyframes bounceInDown
|
||||||
|
0%, 60%, 75%, 90%, 100%
|
||||||
|
// http://cubic-bezier.com/#.06,.85,.54,1.39
|
||||||
|
transition-timing-function: cubic-bezier(.06,.85,.54,1)
|
||||||
|
|
||||||
|
0%
|
||||||
|
transform: translate3d(0, -100px, 0)
|
||||||
|
|
||||||
|
60%
|
||||||
|
transform: translate3d(0, 20px, 0)
|
||||||
|
|
||||||
|
75%
|
||||||
|
transform: translate3d(0, -10px, 0)
|
||||||
|
|
||||||
|
90%
|
||||||
|
transform: translate3d(0, 5px, 0)
|
||||||
|
|
||||||
|
100%
|
||||||
|
transform: none
|
||||||
|
|
||||||
|
.bounceInDown
|
||||||
|
animation: bounceInDown .4s both
|
||||||
|
|
||||||
|
// Up
|
||||||
|
@keyframes bounceOutUp
|
||||||
|
20%
|
||||||
|
transform: translate3d(0, -10px, 0)
|
||||||
|
|
||||||
|
40%, 45%
|
||||||
|
transform: translate3d(0, 20px, 0)
|
||||||
|
|
||||||
|
100%
|
||||||
|
transform: translate3d(0, -100px, 0)
|
||||||
|
|
||||||
|
.bounceOutUp
|
||||||
|
animation: bounceOutUp .5s both
|
||||||
|
@ -33,10 +33,10 @@
|
|||||||
z-index: 3
|
z-index: 3
|
||||||
|
|
||||||
// hidden by default
|
// hidden by default
|
||||||
transform: translate(0, -70px)
|
display: none
|
||||||
|
|
||||||
&.ready
|
&.ready
|
||||||
transform: translate(0, 0)
|
display: block
|
||||||
|
|
||||||
.search-results
|
.search-results
|
||||||
@extend .clearfix
|
@extend .clearfix
|
||||||
|
Loading…
x
Reference in New Issue
Block a user