爱情转移(马黑黑原创)
本帖最后由 朵拉 于 2024-1-14 21:58 编辑 <br /><br /><style>#papa {
margin: 0 0 0 calc(50% - 681px);
width: 1200px;
height: 777px;
background: url('https://pic.imgdb.cn/item/65a3e7c3871b83018a89b07f.jpg') no-repeat center/cover;
box-shadow: 3px 3px 20px #000;
overflow: hidden;
z-index: 1;
display: grid;
place-items: center;
position: relative;
}
#player {
position: absolute;
width: 300px;
height: 300px;
cursor: pointer;
filter: opacity(.75) hue-rotate(270deg);
background: url('https://638183.freep.cn/638183/t24/jpg/hofghl.jpg') repeat -300px 0 / cover;
mask: url('https://638183.freep.cn/638183/web/svg/heart.svg') no-repeat center/cover;
-webkit-mask: url('https://638183.freep.cn/638183/web/svg/heart.svg') no-repeat center/cover;
animation: rot 10s infinite linear var(--state), bgmov 8s infinite linear var(--state);
}
li-zi {
position: absolute;
width: 15px;
height: 15px;
border-radius: 50%;
background: snow;
opacity: .95;
animation: moving var(--duration) var(--delay) linear infinite alternate var(--state);
}
@keyframes moving {
from { transform: translate(var(--x0),var(--y0)); opacity: 1; }
to { transform: translate(var(--x1),var(--y1)); opacity: .5; }
}
@keyframes rot { to { transform: rotate(1turn); } }
@keyframes bgmov { to { background-position: 0 0; } }
</style>
<div id="papa">
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=2060079395" autoplay loop></audio>
<div id="player"></div>
</div>
<script>
(function() {
let all = 60;
for(let i = 0; i < all; i++) {
let lz = document.createElement('li-zi');
let hudu = Math.PI / 180 * 360 / all * i;
let xx = 800 * Math.cos(hudu), yy = 600 * Math.sin(hudu);
lz.style.cssText += `
--x0: ${xx}px;
--y0: ${yy}px;
background: #${Math.random().toString(16).substr(-6)};
animation: moving ${Math.random() * 20 + 20}s -${Math.random() * 20}s infinite var(--state);
`;
papa.prepend(lz);
}
let mState = () => {
papa.style.setProperty('--state', aud.paused ? 'paused' : 'running');
};
aud.addEventListener('playing', mState, false);
aud.addEventListener('pause', mState, false);
player.onclick = () => aud.paused ? aud.play() : aud.pause();
})();
</script> @马黑黑
马师 晚上好,学生交作业哈~~{:4_190:} 你不要失望
荡气回肠是为了
最美的平凡~~ 朵拉 发表于 2024-1-14 21:58
@马黑黑
马师 晚上好,学生交作业哈~~
速度好快 朵宝的套用真快{:4_187:} 朵拉 发表于 2024-1-14 22:04
你不要失望
荡气回肠是为了
最美的平凡~~
原来是为了最美的我{:4_172:} 平凡 发表于 2024-1-18 19:30
原来是为了最美的我
是哒,为了最美的平凡{:4_187:}
页:
[1]