|
|

楼主 |
发表于 2025-6-25 12:38
|
显示全部楼层
帖子代码
- <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/w4/starsky.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="papa">
- <audio id="aud" src="https://music.163.com/song/media/outer/url?id=1432855328" autoplay loop></audio>
- <video id="vid" src="https://bpic.588ku.com/video_listen/588ku_video/24/11/01/15/25/07/video672482533234e.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?v=1.0';
- import { FS } from 'https://638183.freep.cn/638183/web/ku/FS.js';
- basic3(papa, aud.paused);
- // 纹理
- const texture = new THREE.TextureLoader().load('https://638183.freep.cn/638183/small/texture/green.png');
- texture.colorSpace = THREE.SRGBColorSpace;
- texture.wrapS = THREE.RepeatWrapping;
- texture.wrapT = THREE.RepeatWrapping;
- texture.repeat.x = 10;
- texture.repeat.y = 1;
- //管道
- const group = new THREE.Group();
- const path = new THREE.QuadraticBezierCurve3(
- new THREE.Vector3( -1, 0, 0 ),
- new THREE.Vector3( -2.6, -1.2, 0 ),
- new THREE.Vector3( 1, 0, 0 )
- );
- const geometry = new THREE.TubeGeometry(path, 32, 0.05, 32, false);
- const material = new THREE.MeshBasicMaterial({ color: 0xefefee, map: texture });
- const tt = 9;
- for (let i = 0; i < tt; i ++) {
- const mesh = new THREE.Mesh(geometry, material);
- mesh.rotateY(THREE.MathUtils.degToRad(180 / tt * i));
- group.add(mesh);
- }
- group.position.set(0, -1.2, 0);
- group.rotateX(-0.15);
- scene.add(group);
- // 动画
- const animate = () => {
- requestAnimationFrame(animate);
- const delta = clock.getDelta();
- texture.offset.x += delta;
- renderer.render(scene, camera);
- };
- papa.onclick = (e) => {if (click3(group, e)) player.click()};
- papa.onmousemove = (e) => {
- papa.title = click3(group, e) ? '播放/暂停(Alt+X)' : '';
- papa.style.cursor = click3(group, e) ? 'pointer' : 'default';
- };
- aud.onplaying = aud.onpause = () => aud.paused ? clock.stop() : clock.start();
- animate();
- FS(papa, player);
- </script>
复制代码
|
评分
-
| 参与人数 1 | 威望 +50 |
金钱 +100 |
经验 +50 |
收起
理由
|
红影
| + 50 |
+ 100 |
+ 50 |
赞一个! |
查看全部评分
|