Сергей Ракипов,
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
header{
height: 200px;
}
footer{
height: 1000px;
}
.blok{
width: 80px;
height: 80px;
background-color:#D3D3D3;
background-image: url(https://rakipov.ru/files/tsifra1.svg);
background-repeat: no-repeat;
background-position: center;
background-size: 70%;
border-radius: 7px;
}
.blok.blok2{
width: 80px;
height: 80px;
background-color:#000;
background-image: url(https://rakipov.ru/files/icon1.svg);
background-repeat: no-repeat;
background-position: center;
background-size: 70%;
border-radius: 7px;
}
</style>
</head>
<body>
<header></header>
<section>
<div class="blok"></div>
</section>
<footer></footer>
<script>
const blok = document.querySelector(".blok");
let anim1 = () => {
let ikonka1 = blok.getBoundingClientRect();
blok.classList.toggle("blok2", ikonka1.top >= 100);
};
window.addEventListener("scroll", anim1);
anim1();
</script>
</body>
</html>