朵拉 发表于 2024-4-15 23:22

Ke Cap Gap Ba Gia(马黑黑原创)

本帖最后由 朵拉 于 2024-4-15 23:50 编辑 <br /><br /><style>
    #papa { margin: 0 0 0 calc(50% - 581px); width: 1000px; height: 666px; background: url('https://pic.imgdb.cn/item/661d4bbf0ea9cb1403e0597d.webp') no-repeat center/cover; z-index: 1; position: relative; }
    #play { position: absolute; width: 100px; left: calc(50% - 50px); top: 20px; opacity: .7; cursor: pointer; animation: rot 5s linear infinite var(--state); }
    @keyframes rot { to { transform: rotate(360deg); } }
</style>

<div id="papa">
    <audio id="aud" src="https://music.163.com/song/media/outer/url?id=1473560238" loop autoplay></audio>
    <img id="play" src="https://638183.freep.cn/638183/small/ujye.webp" alt="" />
</div>

<script>
var sF = document.createElement('script');
sF.charset = 'utf-8';
sF.src = 'https://638183.freep.cn/638183/web/js/ball-lz.js';
document.body.appendChild(sF);

var lz = {papa: '#papa', total: 30, maxsize: 25, move: false};

var mState = () => {
    lz.move = !aud.paused;
    papa.style.setProperty('--state', ['paused','running'][+lz.move]);
}


play.onclick = () => {
    aud.paused ? aud.play() : aud.pause();
    mState();
}

window.onload = () => mState();

</script>

朵拉 发表于 2024-4-15 23:51

@马黑黑
老师好,学生交作业,请指正哈{:4_190:}

愤怒的葡萄 发表于 2024-4-16 07:21

挺漂亮的。

红影 发表于 2024-4-16 15:42

漂亮的制作。音乐很好听。欣赏朵宝好帖{:4_187:}

马黑黑 发表于 2024-4-16 23:26

{:4_199:}
页: [1]
查看完整版本: Ke Cap Gap Ba Gia(马黑黑原创)