Barberpole Hover Animation

Developer
Size
3,674 Kb
Views
38,456

How do I make an barberpole hover animation?

From pages like this: http://www.uniqlo.com/us/mens-clothingOnly they use an animated GIF and this is CSS only. Would have like to not do the extra div for the hover, but there is no background-opacity.... What is a barberpole hover animation? How do you make a barberpole hover animation? This script and codes were developed by Chris Coyier on 11 October 2022, Tuesday.

Barberpole Hover Animation Previews

Barberpole Hover Animation - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Barberpole Hover Animation</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ @import url(https://fonts.googleapis.com/css?family=Ropa+Sans);
body { padding: 20px; font-family: 'Ropa Sans', sans-serif;
}
.product { width: 376px; padding: 15px; position: relative; float: left; margin: 0 20px 0 0;
}
.product > img { display: block; position: relative;
}
.product:hover .product-hover, .product:active .product-hover { opacity: 1;
}
.product-hover { position: absolute; top: 0; left: 0; right: 0; bottom: 0; opacity: 0; transition: opacity 0.3s ease; background-size: 30px 30px; background-image: linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.1) 75%, transparent 75%, transparent); animation: barberpole 0.5s linear infinite;
}
@keyframes barberpole { from { background-position: 0 0; } to { background-position: 60px 30px; }
}
.product-info { position: absolute; bottom: 30px; right: 30px; background: white; width: 150px; padding: 10px 10px 50px 10px;
}
.subhead { color: #f00; text-transform: uppercase; font-weight: bold;
}
.product-name { color: #990033; text-transform: uppercase; font-weight: bold; margin: 0; letter-spacing: -1px;
}
.price { position: absolute; bottom: 10px; right: 10px;
}
.amount { color: red; font-size: 150%;
}
.amount > span { font-size: 75%;
}
h1 { font-size: 72px; margin: 2px 0 0 0;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="product"> <div class="product-hover"></div> <img src="http://fillmurray.com/300/300"/> <div class="product-info"> <div class="subhead">Sale</div> <h2 class="product-name">Fleece</h2> <p class="product-description">Beat the chill and get cozy.</p> <div class="price"> <span class="from">from</span> <span class="amount"> <span>$</span>9.90 </span> </div> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
</body>
</html>

Barberpole Hover Animation - Script Codes CSS Codes

@import url(https://fonts.googleapis.com/css?family=Ropa+Sans);
body { padding: 20px; font-family: 'Ropa Sans', sans-serif;
}
.product { width: 376px; padding: 15px; position: relative; float: left; margin: 0 20px 0 0;
}
.product > img { display: block; position: relative;
}
.product:hover .product-hover, .product:active .product-hover { opacity: 1;
}
.product-hover { position: absolute; top: 0; left: 0; right: 0; bottom: 0; opacity: 0; transition: opacity 0.3s ease; background-size: 30px 30px; background-image: linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.1) 75%, transparent 75%, transparent); animation: barberpole 0.5s linear infinite;
}
@keyframes barberpole { from { background-position: 0 0; } to { background-position: 60px 30px; }
}
.product-info { position: absolute; bottom: 30px; right: 30px; background: white; width: 150px; padding: 10px 10px 50px 10px;
}
.subhead { color: #f00; text-transform: uppercase; font-weight: bold;
}
.product-name { color: #990033; text-transform: uppercase; font-weight: bold; margin: 0; letter-spacing: -1px;
}
.price { position: absolute; bottom: 10px; right: 10px;
}
.amount { color: red; font-size: 150%;
}
.amount > span { font-size: 75%;
}
h1 { font-size: 72px; margin: 2px 0 0 0;
}
Barberpole Hover Animation - Script Codes
Barberpole Hover Animation - Script Codes
Home Page Home
Developer Chris Coyier
Username chriscoyier
Uploaded October 11, 2022
Rating 4.5
Size 3,674 Kb
Views 38,456
Do you need developer help for Barberpole Hover Animation?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Chris Coyier (chriscoyier) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!