<div class="welcome-button">
<div class="welcome-button">
<div class="bt-sl-solid-l down out"></div>
<div class="bt-sl-solid-r down out"></div>
<div class="bt-slider-0 bt-slide-l out"></div>
<div class="bt-slider-1 bt-slide-l out"></div>
<div class="bt-slider-2 bt-slide-l out"></div>
<div class="bt-slider-3 bt-slide-l out"></div>
<div class="bt-slider-4 bt-slide-l out"></div>
<a href="#" class="button out lin-t">
Hover Over Me
</a>
</div>
<script src='//assets.codepen.io/assets/libs/fullpage/jquery-c152c51c4dda93382a3ae51e8a5ea45d.js'></script>
body {
body {
background: #222;
}
a {
text-decoration: none;
transition: all 200ms ease-in;
transition: all 200ms ease-in;
transition: all 200ms ease-in;
transition: all 200ms ease-in;
}
.lin-t {
transition: all 300ms linear;
transition: all 300ms linear;
transition: all 300ms linear;
transition: all 300ms linear;
}
.button {
font-family: 'Aldrich', sans-serif;
text-align: center;
padding: 10px 10px;
color: white;
text-transform: uppercase;
}
.welcome-button {
position: fixed;
top: 40%;
left: 50%;
margin-left: -78px;
transition: all 600ms ease-in;
transition: all 600ms ease-in;
transition: all 600ms ease-in;
transition: all 600ms ease-in;
}
.welcome-button a {
line-height: 30px;
filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false);
opacity: 1;
transition: all 600ms ease-in;
transition: all 600ms ease-in;
transition: all 600ms ease-in;
transition: all 600ms ease-in;
}
.welcome-button a.out {
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
}
.welcome-button.out {
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
}
[class*='bt-slider-'] {
left: 100%;
position: absolute;
height: 100%;
border-left: 1px solid white;
z-index: 1000;
filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false);
opacity: 1;
}
[class*='bt-slider-'].out {
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
}
.bt-slide-l {
left: 0;
}
.bt-slider-0 {
transition: all 200ms ease-in;
transition: all 200ms ease-in;
transition: all 200ms ease-in;
transition: all 200ms ease-in;
}
.bt-slider-1 {
transition: all 800ms ease-in;
transition: all 800ms ease-in;
transition: all 800ms ease-in;
transition: all 800ms ease-in;
}
.bt-slider-2 {
transition: all 300ms ease-in;
transition: all 300ms ease-in;
transition: all 300ms ease-in;
transition: all 300ms ease-in;
}
.bt-slider-3 {
transition: all 500ms ease-in;
transition: all 500ms ease-in;
transition: all 500ms ease-in;
transition: all 500ms ease-in;
}
.bt-slider-4 {
transition: all 1000ms ease-in;
transition: all 1000ms ease-in;
transition: all 1000ms ease-in;
transition: all 1000ms ease-in;
}
.bt-sl-solid-l {
position: absolute;
left: 0;
height: 100%;
border-left: 2px solid orange;
z-index: 1001;
transition: all 500ms ease-in-out;
transition: all 500ms ease-in-out;
transition: all 500ms ease-in-out;
transition: all 500ms ease-in-out;
}
.bt-sl-solid-l.out {
left: 50%;
}
.bt-sl-solid-l.down {
height: 0%;
}
.bt-sl-solid-r {
position: absolute;
right: -1px;
height: 100%;
border-left: 2px solid orange;
z-index: 1001;
transition: all 500ms ease-in-out;
transition: all 500ms ease-in-out;
transition: all 500ms ease-in-out;
transition: all 500ms ease-in-out;
}
.bt-sl-solid-r.out {
right: 50%;
}
.bt-sl-solid-r.down {
height: 0%;
}
//If you like this and wish to use it please give credit where it is due! -Kaigth :)
//If you like this and wish to use it please give credit where it is due! -Kaigth :)
//variables
var document = window.document,
$_window = $( window ),
timeout,
isAnimating = false,
slideNum = 0,
$welcomeBarL = $( ".bt-sl-solid-l" ),
$welcomeBarR = $( ".bt-sl-solid-r" ),
$btSlideActive = $( ".welcome-button" ).find( ".bt-slide-l" ),
$welcomeBtn = $( ".welcome-button a" );
//------//
//Delegation
$welcomeBtn.on( 'mouseenter', function () {
var timeout,
$slidebar = $( '.bt-slider-' + slideNum ),
animate = function () {
timeout = setTimeout(function () {
clearTimeout( timeout );
if ( slideNum === 5 ) {
isAnimating = false;
slideNum = 0;
} else {
isAnimating = true;
$slidebar = $( '.bt-slider-' + slideNum );
$slidebar.removeClass( 'bt-slide-l' );
slideNum++;
animate();
}
}, 100 );
};
animate();
});
$welcomeBtn.on( 'mouseout', function () {
var timeout,
$slidebar = $( '.bt-slider-' + slideNum ),
animate = function () {
timeout = setTimeout(function () {
clearTimeout( timeout );
if ( slideNum === 5 ) {
isAnimating = false;
slideNum = 0;
} else {
isAnimating = true;
$slidebar = $( '.bt-slider-' + slideNum );
$slidebar.addClass( 'bt-slide-l' );
slideNum++;
animate();
}
}, 100 );
};
animate();
});
$_window.on( "load", function () {
timeout = setTimeout(function () {
clearTimeout();
$welcomeBarL.removeClass( "down" );
$welcomeBarR.removeClass( "down" );
}, 100 );
timeout = setTimeout(function () {
clearTimeout();
$welcomeBarL.removeClass( "out" );
$welcomeBarR.removeClass( "out" );
}, 400 );
timeout = setTimeout(function () {
clearTimeout();
$welcomeBtn.removeClass( "out" );
}, 800 );
timeout = setTimeout(function () {
clearTimeout();
$btSlideActive.removeClass( "out" );
}, 1000 );
});