醉美水芙蓉 发表于 2022-10-8 22:17

做个神仙

本帖最后由 醉美水芙蓉 于 2022-10-8 22:20 编辑 <br /><br /><style>
#papa { left: -214px; width: 1024px; height: 640px; background: darkred url('https://s1.ax1x.com/2022/10/08/xGbzOe.jpg') no-repeat center/cover; display: grid; place-items: center; box-shadow: 3px 3px 20px #000; user-select: none; position: relative; z-index: 1;}
#papa::before { position: absolute; content: ''; top: 0; left: 0; bottom: 0; right: 0; background: url('http://tuku.link/imgs/2022/09/52b4b07ff00e29b1.jpg') no-repeat center/cover; opacity: .25; }
#mplayer { position: absolute; left: 60px; top: 70px; width: 120px; height: 120px; border-radius: 50%; overflow: hidden; z-index: 3; }
#track { stroke: url(#gradient); }
#tmsg { fill: hsl(100,80%,90%); font: normal 1em sans-serif; }
#btnwrap { display: block; fill: hsla(0,100%,100%,.7); cursor: pointer; }
#btnwrap:hover { fill: hsla(0,60%,60%,.8); }
#lrc { --motion: cover1; --tt: 5s; --state: running; position: absolute; top: 15px; left: 20px; font: bold 2.4em sans-serif; color: hsl(20,10%,80%); -webkit-background-clip: text; filter: drop-shadow(1px 1px 2px hsla(20,100%,0%,.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(0,60%,100%,.95),hsla(120,90%,50%,.75)); filter: inherit; -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards; animation-play-state: var(--state); }
.mpic { position: absolute; left: 40px; top: 165px; mix-blend-mode: multiply; transform-origin: top; animation: swing 2s infinite alternate; }
@keyframes cover1 { from { width: 0; } to { width: 100%; } }
@keyframes cover2 { from { width: 0; } to { width: 100%; } }
@keyframes swing { from { transform: rotate(-4deg); } to { transform: rotate(6deg); } }
</style>

<div id="papa">
        <img src="https://s1.ax1x.com/2022/10/08/xGHo5t.jpg" alt="" class="mpic" />
        <div id="lrc" data-lrc="花潮论坛lrc在线">花潮论坛lrc在线</div>
        <svg id="mplayer" width="120" height="120" shape-rendering="geometricPrecision">
                <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"/>
                        <circle id="prog" cx="60" cy="60" r="50" fill="none" stroke-width="2" stroke="hsla(0,0%,90%,0.45)" />
                </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>
                <g id="btnwrap">
                        <path id="btnplay" d="M 50 50,50 70,70 60 z"></path>
                        <path id="btnmid" d="M 55 50, 55 70, 60 70, 60 50, 55 50 z" fill="transparent"></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"></path>
                </g>
                <defs>
                        <linearGradient id="gradient" x1="0" y1="0" x2="1" y2="1">
                                <stop offset="0%" stop-color="orange" stop-opacity="0.8" />
                                <stop offset="35%" stop-color="green" stop-opacity="0.8" />
                                <stop offset="65%" stop-color="teal" stop-opacity="0.8" />
                                <stop offset="100%" stop-color="darkblue" stop-opacity="0.8" />
                        </linearGradient>
                </defs>
        </svg>
</div>

<script>
(function() {
        var mKey = 0, mSeek = false, mFlag = true, aud = new Audio(), cc = { x: 1*track.getAttribute('cx'), y: 1*track.getAttribute('cy'), len: track.getTotalLength(), };
        var lrcAr = [
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
       
];
        aud.src = 'https://www.qqmc.com/up/kwlink.php?id=93200081&.mp3';
        aud.autoplay = true;
        aud.loop = true;
        prog.style.strokeDasharray = prog.style.strokeDashoffset = cc.len;
        btnwrap.onclick = () => aud.paused ? aud.play() : aud.pause();
        mama.onclick = (e) => {var 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 + 'px';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;}}});
        var 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'));
        var showLrc = (time) => {var 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;};
        var 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;var time = lrcAr - (aud.currentTime - lrcAr);showLrc(time);};
        var toMin = (val)=> {if (!val) return '00:00';val = Math.floor(val);var min = parseInt(val / 60), sec = parseFloat(val % 60);if(min < 10) min = '0' + min;if(sec < 10) sec = '0' + sec;return min + ':' + sec;}
        mState();
})();
</script>

红影 发表于 2022-10-8 22:19

水芙蓉美女在下面挂了两条鱼,也挺有趣的呢。这孔雀舞真漂亮{:4_187:}

起个网名好难 发表于 2022-10-8 22:27

我是穷人,分不多请笑纳

马黑黑 发表于 2022-10-8 23:12

挂件与背景、播放器的配套很恰当。赞!

马黑黑 发表于 2022-10-8 23:14

做个神仙挺好,可惜修炼不到位{:4_170:}

醉美水芙蓉 发表于 2022-10-9 06:42

红影 发表于 2022-10-8 22:19
水芙蓉美女在下面挂了两条鱼,也挺有趣的呢。这孔雀舞真漂亮

谢谢红影美女支持!

醉美水芙蓉 发表于 2022-10-9 06:42

起个网名好难 发表于 2022-10-8 22:27
我是穷人,分不多请笑纳

谢谢老师欣赏支持!

醉美水芙蓉 发表于 2022-10-9 06:43

马黑黑 发表于 2022-10-8 23:12
挂件与背景、播放器的配套很恰当。赞!

谢谢黑黑老师光临点评!

马黑黑 发表于 2022-10-9 07:00

醉美水芙蓉 发表于 2022-10-9 06:43
谢谢黑黑老师光临点评!

早阿

红影 发表于 2022-10-9 09:42

醉美水芙蓉 发表于 2022-10-9 06:42
谢谢红影美女支持!

水芙蓉美女真棒{:4_187:}
页: [1]
查看完整版本: 做个神仙