请马上登录,朋友们都在花潮里等着你哦:)
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 马黑黑 于 2025-9-1 20:59 编辑
<style>
@import 'https://638183.freep.cn/638183/web/css/tz01.css';
#pa { --offsetX: 0px; --bg: url('https://638183.freep.cn/638183/t24/w5/ground.webp') no-repeat center/cover; --ma-size: 20%; }
#ma { background: url('https://638183.freep.cn/638183/web/svg/sunfl-2.svg') no-repeat center/cover; }
#btnFs { right: 30px; bottom: 30px; color: lightblue; border-color: currentColor!important; }
#svg use { opacity: 1; animation: flash linear 1s var(--delay) infinite alternate var(--state); }
@keyframes flash { to { opacity: 0.5; } }
</style>
<div id="pa">
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=33469659" autoplay loop></audio>
<video class="pd-vid" src="https://img.tukuppt.com/video_show/2629112/00/02/03/5b4f3c0b41744.mp4" autoplay loop muted></video>
<div id="ma" class="brightness"></div>
<svg id="svg" width="100%" height="100%" viewBox="0 00 1600 900">
<defs>
<g id="svgShape" fill="white">
<circle cx="0" cy="0" r="10" stroke-width="0" />
<path d="M0 0 H0 20" stroke-width="3" />
</g>
<path id="motionPath" d="M0 900 Q1500 640,1600 0" />
</defs>
</svg>
</div>
<script type="module">
import { FS } from 'https://638183.freep.cn/638183/web/js/fullscreen.js';
FS(pa,ma);
const createSvgElement = (element, attributes) => {
const elm = document.createElementNS('http://www.w3.org/2000/svg', element);
attributes.forEach(item => elm.setAttribute(item[0],item[1]));
return elm;
};
const total = 20, fragment = document.createDocumentFragment();
Array.from({length: total}).forEach((_,key) => {
const size = (Math.random() + 0.8).toFixed(2);
const color = '#' + Math.random().toString(16).substring(2,8);
const use = createSvgElement('use', [
['href', '#svgShape'],
['x', 0],
['y', Math.random() * 200 - 150],
['style', `--delay: ${Math.random() * -4}s; transform: scale(${size}); fill: ${color}; stroke: ${color};`]
]);
const motion = createSvgElement('animateMotion', [
['dur', Math.random() * 10 + 10],
['begin', Math.random() - 20],
['repeatCount', 'indefinite'],
['rotate', 'auto']
]);
const mpath = createSvgElement('mpath',[
['href', '#motionPath']
]);
motion.appendChild(mpath);
use.appendChild(motion);
fragment.appendChild(use);
});
svg.appendChild(fragment);
aud.onplaying = aud.onpause = () => aud.paused ? svg.pauseAnimations() : svg.unpauseAnimations();
</script>
|