🍦
💩
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>アプリ</title>
<style>
#ice-cream {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 200px;
}
#poop {
position: absolute;
font-size: 20px;
}
</style>
</head>
<body>
<div id="ice-cream">🍦</div>
<script>
function displayPoop() {
const iceCream = document.getElementById("ice-cream");
const poop = document.getElementById("poop");
const iceCreamTop = iceCream.offsetTop;
const iceCreamLeft = iceCream.offsetLeft;
setInterval(function() {
const top = Math.floor(Math.random() * window.innerHeight);
const left = Math.floor(Math.random() * window.innerWidth);
poop.style.top = top + "px";
poop.style.left = left + "px";
if (top >= iceCreamTop && left >= iceCreamLeft) {
poop.style.display = "none";
} else {
poop.style.display = "block";
}
}, 1000);
}
displayPoop();
</script>
<div id="poop">💩</div>
</body>
</html>