Menu icon Foundation
Topbar expanding search box

Has anyone tried/seen a Foundation topbar integration of the following effect?

http://tympanus.net/codrops/2013/06/26/expanding-search-bar-deconstructed/

I'd very much like to have this in my topbar. However, the default .has-form shrinks the search-trigger button.

Here is what I came up with so far:

  <nav class="top-bar" data-topbar>
    <ul class="title-area">
      <li class="name">
        <h1><a href="#">Something</a></h1>
      </li>
      <li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>
    </ul>

  <section class="top-bar-section">
    <!-- Right Nav Section -->
    <ul class="right">
      <li class="active"><a href="#">Right Nav Button Active</a></li>
      <li class="has-dropdown">
        <a href="#">Right Button with Dropdown</a>
        <ul class="dropdown">
          <li><a href="#">First link in dropdown</a></li>
        </ul>
      </li>
    </ul>

    <!-- Left Nav Section -->
    <ul class="left">
        <li class="divider"></li>
        <li class="search-trigger hide-small"><a href=""><i class="fi-magnifying-glass"></i></a></li>
        <li class="search has-form"><input type="text" placeholder="Site Search..."></li>
    </ul>
  </section>
</nav>

$(document).ready(function() {
	$('.search-trigger').click(function(e){
		e.preventDefault();
		$('.search').toggleClass('triggered');
	});
});

.sticky-topbar {
    clear: both;
	z-index: 1000;
}

.search-trigger a {
	max-height: $topbar-height;
}

.search-trigger {
	display: none;
}

@media #{$large-up} {
	
	.search-trigger {
		display: block;
	}
	
	.search {
		padding-left: 8px !important;
	}

	.search input {
		width: 0;
		overflow: hidden;
		padding-left: 0;
		padding-right: 0;
		margin-left: 0;
		margin-right: 0;
		border: 0;
		-webkit-transition: width 0.3s;
		-moz-transition: width 0.3s;
		-ms-transition: width 0.3s;
		-o-transition: width 0.3s;
		transition: width 0.3s;
	}

	.search.triggered input {
		padding-left: 8px;
		padding-right: 8px;
		width: 100%;
	}

}

topbarsearchboxanimationslide

Has anyone tried/seen a Foundation topbar integration of the following effect?

http://tympanus.net/codrops/2013/06/26/expanding-search-bar-deconstructed/

I'd very much like to have this in my topbar. However, the default .has-form shrinks the search-trigger button.

Here is what I came up with so far:

  <nav class="top-bar" data-topbar>
    <ul class="title-area">
      <li class="name">
        <h1><a href="#">Something</a></h1>
      </li>
      <li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>
    </ul>

  <section class="top-bar-section">
    <!-- Right Nav Section -->
    <ul class="right">
      <li class="active"><a href="#">Right Nav Button Active</a></li>
      <li class="has-dropdown">
        <a href="#">Right Button with Dropdown</a>
        <ul class="dropdown">
          <li><a href="#">First link in dropdown</a></li>
        </ul>
      </li>
    </ul>

    <!-- Left Nav Section -->
    <ul class="left">
        <li class="divider"></li>
        <li class="search-trigger hide-small"><a href=""><i class="fi-magnifying-glass"></i></a></li>
        <li class="search has-form"><input type="text" placeholder="Site Search..."></li>
    </ul>
  </section>
</nav>

$(document).ready(function() {
	$('.search-trigger').click(function(e){
		e.preventDefault();
		$('.search').toggleClass('triggered');
	});
});

.sticky-topbar {
    clear: both;
	z-index: 1000;
}

.search-trigger a {
	max-height: $topbar-height;
}

.search-trigger {
	display: none;
}

@media #{$large-up} {
	
	.search-trigger {
		display: block;
	}
	
	.search {
		padding-left: 8px !important;
	}

	.search input {
		width: 0;
		overflow: hidden;
		padding-left: 0;
		padding-right: 0;
		margin-left: 0;
		margin-right: 0;
		border: 0;
		-webkit-transition: width 0.3s;
		-moz-transition: width 0.3s;
		-ms-transition: width 0.3s;
		-o-transition: width 0.3s;
		transition: width 0.3s;
	}

	.search.triggered input {
		padding-left: 8px;
		padding-right: 8px;
		width: 100%;
	}

}