|
|

楼主 |
发表于 2025-5-17 09:44
|
显示全部楼层
帖子代码
- <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/e.webp') no-repeat center/cover; box-shadow: 2px 2px 8px #000; display: grid; place-items: center; pointer-events: none; z-index: 1; position: relative; }
- #tz::after { position: absolute; content: ''; width: 200px; height: 200px; cursor: pointer; pointer-events: auto; }
- #btnFs { bottom: 20px; color: #eee; text-align: center; pointer-events: auto; }
- #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); }
- </style>
- <div id="tz" title="播放/暂停">
- <!-- Shining Echoes -->
- <audio id="aud" src="https://music.163.com/song/media/outer/url?id=26196237" autoplay loop></audio>
- <video id="vid" src="https://bpic.588ku.com/video_listen/588ku_video/23/09/25/19/38/24/video6511713048374.mp4" autoplay loop muted></video>
- </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(45, 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.SphereGeometry();
- const texture = new THREE.TextureLoader().load('https://638183.freep.cn/638183/Pic/2022/jzlcover.jpg');
- const material = new THREE.MeshBasicMaterial({ color: 0x00ffff, map: texture, transparent: true, opacity: 0.7, side: THREE.DoubleSide });
- const ball = new THREE.Mesh(geometry, material);
- scene.add(ball);
- scene.add(ball);
- const animate = () => {
- requestAnimationFrame(animate);
- const delta = clock.getDelta();
- ball.rotation.x += delta / 5;
- ball.rotation.y += delta / 5;
- renderer.render(scene, camera);
- };
- tz.onclick = (e) => {
- if (e.target.id !== 'tz') return;
- aud.paused ? aud.play() : aud.pause();
- aud.paused ? (vid.pause(), clock.stop()) : (vid.play(), clock.start());
- }
- window.onresize = () => {
- camera.aspect = tz.offsetWidth / tz.offsetHeight;
- camera.updateProjectionMatrix();
- renderer.setSize(tz.offsetWidth, tz.offsetHeight);
- }
- animate();
- FS(tz);
- </script>
复制代码
|
评分
-
| 参与人数 3 | 威望 +130 |
金钱 +260 |
经验 +130 |
收起
理由
|
小辣椒
| + 50 |
+ 100 |
+ 50 |
赞一个! |
花飞飞
| + 30 |
+ 60 |
+ 30 |
很给力! |
红影
| + 50 |
+ 100 |
+ 50 |
赞一个! |
查看全部评分
|