Demo:
tıklayın <style>
body {
background-color: #000;
margin: 0;
padding: 0;
overflow-x: hidden;
}
.omurcn53-kar-sahnesi {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 99999;
overflow: hidden;
}
.omurcn53-kar-tanesi {
position: absolute;
top: -10px;
background-color: #fff;
border-radius: 50%;
opacity: 0.8;
box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}
@keyframes omurcn53-yagis-animasyonu {
0% {
transform: translateY(-10vh) translateX(0);
opacity: 0;
}
10% {
opacity: 1;
}
100% {
transform: translateY(110vh) translateX(20px);
opacity: 0.3;
}
}
@keyframes omurcn53-sallanma {
0%, 100% {
margin-left: 0;
}
50% {
margin-left: 15px;
}
}
</style><div id="omurcn53-kar-sahnesi" class="omurcn53-kar-sahnesi"></div>
<script>
document.addEventListener('DOMContentLoaded', () => {
const sahne = document.getElementById('omurcn53-kar-sahnesi');
const karTanesiSayisi = 50;
for (let i = 0; i < karTanesiSayisi; i++) {
createSnowflake(sahne);
}
function createSnowflake(container) {
const flake = document.createElement('div');
flake.classList.add('omurcn53-kar-tanesi');
const size = Math.random() * 4 + 2;
flake.style.width = `${size}px`;
flake.style.height = `${size}px`;
flake.style.left = `${Math.random() * 100}%`;
const duration = Math.random() * 10 + 5;
flake.style.animation = `
omurcn53-yagis-animasyonu ${duration}s linear infinite,
omurcn53-sallanma ${Math.random() * 4 + 2}s ease-in-out infinite alternate
`;
flake.style.animationDelay = `-${Math.random() * 10}s`;
flake.style.opacity = Math.random() * 0.5 + 0.3;
if (Math.random() > 0.5) {
flake.style.filter = `blur(${Math.random()}px)`;
}
container.appendChild(flake);
}
});
</script>