|
|

楼主 |
发表于 2025-7-13 12:50
|
显示全部楼层
帖子代码:
- <style>
- #papa { margin: 30px 0; left: calc(50% - 81px); transform: translateX(-50%); width: clamp(600px, 90vw, 1400px); height: auto; aspect-ratio: 16/9; background: url('https://638183.freep.cn/638183/t24/6/matsuri.jpg') no-repeat center/cover; box-shadow: 2px 2px 8px #000; z-index: 1; overflow: hidden; display: grid; place-items: center; position: relative; --r: 2vw; --size: 10vw; }
- #btnFs { left: 15px; bottom: 20px; color: white; }
- #ball { position: absolute; width: var(--size); height: var(--size); background: url('https://638183.freep.cn/638183/t23/1/rabbit.gif') no-repeat center/cover; border-radius: 50%; filter: drop-shadow(10px 10px 40px #eee); cursor: pointer; display: grid; place-items: center; }
- #ball::before, #ball::after { position: absolute; content: ''; width: 120%; height: 120%; background: linear-gradient(35deg, skyblue, lightgreen); border-radius: 100% 50%; transition: 1s; transform-origin: 50% 97%; }
- #ball::before { clip-path: inset(0 50% 0 0); transform: rotate(var(--a1)); z-index: 90; }
- #ball::after { clip-path: inset(0 0 0 50%); transform: translate(-1px) rotate(var(--a2)); }
- #lzwrap { position: absolute; display: grid; place-items: center; }
- li-zi { position: absolute; width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(35deg, var(--c1), var(--c2)); transform: rotate(var(--deg)) translate(var(--r)); transition: 0.65s; }
- #vid {position: absolute; width: 100%; height: 100%; object-fit: cover; mask: radial-gradient(transparent 20%, red); -webkit-mask: radial-gradient(transparent 20%, red); opacity: .35; pointer-events: none; }
- .run { animation: run 12s linear infinite; }
- @keyframes run { to { transform: rotate(360deg); } }
- </style>
- <div id="papa">
- <audio id="aud" src="https://music.163.com/song/media/outer/url?id=1066047" autoplay loop></audio>
- <video id="vid" src="https://bpic.588ku.com/video_listen/588ku_video/24/10/07/13/54/42/video670377a269c9e.mp4" autoplay loop muted></video>
- <div id="ball">
- <div id="lzwrap"></div>
- </div>
- </div>
- <script type="module">
- import { FS } from 'https://638183.freep.cn/638183/web/js/fullscreen.js';
- var total = 12;
- Array.from({ length: total }).forEach( (lz, idx) => {
- lz = document.createElement('li-zi');
- lz.style.cssText += `
- --c1: #${Math.random().toString(16).substring(2, 8)};
- --c2: #${Math.random().toString(16).substring(2, 8)};
- --deg: ${-idx * 360 / total}deg;
- `;
- lzwrap.appendChild(lz);
- });
- var init = () => {
- var r = 15 * papa.clientWidth / 1400,
- s = 10 * papa.clientWidth / 1400;
- papa.style.cssText += `
- --size: ${s}vw;
- --r: ${aud.paused ? 0 : r}vw;
- --a1: ${aud.paused ? 0 : -60}deg;
- --a2: ${aud.paused ? 0 : 60}deg;
- `;
- };
- var animate = () => aud.paused ? lzwrap.classList.remove('run') : lzwrap.classList.add('run');
- aud.onplaying = aud.onpause = () => {
- init();
- animate();
- };
- window.onresize = () => init();
- FS(papa, ball);
- </script>
复制代码
|
评分
-
| 参与人数 1 | 威望 +50 |
金钱 +100 |
经验 +50 |
收起
理由
|
红影
| + 50 |
+ 100 |
+ 50 |
赞一个! |
查看全部评分
|