|
|

楼主 |
发表于 2024-2-1 17:05
|
显示全部楼层
代码
- <style>
- #papa {
- margin: 0 0 0 calc(50% - 591px);
- width: 1024px;
- height: 640px;
- border-radius: 8px 32px;
- background:
- url('https://638183.freep.cn/638183/t24/jpg/blacktea.jpg') no-repeat center/cover,
- url('https://638183.freep.cn/638183/small/tea.png') no-repeat 380px 120px,
- url('https://638183.freep.cn/638183/small/tea.png') no-repeat 400px 20px;
- background-blend-mode: lighten, soft-light;
- box-shadow: 3px 3px 20px #000;
- position: relative;
- z-index: 1;
- }
- #player {
- position: absolute;
- bottom: 30px;
- right: 30px;
- width: 140px;
- height: 140px;
- border: 5px solid tan;
- border-radius: 50%;
- object-fit: cover;
- background:
- repeating-linear-gradient(45deg, tan 1px, transparent 3px, tan 5px),
- repeating-linear-gradient(-45deg, tan 1px, transparent 3px, tan 5px);
- box-shadow: 0 0 20px rgba(250,250,250,.4);
- cursor: pointer;
- animation: rot 6s 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=1913531843" autoplay loop></audio>
- <img id="player" src="https://638183.freep.cn/638183/small/tea.png" alt="" />
- <img src="https://638183.freep.cn/638183/small/yuxi.png" alt="" style="position: absolute; top: 110px; right: 300px; transform: rotate(20deg); filter: opacity(.6);" />
- </div>
- <script>
- var mState = () => papa.style.setProperty('--state', aud.paused ? 'paused' : 'running');
- aud.addEventListener('pause', mState, false);
- aud.addEventListener('playing', mState, false);
- player.onclick = () => aud.paused ? aud.play() : aud.pause();
- </script>
复制代码
|
评分
-
查看全部评分
|