Color Tiles

Developer
Size
2,479 Kb
Views
40,480

How do I make an color tiles?

What is a color tiles? How do you make a color tiles? This script and codes were developed by Jonathan Neal on 30 August 2022, Tuesday.

Color Tiles Previews

Color Tiles - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Color Tiles</title> <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! */ body {	margin: 1em;	text-align: center;
}
.bw {	display: inline-block;	position: relative;	overflow: hidden;	vertical-align: top;
}
.c {	-webkit-filter: blur(1px);	filter: blur(1px);	opacity: 0;	position: absolute;	transform-origin: 50% 50%;	transition: -webkit-filter 1s 0.25s, filter 1s 0.25s, opacity 0s, transform 1s 0.25s;
}
.c.out {	-webkit-filter: blur(5px);	filter: blur(5px);	opacity: 1;	transform: scale(0.95, 0.95);
}
.c:hover {	-webkit-filter: blur(1px);	filter: blur(1px);	opacity: 1;	transform: scale(1, 1);	transition: -webkit-filter 0.5s, filter 0.5s, opacity 0.5s, transform 0.5s;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <script src="js/index.js"></script>
</body>
</html>

Color Tiles - Script Codes CSS Codes

body {	margin: 1em;	text-align: center;
}
.bw {	display: inline-block;	position: relative;	overflow: hidden;	vertical-align: top;
}
.c {	-webkit-filter: blur(1px);	filter: blur(1px);	opacity: 0;	position: absolute;	transform-origin: 50% 50%;	transition: -webkit-filter 1s 0.25s, filter 1s 0.25s, opacity 0s, transform 1s 0.25s;
}
.c.out {	-webkit-filter: blur(5px);	filter: blur(5px);	opacity: 1;	transform: scale(0.95, 0.95);
}
.c:hover {	-webkit-filter: blur(1px);	filter: blur(1px);	opacity: 1;	transform: scale(1, 1);	transition: -webkit-filter 0.5s, filter 0.5s, opacity 0.5s, transform 0.5s;
}

Color Tiles - Script Codes JS Codes

var imgbw = new Image, imgc = new Image;
imgbw.onload = function () {	var divbw, xRate = 0.05, yRate = 0.05, width = imgbw.width, height = imgbw.height;	divbw = document.createElement("div");	divbw.className = "bw";	divbw.style.backgroundImage = "url("+imgbw.src+")";	divbw.style.width = width+"px";	divbw.style.height = height+"px";	var xInterval = width * xRate, yInterval = height * yRate;	for (var y = 0; y < height; y += yInterval) {	for (var x = 0; x < width; x += xInterval) {	(function (divc) {	console.log(x, y);	divc.className = "c";	divc.style.backgroundImage = "url("+imgc.src+")";	divc.style.backgroundPosition = "-"+x+"px -"+y+"px";	divc.style.left = x+"px";	divc.style.top = y+"px";	divc.style.height = yInterval+"px";	divc.style.width = xInterval+"px";	divc.onmouseout = function () {	divc.classList.add("out");	};	})(divbw.appendChild(document.createElement("div")));	}	}	document.body.appendChild(divbw);
};
imgbw.src = "http://i.imgur.com/W6pSQwd.jpg";
imgc.src = "http://i.imgur.com/0fZhUie.jpg";
Color Tiles - Script Codes
Color Tiles - Script Codes
Home Page Home
Developer Jonathan Neal
Username jonneal
Uploaded August 30, 2022
Rating 3.5
Size 2,479 Kb
Views 40,480
Do you need developer help for Color Tiles?

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!

Jonathan Neal (jonneal) Script Codes
Create amazing captions 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!