Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions css/component.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
z-index: 10000;
height: 230px;
overflow: hidden;
-webkit-transition: height 0.3s;
-moz-transition: height 0.3s;
transition: height 0.3s;
-webkit-transition: height 0.1s;
-moz-transition: height 0.1s;
transition: height 0.1s;
}

.cbp-af-header .cbp-af-inner {
Expand All @@ -19,15 +19,13 @@
padding: 0 1.875em;
}

.cbp-af-header h1,
.cbp-af-header nav {
.cbp-af-header h1, .cbp-af-header nav {
display: inline-block;
position: relative;
}

/* We just have one-lined elements, so we'll center the elements with the line-height set to the height of the header */
.cbp-af-header h1,
.cbp-af-header nav a {
.cbp-af-header h1, .cbp-af-header nav a {
line-height: 230px;
}

Expand Down Expand Up @@ -56,11 +54,10 @@
}

/* Transitions and class for reduced height */
.cbp-af-header h1,
.cbp-af-header nav a {
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
transition: all 0.3s;
.cbp-af-header h1, .cbp-af-header nav a {
-webkit-transition: all 0.1s;
-moz-transition: all 0.1s;
transition: all 0.1s;
}

.cbp-af-header.cbp-af-header-shrink {
Expand Down
1 change: 0 additions & 1 deletion css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ a:hover {

.bp-icon:after {
font-family: 'bpicons';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
Expand Down
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<script src="js/modernizr.custom.js"></script>
</head>
<body>
<!-- For Header -->
<div class="container">

<div class="cbp-af-header">
<div class="cbp-af-inner">
<h1>Fixed</h1>
Expand All @@ -38,6 +38,7 @@ <h1>On-Scroll Animated Header</h1>
<a href="http://tympanus.net/codrops/category/blueprints/" class="bp-icon bp-icon-archive" data-info="Blueprints archive"><span>Go to the archive</span></a>
</nav>
</header>
<!-- All this is just to fill up the space -->
<div class="main">
<section>
<div><p>Dreamcatcher american apparel typewriter polaroid, Pinterest hoodie tousled vegan pickled gastropub iPhone VHS sartorial. Fanny pack vinyl fingerstache whatever, raw denim Carles literally next level fashion axe photo booth pour-over Echo Park.</p></div>
Expand Down
2 changes: 1 addition & 1 deletion js/cbpAnimatedHeader.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
* Copyright 2013, Codrops
* http://www.codrops.com
*/
var cbpAnimatedHeader=(function(){var b=document.documentElement,g=document.querySelector(".cbp-af-header"),e=false,a=300;function f(){d();window.addEventListener("scroll",function(h){if(!e){e=true;setTimeout(d,250)}},false)}function d(){var h=c();if(h>=a){classie.add(g,"cbp-af-header-shrink")}else{classie.remove(g,"cbp-af-header-shrink")}e=false}function c(){return window.pageYOffset||b.scrollTop}f()})();
var cbpAnimatedHeader=(function(){var b=document.documentElement,g=document.querySelector(".cbp-af-header"),e=false,a=1;function f(){d();window.addEventListener("scroll",function(h){if(!e){e=true;setTimeout(d,250)}},false)}function d(){var h=c();if(h>=a){classie.add(g,"cbp-af-header-shrink")}else{classie.remove(g,"cbp-af-header-shrink")}e=false}function c(){return window.pageYOffset||b.scrollTop}f()})();