Image based blurry background

Size
3,695 Kb
Views
28,336

How do I make an image based blurry background?

What is a image based blurry background? How do you make a image based blurry background? This script and codes were developed by Orion Drummond on 22 August 2022, Monday.

Image based blurry background Previews

Image based blurry background - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Image based blurry background</title> <script src="http://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <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! */ body { margin: 0; padding: 0; min-height: 100vh;
}
figure { margin: 0; padding: 0; position: relative; z-index: 0; background-size: 1px 50%;
}
figure menu { position: absolute; z-index: 1; padding: 0; margin: 0; top: 100%; left: 1em; background-color: rgba(0, 0, 0, 0.5); color: #ffffff; box-shadow: inset 0 0 0 0.1em rgba(255, 255, 255, 0.35);
}
figure menu input { display: block; margin: 3ex 1em;
}
figure:before,
figure:after { display: block; width: 100%; height: 100%;
}
figure:before { position: absolute; content: ""; background-image: url("//media-cache-ak0.pinimg.com/736x/eb/35/e2/eb35e21d1e249f07738e9d5634962d78.jpg"); background-size: inherit; transform: scale(2, 5);
}
figure.smooth:before { -webkit-filter: blur(3px);
}
figure:after { position: relative; content: url("//media-cache-ak0.pinimg.com/736x/eb/35/e2/eb35e21d1e249f07738e9d5634962d78.jpg"); background-image: linear-gradient(to bottom, black, transparent);
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <figure id="hero" class="smooth"> <menu> <input data-target="#hero" type="range" min="1" max="3" step="1" name="x"/> <input data-target="#hero" type="range" min="20" max="80" step="1" name="y"/> <input data-target="#hero" type="checkbox" checked name="smooth"/> </menu>
</figure> <script src="js/index.js"></script>
</body>
</html>

Image based blurry background - Script Codes CSS Codes

body { margin: 0; padding: 0; min-height: 100vh;
}
figure { margin: 0; padding: 0; position: relative; z-index: 0; background-size: 1px 50%;
}
figure menu { position: absolute; z-index: 1; padding: 0; margin: 0; top: 100%; left: 1em; background-color: rgba(0, 0, 0, 0.5); color: #ffffff; box-shadow: inset 0 0 0 0.1em rgba(255, 255, 255, 0.35);
}
figure menu input { display: block; margin: 3ex 1em;
}
figure:before,
figure:after { display: block; width: 100%; height: 100%;
}
figure:before { position: absolute; content: ""; background-image: url("//media-cache-ak0.pinimg.com/736x/eb/35/e2/eb35e21d1e249f07738e9d5634962d78.jpg"); background-size: inherit; transform: scale(2, 5);
}
figure.smooth:before { -webkit-filter: blur(3px);
}
figure:after { position: relative; content: url("//media-cache-ak0.pinimg.com/736x/eb/35/e2/eb35e21d1e249f07738e9d5634962d78.jpg"); background-image: linear-gradient(to bottom, black, transparent);
}

Image based blurry background - Script Codes JS Codes

var stub = [1, 50];
document.getElementsByName("x")[0].addEventListener("change", function() { stub[0] = this.value; document.querySelector(this.getAttribute("data-target")).style.backgroundSize = parseInt(this.value).toPrecision(1) + "px " + stub[1] + "%"; }, false);
document.getElementsByName("y")[0].addEventListener("change", function() { stub[1] = this.value; document.querySelector(this.getAttribute("data-target")).style.backgroundSize = (stub[0] + "px " + Math.floor(this.value) + "%"); }, false);
document.getElementsByName("smooth")[0].addEventListener("change", function() { var cl = document.querySelector(this.getAttribute("data-target")).classList; console.log(this.checked); if(this.checked) { cl.add("smooth"); } else { cl.remove("smooth"); } }, false);
Image based blurry background - Script Codes
Image based blurry background - Script Codes
Home Page Home
Developer Orion Drummond
Username tappily
Uploaded August 22, 2022
Rating 3
Size 3,695 Kb
Views 28,336
Do you need developer help for Image based blurry background?

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!

Orion Drummond (tappily) Script Codes
Create amazing web content 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!