梁海洋 - 猴哥 (DJ版)
本帖最后由 岩新新 于 2023-6-28 12:18 编辑 <br /><br /><div class="t_fsz"><table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_1874596">
<style>
#papa {
--state: paused;
margin:80px 0 0 calc(50% - 593px);
width: 1024px;
height: 640px;
border: 2px solid tan;
border-image: linear-gradient(35deg,tan,purple,cyan,orange,red) 4;
background: #3C3A50 url('http://webftp.bbs.hnol.net/yx2021/pj67/003.gif') center/cover no-repeat;
box-shadow: 3px 8px 20px rgba(0,0,0,.6);
overflow: hidden;
display: grid;
place-items: center;
position: relative;
animation: hue 10s infinite alternate var(--state);
}
#vid {
position: absolute;
width: 1400px;
height: 100%;
border-radius: 2%;
opacity: .80;
object-fit: cover;
pointer-events: none;
}
#lrc {
position: absolute;
left: 50%;
bottom: 30px;
transform: translate(-50%);
height: 50px;
font: bold 30px/50px sans-serif;
background: transparent;
color: gray;
display: grid;
place-items: center start;
pointer-events: none;
--motion: cover2;
--tt: 1s;
}
#lrc::before,
#lrc::after {
position: absolute;
content: '';
}
#lrc::before {
content: attr(data-lrc);
width: 0%;
height: 100%;
color: CornflowerBlue;
white-space: pre;
overflow: hidden;
animation: var(--motion) var(--tt) linear forwards var(--state);
}
#lrc::after {
width: 100px;
height: 100px;
left: -100px;
border-radius: 50%;
background:center/cover no-repeat;
cursor: pointer;
pointer-events: auto;
animation: rot 4s infinite linear var(--state);
}
@keyframes cover1 {
to {
width: 100%;
}
}
@keyframes cover2 {
to {
width: 100%;
}
}
@keyframes rot {
to {
transform: rotate(360deg);
}
}
#wrap {
position: absolute;
left: 340px;
top: 360px;
width: 320px;
height: 200px;
display: grid;
place-items: center;
cursor: pointer;
animation: hue 10s infinite alternate var(--state);
}
#wrap > span {
position: absolute;
width: 10px;
height: 10px;
border-radius: 50%;
border: 8px dashed black;
transform: rotate(var(--deg));
animation: rot var(--time) infinite linear var(--state);
}
@keyframes rot {
from { transform: rotate(var(--deg)); }
to { transform: rotate(calc(var(--deg) + 360deg)); }
}
@keyframes hue {
to { filter: hue-rotate(360deg); }
}
</style>
<div id="papa"><video id="vid" src="" autoplay="http://webftp.bbs.hnol.net/yx2021/pj67/64f4d0a7d5b6ff58dcc81fde1876e4f0.gif" loop="" muted=""></video><div id="lrc" data-lrc="HCPlayer">HCPlayer</div>
<div id="wrap" title="播放/暂停"></div>
<audio id="aud" src="https://www.joy127.com/url/105636.mp3" loop="loop"autoplay="autoplay"></audio>
</div>
<script>
let total = 60, spans = [];
let mKey = 0, mFlag = true;
let lrcAr = [
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
];
let mState = () => papa.style.setProperty('--state', aud.paused ? 'paused' : 'running');
let showLrc = (time) => {let name = mFlag ? 'cover1' : 'cover2';lrc.innerHTML = lrcAr;lrc.dataset.lrc = lrcAr.replace(/<br>/, 'n');lrc.style.setProperty('--motion', name);lrc.style.setProperty('--tt', time + 's');papa.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);};
aud.addEventListener('timeupdate', () => {for(let j = 0; j < lrcAr.length; j ++) {if (aud.currentTime >= lrcAr) {if (mKey === j) showLrc(lrcAr);else continue;}}});
Array.from({length:10}).forEach((item,key) => {
let sp = document.createElement('span');
sp.style.cssText += `
--deg: ${Math.random()*(key+10)}deg;
--time: ${Math.random()*10+10}s;
width: ${key*18}px;
height: ${key*18}px;
border-color: hsla(${Math.ceil(Math.random()*360)},70%,50%,.75);
border-width: ${key+6}px;
`;
wrap.appendChild(sp);
});
aud.addEventListener('play', mState, false);
aud.addEventListener('pause', mState, false);
wrap.onclick = () => aud.paused ? aud.play() : aud.pause();
</script>
</td></tr></table>
这个播放器很漂亮,变色背景也很炫。只是图片看着好模糊啊{:4_173:} 红影 发表于 2023-6-28 10:39
这个播放器很漂亮,变色背景也很炫。只是图片看着好模糊啊
谢谢光临! 醉美水芙蓉 发表于 2023-6-28 11:45
欣赏老师佳作!
谢谢欣赏! 欣赏精彩佳作,谢谢分享,点赞!{:4_178:} 岩新新 发表于 2023-6-28 12:22
谢谢光临!
客气了,问好新新。晚上好。看到你换了背景呢,很赞{:4_187:}
页:
[1]