|
|
加林森 发表于 2022-5-6 11:38
.outer { left: -214px; width: 1024px; height: 682px; background: linear-gradient(45deg, red, gre ...
试试这样行吗。。
<style>
.outer { left: -214px; width: 1024px; height: 682px; background: linear-gradient(45deg, red, green), url('https://pic.imgdb.cn/item/62739cc00947543129bfc2f0.jpg') no-repeat center/cover; background-blend-mode: overlay, normal; filter: drop-shadow(0 0 10px gray); opacity: .95; position: relative; }
.outer h2 { margin: 0; position: absolute; left: 80%; top: 10px; font: bold 1.5em sans-serif; color: teal; text-shadow: 1px 1px 2px #222; }
.spic { position: absolute; width: 300px; height: 300px; LEFT: 150px; top: 250px; mix-blend-mode: multiply; }
.r-small { position: absolute; width: 100px; height: 100px; border-radius: 50%; top: calc(100% - 120px); left: calc(100% - 120px); cursor: pointer; text-align: center; animation: rot 6s linear infinite; }
@keyframes rot { to { transform: rotate(1turn); } }
</style>
<div class="outer">
<h2>幸福的团聚(藏语版)</h2>
<img class="spic" src="https://pic.imgdb.cn/item/6235d74f5baa1a80ab9d74a0.gif" alt="" />
<div class="outer r-small"></div>
</div>
<script>
let flag = true;
let ele = document.querySelector('.r-small');
let au = document.createElement('audio');
au.src = 'http://www.kumeiwp.com/sub/filestores/2021/11/07/a31196490a601501cfb66f3235d54b1f.mp3';
au.loop = true;
au.autoplay = flag;
au.style.display = 'none';
ele.appendChild(au);
if(!flag) ele.style.animationPlayState = 'paused';
ele.onclick = function() { flag ? (au.pause(), this.style.animationPlayState = 'paused', flag = false) : (au.play(), this.style.animationPlayState = 'running', flag = true); }
</script> |
|