|
|

楼主 |
发表于 2025-5-18 19:52
|
显示全部楼层
帖子代码
- <style>
- #tz { --state: running; margin: 30px 0; left: calc(50% - 81px); transform: translateX(-50%); width: clamp(600px, 90vw, 1400px); min-height: 80vh; aspect-ratio: 16/9; background: url('https://638183.freep.cn/638183/t24/webp3/newbegin.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: 240px; height: 240px; cursor: pointer; background: none; }
- #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=449127" autoplay loop></audio>
- <video id="vid" src="https://bpic.588ku.com/video_listen/588ku_video/25/03/14/23/16/59/video67d4486b30cdd.mp4" autoplay loop muted></video>
- <div id="player" title="播放/暂停"></div>
- </div>
- <script type="module">
- import * as THREE from 'https://638183.freep.cn/638183/web/ku/three.module.min.js';
- import { FS } from 'https://638183.freep.cn/638183/web/ku/fscreen.js';
- const scene = new THREE.Scene;
- const camera = new THREE.PerspectiveCamera(75, tz.offsetWidth / tz.offsetHeight, 0.1, 1000);
- camera.position.set(0, 0, 8);
- const clock = new THREE.Clock();
- const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
- renderer.setSize(tz.offsetWidth, tz.offsetHeight);
- tz.appendChild(renderer.domElement);
- const geometry = new THREE.TorusKnotGeometry();
- const material = new THREE.MeshBasicMaterial({ wireframe: true });
- const torusknot = new THREE.Mesh(geometry, material);
- scene.add(torusknot);
- const animate = () => {
- requestAnimationFrame(animate);
- const delta = clock.getDelta();
- torusknot.rotation.x += delta;
- torusknot.rotation.y -= delta;
- renderer.render(scene, camera);
- };
- tz.onclick = (e) => {
- if (e.target.id !== 'player') return;
- aud.paused ? clock.stop() : clock.start();
- }
- window.onresize = () => {
- camera.aspect = tz.offsetWidth / tz.offsetHeight;
- camera.updateProjectionMatrix();
- renderer.setSize(tz.offsetWidth, tz.offsetHeight);
- }
- animate();
- FS(tz, player);
- </script>
复制代码
|
评分
-
| 参与人数 3 | 威望 +130 |
金钱 +260 |
经验 +130 |
收起
理由
|
小辣椒
| + 50 |
+ 100 |
+ 50 |
赞一个! |
花飞飞
| + 30 |
+ 60 |
+ 30 |
很给力! |
红影
| + 50 |
+ 100 |
+ 50 |
赞一个! |
查看全部评分
|