又见老情人--TO:大猫咪 千羽 来看你
本帖最后由 冬天的雨 于 2022-11-5 15:15 编辑 <br /><br /><style>#papa { left: -342px; width: 1280px; height: 650px; top:120px; background: url('https://pic1.imgdb.cn/item/63660b3916f2c2beb178cca4.jpg') no-repeat center/cover; box-shadow: 3px 3px 20px #000; display: grid; place-items: center; user-select: none; position: relative; z-index: 1; }
#mplayer { position: absolute; bottom: 50px; left: 1000px; }
#btnwrap { display: block; fill: hsla(30, 20%, 80%, .9); cursor: pointer; }
#btnwrap:hover { fill: hsla(90, 100%, 100%, .9); }
#tmsg { fill: hsla(30, 100%, 90%, .9); stroke: none; font: bold 1em sans-serif; }
#lrc { --motion: cover1; --tt: 5s; --state: paused; position: absolute; top: 120px; left: 230px; font: bold 2.4em sans-serif; color: hsl(240,50%,90%); -webkit-background-clip: text; filter: drop-shadow(1px 1px 1px hsla(30,10%,10%,.95)); }
#lrc::before { position: absolute; content: attr(data-lrc); width: 20%; height: 100%; color: transparent; overflow: hidden; white-space: nowrap; background: linear-gradient(180deg,hsla(120,90%,50%,.45),hsla(120,90%,60%,.75)); filter: inherit; -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards; animation-play-state: var(--state); }
.mpic { position: absolute; width:300px; height: 358px; background: url('https://pic1.imgdb.cn/item/63660bae16f2c2beb17c434d.png') no-repeat center/cover; mix-blend-mode: screen; border-radius: 50%; opacity: .7; animation: rot linear 80s infinite alternate; }
@keyframes cover1 { from { width: 0; } to { width: 100%; } }
@keyframes cover2 { from { width: 0; } to { width: 100%; } }
@keyframes rot { to { transform: rotate(1turn); opacity: 1; } }
</style>
<div id="papa">
<span class="mpic"></span><span class="mpic mp1"></span><span class="mpic mp2"></span>
<div id="lrc" data-lrc="花潮论坛lrc在线">花潮论坛lrc在线</div>
<svg id="mplayer" width="120" height="120">
<g id="mama" transform="rotate(-90, 60, 60)" style="cursor: pointer;">
<circle id="track" cx="60" cy="60" r="50" fill="none" stroke-width="10" stroke="hsla(240, 20%, 80%, .9)" />
<circle id="prog" cx="60" cy="60" r="50" fill="none" stroke-width="10" stroke="hsla(240,50%,60%,.75)" />
</g>
<g id="btnwrap">
<path id="btnplay" d="M 50 50,50 70,70, 60 z"></path>
<path id="btnpause" d="M 52 50,52 70,57 70,57 50,52 50 z M 60 50,60 70,65 70,65 50,60 50 z" style="display: none;"></path>
<path d="M 57 50,60 50,60 70,57 70 z" fill="transparent" />
</g>
<path id="curPath" d="M 20 70 Q 60 0 100 70" fill="none" stroke="none"/>
<path id="durPath" d="M 20 55 Q 60 110 100 55" fill="none" stroke="none"/>
<g id="tmsg">
<text x="34" y="0"><textPath id="curMsg" xlink:href="#curPath" dominant-baseline="text-after-edge">00:00</textPath></text>
<text x="29" y="0"><textPath id="durMsg" xlink:href="#durPath" dominant-baseline="text-before-edge">00:00</textPath></text>
</g>
</svg>
</div>
<audio id="aud" src="https://wj.zp68.com/lxx/yy/yjhqr.mp3" loop autoplay></audio>
<script>
(function() {
let mKey = 0, mSeek = false, mFlag = true;
let lrcAr = [
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
];
let cc = { x: 1*track.getAttribute('cx'), y: 1*track.getAttribute('cy'), len: track.getTotalLength(),};
prog.style.strokeDasharray = prog.style.strokeDashoffset =cc.len;
btnwrap.onclick = () => aud.paused ? aud.play() : aud.pause();
mama.onclick = (e) => {let deg = Math.atan2(e.offsetY - cc.y, e.offsetX - cc.x) * 180 / Math.PI;deg += (e.offsetX < cc.x && e.offsetY < cc.y) ? 450 : 90;aud.currentTime = aud.duration * deg / 360;};
aud.addEventListener('pause', () => mState());
aud.addEventListener('play', () => mState());
aud.addEventListener('seeked', () => calcKey());
aud.addEventListener('timeupdate', () => {prog.style.strokeDashoffset = cc.len - cc.len * aud.currentTime / aud.duration;curMsg.textContent = toMin(aud.currentTime);durMsg.textContent = 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.display = 'block', btnpause.style.display = 'none', lrc.style.setProperty('--state', 'paused')) : (btnplay.style.display = 'none', btnpause.style.display = 'block', 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><br><br><br><br><br> 发帖都忘记了{:4_203:}
发了几篇的 @来看你
水哥~发现你比我都来的少,呼叫呼叫{:4_170:} @千羽
最美的小仙女,送给你们的歌曲必须是最好听的,小千羽,仔细听听然后告诉我好听不{:4_170:} @大猫咪
猫咪是最通情达理,善解人意的小仙女,你们都仔细听听这首情歌,应该感受到冬雨对你们的关心和爱。。。。{:4_182:} 最后谢谢小辣椒的耐心指导{:4_170:} 任务完成,为自己鼓掌{:4_199:} 最应该谢的人忘记了,{:4_203:}
谢谢马老师的源码,冬雨学习做一次{:4_176:} 顺便告诉小辣椒,歌曲是你的,俺借用一下{:4_197:}{:4_185:} 仙女还没来呢,这么着急,小心着凉啊{:4_189:} 三个小仙女收礼开心{:4_204:} 冬天的雨 发表于 2022-11-5 15:15
发帖都忘记了
发了几篇的
以后多来就不会忘记发帖了 冬天的雨 发表于 2022-11-5 15:18
@千羽
最美的小仙女,送给你们的歌曲必须是最好听的,小千羽,仔细听听然后告诉我好听不
哈哈,昨天千羽让我转问你好的{:4_189:} 冬天的雨 发表于 2022-11-5 15:20
@大猫咪
猫咪是最通情达理,善解人意的小仙女,你们都仔细听听这首情歌,应该感受到冬雨对你们的关心和 ...
猫猫最近一直很忙,要忙完会上来 冬天的雨 发表于 2022-11-5 15:22
最后谢谢小辣椒的耐心指导
客气了,你无师自通{:4_170:} 冬天的雨 发表于 2022-11-5 15:23
任务完成,为自己鼓掌
掌声送给你{:4_199:} 冬天的雨 发表于 2022-11-5 15:28
最应该谢的人忘记了,
谢谢马老师的源码,冬雨学习做一次
马老师每天一个更新,你得加油{:4_189:} 冬天的雨 发表于 2022-11-5 15:30
顺便告诉小辣椒,歌曲是你的,俺借用一下
好的,还个礼物就可以了{:4_170:} 绿叶清舟 发表于 2022-11-5 18:43
仙女还没来呢,这么着急,小心着凉啊
小仙女估计已经忘记他了,冬雨都这么久没有来的 小仙女们收礼开心{:4_204:}