|
|

楼主 |
发表于 2025-6-2 18:01
|
显示全部楼层
帖子代码
- <style>
- #tz { margin: 30px 0; left: calc(50% - 81px); transform: translateX(-50%); width: clamp(600px, 90vw, 1400px); min-height: 80vh; aspect-ratio: 16/9; background: #eee url('https://638183.freep.cn/638183/t24/webp3/echo.webp') no-repeat center/cover; box-shadow: 2px 2px 8px #000; display: grid; place-items: center; z-index: 1; position: relative; }
- #player { position: absolute; width: 15vw; height: auto; aspect-ratio: 1/1; cursor: pointer; background: none; border-radius: 50%; transform: translateX(-20px); }
- #btnFs { bottom: 20px; color: #eee; text-align: center; }
- #btnFs:hover { color: red; }
- #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=29753363" autoplay loop></audio>
- <video id="vid" src="https://bpic.588ku.com/video_listen/588ku_video/22/11/03/19/50/54/video6363ab1e86aba.mp4" autoplay loop muted></video>
- <div id="player" title="播放/暂停"></div>
- </div>
- <script type="module">
- import * as THREE from 'https://unpkg.ihwx.cn/three@0.176.0/build/three.module.js';
- import { FS } from 'https://638183.freep.cn/638183/web/ku/FS.js';
- const scene = new THREE.Scene();
- const clock = new THREE.Clock();
- const camera = new THREE.PerspectiveCamera(60, tz.offsetWidth / tz.offsetHeight, 1, 1000);
- camera.position.set(0, 0, 5);
- const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
- renderer.setSize(tz.offsetWidth, tz.offsetHeight);
- tz.appendChild(renderer.domElement);
- const circle = new THREE.Mesh(
- new THREE.CircleGeometry(1,3),
- new THREE.MeshNormalMaterial({ side: THREE.DoubleSide })
- );
- const mesh = new THREE.Mesh(
- new THREE.CylinderGeometry(1, 1, 0.5, 128, 1),
- new THREE.MeshNormalMaterial({ wireframe: true })
- );
- mesh.add(circle);
- mesh.position.set(-0.15, 0, 0);
- scene.add(mesh);
- let data = 150, lastUpdateTime = 0;
- const interval = setInterval(() => data = aud.paused ? 150 : 200 - Math.floor(Math.random() * 100) ,150);
- const animate = (currentTime) => {
- const delta = clock.getDelta();
- mesh.rotation.x = data / 150;
- mesh.rotation.y -= delta / 5;
- renderer.render(scene, camera);
- requestAnimationFrame(animate);
- };
- aud.onplaying = aud.onpause = () => aud.paused ? clock.stop() : clock.start();
- animate();
- FS(tz, player);
- </script>
复制代码
|
评分
-
| 参与人数 2 | 威望 +80 |
金钱 +160 |
经验 +80 |
收起
理由
|
花飞飞
| + 30 |
+ 60 |
+ 30 |
很给力! |
红影
| + 50 |
+ 100 |
+ 50 |
赞一个! |
查看全部评分
|