<div id="description">
<h2>Приклад 1: зміна елемента за допомогою функції paint()</h2>
<p>Наведіть курсор на елемент, щоб побачити зміну.</p>
</div>
<div id="result">
<div class="image-container">
<div class="image paint"></div>
</div>
</div>
#description {
background-color: #f2f2f2;
padding: 20px;
font-family: Arial, sans-serif;
}
#result {
display: flex;
justify-content: center;
align-items: center;
height: 400px;
}
.image-container {
position: relative;
}
.image {
width: 200px;
height: 200px;
background-size: cover;
background-position: center;
}
.paint {
background-image: -webkit-paint(url("https://picsum.photos/200/200"));
background-image: paint(url("https://picsum.photos/200/200"));
transition: background-image 0.3s ease;
}
.paint:hover {
background-image: -webkit-paint(url("https://picsum.photos/200/200?blur"));
background-image: paint(url("https://picsum.photos/200/200?blur"));
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.