Skip to content

Instantly share code, notes, and snippets.

@tmthrgd
Last active September 2, 2016 09:59
Show Gist options
  • Save tmthrgd/dbe0000653c80778acf27ea6ea99d442 to your computer and use it in GitHub Desktop.
Save tmthrgd/dbe0000653c80778acf27ea6ea99d442 to your computer and use it in GitHub Desktop.
CSS3 Animated Banner
<!doctype html>
<html lang=en>
<!--
(c) Tom Thorogood 2012
https://tomthorogood.co.uk
Copyright 2012 Tom Thorogood. All rights reserved.
Use of this source code is governed by a
Modified BSD License license that can be found in
the LICENSE file.
-->
<head>
<meta charset=utf-8>
<title>CSS3 Animated Banner</title>
<style>
@-webkit-keyframes top-banner-scroll {
0%, 15% {
top:0px;
}
30%, 45% {
top:-140px;
}
55%, 70% {
top:-280px;
}
85%, 100% {
top:-420px;
}
}
@-khtml-keyframes top-banner-scroll {
0%, 15% {
top:0px;
}
30%, 45% {
top:-140px;
}
55%, 70% {
top:-280px;
}
85%, 100% {
top:-420px;
}
}
@-moz-keyframes top-banner-scroll {
0%, 15% {
top:0px;
}
30%, 45% {
top:-140px;
}
55%, 70% {
top:-280px;
}
85%, 100% {
top:-420px;
}
}
@-ms-keyframes top-banner-scroll {
0%, 15% {
top:0px;
}
30%, 45% {
top:-140px;
}
55%, 70% {
top:-280px;
}
85%, 100% {
top:-420px;
}
}
@-o-keyframes top-banner-scroll {
0%, 15% {
top:0px;
}
30%, 45% {
top:-140px;
}
55%, 70% {
top:-280px;
}
85%, 100% {
top:-420px;
}
}
@keyframes top-banner-scroll {
0%, 15% {
top:0px;
}
30%, 45% {
top:-140px;
}
55%, 70% {
top:-280px;
}
85%, 100% {
top:-420px;
}
}
.top-banner, .top-banner * {
margin:0;
padding:0;
}
.top-banner {
background:-webkit-gradient(linear,100% 0,0 0,from(#01bcf1),to(#fff));
background:-webkit-linear-gradient(right,#01bcf1,#fff);
background:-khtml-linear-gradient(right,#01bcf1,#fff);
background:-moz-linear-gradient(right,#01bcf1,#fff);
background:-ms-linear-gradient(right,#01bcf1,#fff);
background:-o-linear-gradient(right,#01bcf1,#fff);
background:linear-gradient(right,#01bcf1,#fff);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#01bcf1',GradientType=1);
color:#627082;
font:19px "Century Gothic",sans-serif;
height:70px;
overflow:hidden;
padding:20px;
text-align:right;
text-transform:uppercase;
width:510px;
}
.top-banner > div {
-webkit-animation:top-banner-scroll 20s infinite;
-khtml-animation:top-banner-scroll 20s infinite;
-moz-animation:top-banner-scroll 20s infinite;
-ms-animation:top-banner-scroll 20s infinite;
-o-animation:top-banner-scroll 20s infinite;
animation:top-banner-scroll 20s infinite;
position:relative;
}
.top-banner:active > div, .top-banner:focus > div, .top-banner:hover > div {
-webkit-animation-play-state:paused;
-khtml-animation-play-state:paused;
-moz-animation-play-state:paused;
-ms-animation-play-state:paused;
-o-animation-play-state:paused;
animation-play-state:paused;
}
.top-banner > div > p {
height:140px;
line-height:70px;
width:510px;
}
.top-banner-address {
color:#fff;
float:right;
font:11px Arial,sans-serif;
margin:0 0 0 20px;
text-align:left;
text-transform:none;
}
.top-banner-address > span {
display:block;
width:100%;
}
</style>
</head>
<body>
<div class=top-banner>
<div>
<p>The Best Products</p>
<p>At The Very Best Prices</p>
<p>With Our Excellent Service Guarenteed</p>
<p>Contact Us For A Quote
<span class=top-banner-address>
<span>123 Fake Street</span>
<span>New York, New York, U.S.A.</span>
<span>Mon-Fri 9:00am - 5:00pm</span>
<span>Tel: 800-555-0199</span>
<span>Fax: 800-555-0199</span>
</span>
</p>
</div>
</div>
<div><p>&copy; <a href=https://tomthorogood.co.uk>Tom Thorogood</a> 2012</p></div>
</body>
</html>
Copyright (c) 2012, Tom Thorogood.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Tom Thorogood nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment