Skip to content

Instantly share code, notes, and snippets.

@mraible
Created October 27, 2015 13:01
Show Gist options
  • Select an option

  • Save mraible/74d0d8fe77b8baf52857 to your computer and use it in GitHub Desktop.

Select an option

Save mraible/74d0d8fe77b8baf52857 to your computer and use it in GitHub Desktop.
CSS for uiButterbar.js
.butterbar {
position: relative;
height: 3px;
margin-bottom: -3px;
z-index: 1;
}
.butterbar .bar {
position: absolute;
width: 100%;
height: 0;
text-indent: -9999px;
background-color: #23b7e5;
}
.butterbar .bar:before {
position: absolute;
right: 50%;
left: 50%;
height: 3px;
background-color: inherit;
content: "";
}
.butterbar.active {
-webkit-animation: changebar 2.25s infinite 0.75s;
-moz-animation: changebar 2.25s infinite 0.75s;
animation: changebar 2.25s infinite 0.75s;
}
.butterbar.active .bar {
-webkit-animation: changebar 2.25s infinite;
-moz-animation: changebar 2.25s infinite;
animation: changebar 2.25s infinite;
}
.butterbar.active .bar:before {
-webkit-animation: movingbar 0.75s infinite;
-moz-animation: movingbar 0.75s infinite;
animation: movingbar 0.75s infinite;
}
/* Moving bar */
@-webkit-keyframes movingbar {
0% {
right: 50%;
left: 50%;
}
99.9% {
right: 0;
left: 0;
}
100% {
right: 50%;
left: 50%;
}
}
@-moz-keyframes movingbar {
0% {
right: 50%;
left: 50%;
}
99.9% {
right: 0;
left: 0;
}
100% {
right: 50%;
left: 50%;
}
}
@keyframes movingbar {
0% {
right: 50%;
left: 50%;
}
99.9% {
right: 0;
left: 0;
}
100% {
right: 50%;
left: 50%;
}
}
/* change bar */
@-webkit-keyframes changebar {
0% {
background-color: #23b7e5;
}
33.3% {
background-color: #23b7e5;
}
33.33% {
background-color: #fad733;
}
66.6% {
background-color: #fad733;
}
66.66% {
background-color: #7266ba;
}
99.9% {
background-color: #7266ba;
}
}
@-moz-keyframes changebar {
0% {
background-color: #23b7e5;
}
33.3% {
background-color: #23b7e5;
}
33.33% {
background-color: #fad733;
}
66.6% {
background-color: #fad733;
}
66.66% {
background-color: #7266ba;
}
99.9% {
background-color: #7266ba;
}
}
@keyframes changebar {
0% {
background-color: #23b7e5;
}
33.3% {
background-color: #23b7e5;
}
33.33% {
background-color: #fad733;
}
66.6% {
background-color: #fad733;
}
66.66% {
background-color: #7266ba;
}
99.9% {
background-color: #7266ba;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment