|
<style>
@import 'https://638183.freep.cn/638183/web/css/tz01.css';
#pa { --offsetX: 81px; --bg: url('https://638183.freep.cn/638183/t24/w5/g5.webp') no-repeat center/cover; --bg1: lightblue; --state: runnig; transition: 0.5s; --ma-size: 15%; --per: -2%; --a: 45deg; }
#pa::before { content: ''; position: absolute; inset: 0; background: var(--bg1); mask: linear-gradient(var(--a), red var(--per), transparent calc(var(--per) + 2%), transparent); }
#ma { left: 30px; top: 30px; background: url('https://638183.freep.cn/638183/small/2025/moon.webp') no-repeat center/cover; animation-duration: 12s; }
#btnFs { right: 20px; bottom: 20px; }
</style>
<div id="pa">
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=29386019" autoplay loop></audio>
<video class="qk-vid" src="https://bpic.588ku.com/video_listen/588ku_video/22/11/05/06/16/11/video63658f2b9a7f2.mp4" autoplay loop muted></video>
<div id="ma" class="sepia"></div>
</div>
<script type="module">
import { FS } from 'https://638183.freep.cn/638183/web/js/fullscreen.js';
FS(pa, ma);
var per = -2, step = 0.5, aniCounter = 0, raf;
var pics = [
'https://638183.freep.cn/638183/t24/w5/g1.webp',
'https://638183.freep.cn/638183/t24/w5/g2.webp',
'https://638183.freep.cn/638183/t24/w5/g3.webp',
'https://638183.freep.cn/638183/t24/w5/g4.webp',
'https://638183.freep.cn/638183/t24/w5/g5.webp'
];
ma.onanimationiteration = () => {
var angle = aniCounter % 4, picIdx = aniCounter % pics.length;
pa.style.setProperty('--a', `${45 + (angle * 90)}deg`);
pa.style.setProperty('--bg1', `url(${pics[picIdx]}) no-repeat center/cover`);
picIdx = (picIdx + 1) % pics.length;
aniCounter ++;
changePic();
};
ma.onmouseenter = () => pa.classList.add('grayscale');
ma.onmouseout = () => pa.classList.remove('grayscale');
function changePic() {
if (per > 100) {
cancelAnimationFrame(raf);
per = -2;
var picIdx = aniCounter % pics.length;
picIdx = picIdx > 0 ? picIdx - 1: pics.length - 1;
pa.style.setProperty('--bg', `url(${pics[picIdx]}) no-repeat center/cover`);
} else {
per += step;
pa.style.setProperty('--per', per + '%');
raf = requestAnimationFrame(changePic);
}
}
</script>
|