祝:新年快乐!
本帖最后由 宁静 于 2024-2-13 17:35 编辑 <br /><br /><style>#papa { position: relative; margin:150px 0 0 calc(50% - 801px); width: 1440px; height: 800px; background: url('https://xlaj.cn/assets/file/zp/20240210125832.jpg') no-repeat center/cover, radial-gradient(transparent,tan); background-blend-mode: overlay; box-shadow: 3px 3px 20px #000; overflow: hidden; z-index: 1; }
#papa img { position: absolute; cursor: pointer; mix-blend-mode: multiply; transform-origin: 50% 0; animation: swear 1s infinite alternate var(--state); }
#papa img:nth-of-type(1) { top: 40px; left: 60px; }
#papa img:nth-of-type(2) { top: 30; right: 0; }
li-zi { position: absolute; left: 690px; top: 200px; width: 20px; height: 20px; border-radius: 50%; background: gold; }
@keyframes moving { from { transform: rotate(0) translate(0,0); } to { transform: rotate(var(--deg)) translate(-540px,300px); } }
@keyframes swear { from { transform: rotate(-10deg); } to { transform: rotate(10deg); } }
</style>
<div id="papa">
<audio id="aud" src="https://wj.zp68.com/lxx/yunhua/2022/01/28/01.mp3" autoplay loop></audio>
<img src="https://638183.freep.cn/638183/small/dgls1.jpg" alt="" />
<img src="https://638183.freep.cn/638183/small/dgls2.jpg" alt="" />
</div>
<script>
var imgs = document.querySelectorAll('#papa > img');
var all = 36;
for(let i = 0; i < all; i++) {
let lz = document.createElement('li-zi');
lz.style.cssText += `
--deg: ${Math.random() * -60}deg;
opacity: ${Math.random()};
animation: moving ${Math.random() * 4 + 4}s -${Math.random() * 4}s infinite var(--state);
`;
papa.prepend(lz);
}
var mState = () => aud.paused ? (papa.style.setProperty('--state', 'paused')) : (papa.style.setProperty('--state', 'running'));
aud.addEventListener('pause', mState);
aud.addEventListener('playing',mState);
imgs.forEach(img => img.onclick = () => aud.paused ? aud.play() : aud.pause());
</script> 今天大年初一,祝大家新年快乐! 金龙吐珠,祝福大家来年财运滚滚来 手机手动播放,点击灯笼音乐出来。 新年快乐! 沉默 发表于 2024-2-10 13:39
新年快乐!
新年快乐!{:10_402:}
真喜庆!宁静新年快乐{:10_402:} 祝东篱的朋友们新春快乐! 愿宁静在新的一年里身体健康幸运连连万事如意! 新春快乐!
页:
[1]
2