本帖最后由 花简静 于 2025-8-15 10:39 编辑
<style>
#tz {margin: 30px 0; left: calc(50% - 101px); transform: translateX(-50%); width: clamp(600px, 90vw, 1700px); height: auto; aspect-ratio: 17/9; background: url('https://642303.freep.cn/642303/tu/20250628fqysr.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; opacity: .11;}
</style>
<div id="tz">
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=1925926337" 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.015, color: 0x4ea192 });
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>
|