Image Hover

Developer
Size
3,409 Kb
Views
18,216

How do I make an image hover?

Inspired by la24.org. What is a image hover? How do you make a image hover? This script and codes were developed by John Heiner on 14 November 2022, Monday.

Image Hover Previews

Image Hover - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Image Hover</title> <link href='https://fonts.googleapis.com/css?family=Open+Sans:800' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <a href="#" class="card">	<div class="card__bg"></div>	<div class="card__image" style="background-image: url(http://nordicfoodfestival.org/wp-content/uploads/sites/7/2015/07/iceland-insane.jpg)"></div>	<div class="card__text"><small>Visit</small>Iceland</div>
</a>
</body>
</html>

Image Hover - Script Codes CSS Codes

body { font-size: 1.4rem; font-family: "Open Sans", sans-serif; color: #fff; background-color: #eee; -webkit-font-smoothing: antialiased; margin: 0; padding: 0; overflow: hidden;
}
.card { width: 500px; height: 316px; overflow: hidden; position: absolute; top: 50%; left: 50%; -webkit-transform: translate3d(-50%, -50%, 0); transform: translate3d(-50%, -50%, 0); text-align: center; -webkit-transition: box-shadow 300ms cubic-bezier(0.41, 0.25, 0.08, 1) 0ms; transition: box-shadow 300ms cubic-bezier(0.41, 0.25, 0.08, 1) 0ms; box-shadow: 0 27px 55px 0 rgba(0, 0, 0, 0.3), 0 17px 17px 0 rgba(0, 0, 0, 0.15);
}
.card:hover { box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.25), 0 2px 2px 0 rgba(0, 0, 0, 0.1);
}
.card:hover .card__image { -webkit-transform: scale(1.06); transform: scale(1.06); -webkit-transition: -webkit-transform 500ms cubic-bezier(0.165, 0.84, 0.44, 1) 0ms; transition: -webkit-transform 500ms cubic-bezier(0.165, 0.84, 0.44, 1) 0ms; transition: transform 500ms cubic-bezier(0.165, 0.84, 0.44, 1) 0ms; transition: transform 500ms cubic-bezier(0.165, 0.84, 0.44, 1) 0ms, -webkit-transform 500ms cubic-bezier(0.165, 0.84, 0.44, 1) 0ms;
}
.card:hover .card__bg { opacity: 0.45; -webkit-transform: scale(1); transform: scale(1); -webkit-animation-name: bgin; animation-name: bgin; -webkit-animation-duration: 400ms; animation-duration: 400ms; -webkit-transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1) 0ms, -webkit-transform 400ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1) 0ms, -webkit-transform 400ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1) 0ms, transform 400ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1) 0ms, transform 400ms cubic-bezier(0.23, 1, 0.32, 1) 0ms, -webkit-transform 400ms cubic-bezier(0.23, 1, 0.32, 1) 0ms;
}
@-webkit-keyframes bgin { from { opacity: 0; -webkit-transform: scale(0.1); transform: scale(0.1); } to { opacity: 0.45; -webkit-transform: scale(1); transform: scale(1); }
}
@keyframes bgin { from { opacity: 0; -webkit-transform: scale(0.1); transform: scale(0.1); } to { opacity: 0.45; -webkit-transform: scale(1); transform: scale(1); }
}
@-webkit-keyframes bgout { from { opacity: 0.45; -webkit-transform: scale(1); transform: scale(1); } to { opacity: 0; -webkit-transform: scale(1); transform: scale(1); }
}
@keyframes bgout { from { opacity: 0.45; -webkit-transform: scale(1); transform: scale(1); } to { opacity: 0; -webkit-transform: scale(1); transform: scale(1); }
}
.card__bg { position: absolute; width: 675px; height: 675px; opacity: 0; z-index: 5; left: 50%; top: 50%; margin-left: -337.5px; margin-top: -337.5px; border-radius: 999px; -webkit-animation-name: bgout; animation-name: bgout; -webkit-animation-duration: 400ms; animation-duration: 400ms; -webkit-transition: opacity 400ms cubic-bezier(0.39, 0.575, 0.565, 1) 0ms; transition: opacity 400ms cubic-bezier(0.39, 0.575, 0.565, 1) 0ms; background-color: #fd4053; background-size: 337.5px 337.5px;
}
.card__image { position: absolute; width: 100%; height: 100%; -webkit-transform: scale(1); transform: scale(1); -webkit-transition: -webkit-transform 700ms cubic-bezier(0.165, 0.84, 0.44, 1) 0ms; transition: -webkit-transform 700ms cubic-bezier(0.165, 0.84, 0.44, 1) 0ms; transition: transform 700ms cubic-bezier(0.165, 0.84, 0.44, 1) 0ms; transition: transform 700ms cubic-bezier(0.165, 0.84, 0.44, 1) 0ms, -webkit-transform 700ms cubic-bezier(0.165, 0.84, 0.44, 1) 0ms; background-size: cover; background-position: 50% 50%; -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.card__text { position: absolute; z-index: 20; color: white; text-transform: uppercase; font-weight: 800; font-size: 2.5rem; top: 50%; left: 50%; -webkit-transform: translateX(-50%) translateY(-20%); transform: translateX(-50%) translateY(-20%); text-align: center; -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.card__text:after { content: ''; width: 50px; height: 2px; background-color: #fd4053; display: block; position: absolute; bottom: -10px; left: 50%; -webkit-transform: translateX(-50%); transform: translateX(-50%);
}
.card__text small { display: block; font-size: 0.85rem; letter-spacing: 5px; line-height: 5px;
}
Image Hover - Script Codes
Image Hover - Script Codes
Home Page Home
Developer John Heiner
Username johnheiner
Uploaded November 14, 2022
Rating 3
Size 3,409 Kb
Views 18,216
Do you need developer help for Image Hover?

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!

John Heiner (johnheiner) Script Codes
Create amazing video scripts 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!