Transitioning Backgrounds

Developer
Size
2,099 Kb
Views
10,120

How do I make an transitioning backgrounds?

Transitioning background images are masked by a static SVG.. What is a transitioning backgrounds? How do you make a transitioning backgrounds? This script and codes were developed by Rich Wertz on 29 January 2023, Sunday.

Transitioning Backgrounds Previews

Transitioning Backgrounds - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Transitioning Backgrounds</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <html lang>
<head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Transitioning backgrounds</title>	</head>	<body>	<div class="bg">	<div class="bg_item"></div>	<div id="fader" class="bg_item"></div>
</div>
<div id="svg"></div> <script> </script>	</body>	</html> <script src="js/index.js"></script>
</body>
</html>

Transitioning Backgrounds - Script Codes CSS Codes

html,
body {	margin: 0;	padding: 0;	width: 100%;	height: 100%;
}
#svg {	width: 100%;	height: 100%;	color: rgb(2, 200, 242);	background-color: currentColor;	-webkit-mask: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/329887/WD258-img-hero1.svg') no-repeat 50% 50%;	-webkit-mask-size: cover;
}
.bg {	position: fixed;	top: 0;	left: 0;	z-index: -1;	width: 100%;	height: 100%;
}
.bg_item {	position: absolute;	top: 0;	left: 0;	width: 100%;	height: 100%;	background-position: 50% 50%;	background-repeat: no-repeat;	transition: opacity 2500ms ease;
}
.bg_item:nth-child(1) {	background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/329887/WD258-2.jpg');	background-size: cover;
}
.bg_item:nth-child(2) {	background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/329887/WD258-1.jpg');	background-size: cover;
}
.hide {	opacity: 0;
}
/*
https://s3-us-west-2.amazonaws.com/s.cdpn.io/329887/WD258-1.jpg
*/

Transitioning Backgrounds - Script Codes JS Codes

 var fader = document.getElementById('fader'); var timer = setInterval(switcher, 3000); function switcher() { fader.classList.toggle('hide'); }
Transitioning Backgrounds - Script Codes
Transitioning Backgrounds - Script Codes
Home Page Home
Developer Rich Wertz
Username richwertz
Uploaded January 29, 2023
Rating 3
Size 2,099 Kb
Views 10,120
Do you need developer help for Transitioning Backgrounds?

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!

Rich Wertz (richwertz) Script Codes
Create amazing Facebook ads 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!