爱已结束 - 梦然 (Miya)
<style>
#papa {
margin: 150px 0 0 calc(50% - 781px);
width: 1400px;
height: 750px;
background: gray url('https://xlaj.cn/assets/file/zp/20230720003947.gif') no-repeat center/cover;
display: grid;
place-items: center;
box-shadow: 3px 3px 20px #000;
user-select: none;
overflow: hidden;
perspective: 1000px;
position: relative;
z-index: 1;
}
#mplayer {
position: absolute;
bottom: 30px; left: 500px;
grid-template-columns: auto auto auto;
gap: 6px;
display: grid;
place-items: center;
font: normal 16px sans-serif;
color: snow;
z-index: 999;
}
#btnplay {
margin-right: -4px;
width: 40px;
height: 40px;
font: bold 40px/40px serif;
text-align: center;
cursor: pointer;
animation: rot 4s infinite linear;
animation-play-state: var(--state);
--state: paused;
}
#prog {
width: 200px;
height: 25px;
cursor: pointer;
}
#lrc {
--state: running;
--motion: cover2;
--tt: 1s;
position: absolute;
left: 280px;
top: 80px;
font: bold 2.4em sans-serif;
color: hsl(240, 50%, 90%);
-webkit-background-clip: text;
filter: drop-shadow(1px 1px 2px hsla(30, 10%, 10%, .95));
z-index: 1000;
}
#lrc::before {
position: absolute;
content: attr(data-lrc);
width: 20%;
height: 100%;
color: transparent;
overflow: hidden;
white-space: nowrap;
background: linear-gradient(180deg, hsla(240, 60%, 50%, .45), hsla(240, 100%, 60%, .75));
filter: inherit;
-webkit-background-clip: text;
animation: var(--motion) var(--tt) linear forwards;
animation-play-state: var(--state);
}
.star {
--rr: 300px;
position: absolute;
width: 4px;
height: 4px;
border-radius: 50% 50% 25% 50%;
transform-origin: 50% 50%;
transform-style: preserve-3d;
opacity: .60;
}
@keyframes cover1 { from { width: 0; } to { width: 100%; } }
@keyframes cover2 { from { width: 0; } to { width: 100%; } }
@keyframes rot { to { transform: rotate(1turn); } }
@keyframes fly { to { transform: rotate(0) translate(0); } }
</style>
<div id="papa">
<div id="lrc" data-lrc="HCPlayer">HCPlayer</div>
<div id="mplayer">
<span id="btnplay">☀</span>
<meter id="prog" low="30" high="90" max="100" optimum="100" value="1"></meter>
<span id="tmsg">00:00 | 00:00</span>
</div>
</div>
<audio id="aud" src="https://xlaj.cn/assets/file/zp/20230702141446.mp3" loop autoplay></audio>
<script>
(function() {
let mKey = 0, mSeek = false, mFlag = true;
let lrcAr = [
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
];
(function() {
Array.from({length: 120}).forEach((item,key) => {
item = document.createElement('span');
item.className = 'star';
let ww = Math.ceil(Math.random() * 20) | 10;
item.style.cssText += `
width: ${ww}px;
height: ${ww}px;
left: ${Math.random()*10 + 200}px;
top: ${Math.random()*0 + 150}px;
background: hsla(${360*Math.random()},100%,50%,.75);
transform: rotate(${Math.random() * 720}deg) translate3d(${Math.random() * 500}px,${Math.random() * 300}px,${Math.random() * 1000}px);
animation: fly 80s infinite ${-10 - Math.random() * 20}s linear;
`;
papa.appendChild(item);
});
})();
btnplay.onclick = () => aud.paused ? aud.play() : aud.pause();
prog.onclick = (e) => aud.currentTime = aud.duration * e.offsetX / prog.offsetWidth;
aud.addEventListener('pause', () => mState());
aud.addEventListener('play', () => mState());
aud.addEventListener('seeked', () => calcKey());
aud.addEventListener('timeupdate', () => {
prog.value = aud.currentTime / aud.duration * 100;
tmsg.innerText = `${toMin(aud.currentTime)} | ${toMin(aud.duration)}`;
for (j = 0; j < lrcAr.length; j++) {
if (aud.currentTime >= lrcAr) {
if (mKey === j) showLrc(lrcAr);
else continue;
}
}
});
let mState = () => aud.paused ? (btnplay.style.setProperty('--state', 'paused'), lrc.style.setProperty('--state', 'paused')) : (btnplay.style.setProperty('--state', 'running'), lrc.style.setProperty('--state', 'running'));
let showLrc = (time) => {let name = mFlag ? 'cover1' : 'cover2';lrc.innerHTML = lrc.dataset.lrc = lrcAr;lrc.style.setProperty('--motion', name);lrc.style.setProperty('--tt', time + 's');lrc.style.setProperty('--state', 'running');mKey += 1;mFlag = !mFlag;};
let calcKey = () => {for (j = 0; j < lrcAr.length; j++) {if (aud.currentTime <= lrcAr) {mKey = j - 1;break;}}if (mKey < 0) mKey = 0;if (mKey > lrcAr.length - 1) mKey = lrcAr.length - 1;let time = lrcAr - (aud.currentTime - lrcAr);showLrc(time);};
let toMin = (val) => {if (!val) return '00:00';val = Math.floor(val);let min = parseInt(val / 60),sec = parseFloat(val % 60);if (min < 10) min = '0' + min;if (sec < 10) sec = '0' + sec;return min + ':' + sec;};
})();
</script>
<br><br><br><br><br> 这个背景运用了光感效果,特别喜欢的 手机手动播放 沙发{:7_281:} 电脑也有自动播放的 注意身体,保护好自己的眼睛,健康永远是第一位和 撒哈拉的雨 发表于 2023-8-5 21:39
沙发
大哥晚上好
我觉得还是应该休息一段时间,待眼睛完全好了再回论坛,我真的有点担心 撒哈拉的雨 发表于 2023-8-5 21:44
电脑也有自动播放的
电脑是自动播放的,但有的人浏览器设置手动播放的,手机一般都是手动播放,我的手机浏览器我重新设置的,可以直接出来的
撒哈拉的雨 发表于 2023-8-5 21:46
注意身体,保护好自己的眼睛,健康永远是第一位和
好的,我现在玩少了一点。。。