|
|

楼主 |
发表于 2025-6-26 13:07
|
显示全部楼层
帖子代码
- <style>
- #tz {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/w4/jg.webp') no-repeat center/cover; box-shadow: 2px 2px 8px #000; display: grid; place-items: center; z-index: 1; position: relative; }
- #btnFs { bottom: 30px; color: #eee; }
- #player { position: absolute; left: -1000px; }
- #vid {position: absolute; width: 100%; height: 100%; object-fit: cover; mask: radial-gradient(transparent 20%, red); -webkit-mask: radial-gradient(transparent 20%, red); pointer-events: none; }
- </style>
- <div id="tz">
- <audio id="aud" src="https://music.163.com/song/media/outer/url?id=1313052443" autoplay loop></audio>
- <video id="vid" src="https://bpic.588ku.com/video_listen/588ku_video/22/11/03/14/51/00/video636364d43e50d.mp4" autoplay loop muted></video>
- <div id="player"></div>
- </div>
- <script type="module">
- import { THREE, scene, camera, renderer, clock, basic3, click3 } from 'https://638183.freep.cn/638183/3dev/3/3basic.js';
- import { FS } from 'https://638183.freep.cn/638183/web/ku/FS.js';
- basic3(tz);
- const sphereGeometry = new THREE.SphereGeometry();
- const pointsMaterial = new THREE.PointsMaterial({ size: 0.05, color: 0x90ee90 });
- const points = new THREE.Points(sphereGeometry, pointsMaterial);
- points.rotateX(Math.PI / 5);
- scene.add(points);
- let angle = 0;
- const animate = () => {
- const delta = clock.getDelta();
- angle += delta * 10;
- const scale = 1.6 - Math.sin(angle * Math.PI / 180);
- points.scale.set(scale, scale / 1.5, scale);
- points.rotation.y += delta;
- renderer.render(scene, camera);
- requestAnimationFrame(animate);
- };
- tz.onclick = (e) => { if (click3(points, e)) player.click() };
- tz.onmousemove = (e) => {
- tz.title = click3(points, e) ? '播放/暂停(Alt+X)' : '';
- tz.style.cursor = click3(points, e) ? 'pointer' : 'default';
- };
- aud.onplaying = aud.onpause = () => aud.paused ? clock.stop() : clock.start();
- animate();
- FS(tz, player);
- </script>
复制代码
|
评分
-
| 参与人数 2 | 威望 +70 |
金钱 +140 |
经验 +70 |
收起
理由
|
泡沫
| + 20 |
+ 40 |
+ 20 |
很给力! |
红影
| + 50 |
+ 100 |
+ 50 |
赞一个! |
查看全部评分
|