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

韩甜甜 - 卷珠帘

<style>
#papa { left: -214px; width: 1024px; height: 640px; background: darkred url('https://638183.freep.cn/638183/t22/webp/jzl.webp') 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('https://638183.freep.cn/638183/t22/webp/jzl1.webp') 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: 30px; top: 182px; 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://638183.freep.cn/638183/t22/webp/fengling.webp" 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://music.163.com/song/media/outer/url?id=1392790489.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 13:25

又是两张图图叠起的吧。这圆环播放器下面还挂了个挂件,有意思{:4_187:}

红影 发表于 2022-10-8 13:29

这歌声还真是甜甜的,和霍尊的比又另一种味道,好听{:4_204:}

加林森 发表于 2022-10-8 14:44

真好。

小辣椒 发表于 2022-10-8 17:27

画面太美了{:4_178:}

小辣椒 发表于 2022-10-8 17:29

这个图叠加出来也是一种特效
播放器加了挂件,和卷珠图图相辅相成,习惯特棒


马黑黑 发表于 2022-10-8 18:52

小辣椒 发表于 2022-10-8 17:29
这个图叠加出来也是一种特效
播放器加了挂件,和卷珠图图相辅相成,习惯特棒

{:4_172:}

马黑黑 发表于 2022-10-8 18:53

红影 发表于 2022-10-8 13:29
这歌声还真是甜甜的,和霍尊的比又另一种味道,好听

没有霍尊唱的好。这个,刘欢若听了,不会哭吧哭吧不是罪的

马黑黑 发表于 2022-10-8 18:53

红影 发表于 2022-10-8 13:25
又是两张图图叠起的吧。这圆环播放器下面还挂了个挂件,有意思

风铃,因为年代久远,有些呆滞

马黑黑 发表于 2022-10-8 18:54

加林森 发表于 2022-10-8 14:44
真好。

过得去

马黑黑 发表于 2022-10-8 18:54

小辣椒 发表于 2022-10-8 17:27
画面太美了

还行的吧

醉美水芙蓉 发表于 2022-10-8 18:55

马黑黑 发表于 2022-10-8 18:56

醉美水芙蓉 发表于 2022-10-8 18:55
很漂亮!欣赏黑黑老师新作品!

谢谢支持。请喝水{:4_190:}

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

马黑黑 发表于 2022-10-8 18:53
没有霍尊唱的好。这个,刘欢若听了,不会哭吧哭吧不是罪的

也很好听的了,这首歌本身也好听{:4_187:}

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

马黑黑 发表于 2022-10-8 18:53
风铃,因为年代久远,有些呆滞

圆环下面挂个东西,这个好玩,空了我也做个{:4_173:}

马黑黑 发表于 2022-10-8 19:36

红影 发表于 2022-10-8 19:09
圆环下面挂个东西,这个好玩,空了我也做个

这个简单的

马黑黑 发表于 2022-10-8 19:37

红影 发表于 2022-10-8 19:08
也很好听的了,这首歌本身也好听

那是,这是一代人的梦、两代人的努力的成果

红影 发表于 2022-10-8 20:17

马黑黑 发表于 2022-10-8 19:36
这个简单的

是的,以前跟着黑黑做过的。

马黑黑 发表于 2022-10-8 20:21

红影 发表于 2022-10-8 20:17
是的,以前跟着黑黑做过的。

关键:

transform-origin: top;

红影 发表于 2022-10-8 20:21

马黑黑 发表于 2022-10-8 19:37
那是,这是一代人的梦、两代人的努力的成果

一首歌而已啊,有那么严重么{:4_173:}
页: [1] 2 3 4 5
查看完整版本: 韩甜甜 - 卷珠帘