马黑黑 发表于 2022-11-7 07:29

记事本

<style>
#papa { left: calc(50% - 680px); display: grid; place-items: center; width: 1200px; height: 800px; background: #000 url('https://638183.freep.cn/638183/t22/webp/note-1.webp') no-repeat center/cover; box-shadow: 3px 3px 20px #000; perspective: 1000px; overflow: hidden; user-select: none; position: relative; z-index: 1; }
#mplayer { position: absolute; bottom: 10px; z-index: 1000; }
#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: 1s; --state: running; position: absolute; top: 15px; font: bold 2.4em sans-serif; color: hsl(100,100%,90%); -webkit-background-clip: text; filter: drop-shadow(1px 1px 2px hsla(0,100%,0%,.85)); z-index: 900; }
#lrc::before { position: absolute; content: attr(data-lrc); width: 20%; height: 100%; color: transparent; overflow: hidden; white-space: nowrap; background: linear-gradient(180deg,hsla(100,10%,50%,.75),hsla(100,100%,20%,.65)); filter: inherit; -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards; animation-play-state: var(--state); }
.sons { position: absolute; border: 1px solid #ccc; border-radius: 0 40%; }
@keyframes move { to { transform: rotate(0) translate3d(0, 0, 0); } }
@keyframes cover1 { from { width: 0; } to { width: 100%; } }
@keyframes cover2 { from { width: 0; } to { width: 100%; } }
</style>

<div id="papa">
        <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(100, 20%, 80%, .65)" />
                        <circle id="prog" cx="60" cy="60" r="50" fill="none" stroke-width="10" stroke="hsla(100,50%,50%,.55)" />
                </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 id="lrc" data-lrc="花潮论坛lrc在线">花潮论坛lrc在线</div>
</div>
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=215576.mp3" loop autoplay></audio>

<script>
(function() {
        let mKey = 0, mFlag = true, cc = { x: 1*track.getAttribute('cx'), y: 1*track.getAttribute('cy'), len: track.getTotalLength(),};
        let lrcAr = [
        ,,,,,,,,,,,,,,,,,,,,,,上眼讓你走",2.2],,,,,,,,,,,,,,,,上眼讓你走燒掉日記重新來過",7.2],,,,,上眼讓你走",2.2],];
        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 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 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 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;};
        (function() {let size = 600, total = 60;Array.from({length:total}).forEach((ele,key) => {ele = document.createElement('span');ele.className = 'sons';ele.style.cssText += `width: ${(key+1) * size / total}px;height: ${(key+1) * size / total}px;border-color: #${Math.random().toString(16).substr(-6)};transform: rotate(${360 / total * key}deg);`;papa.appendChild(ele);});})();
        document.title = '陳慧琳 - 記事本';
})();
</script>

起个网名好难 发表于 2022-11-7 08:03

本帖最后由 起个网名好难 于 2022-11-7 08:06 编辑

https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg95.699pic.com%2Fphoto%2F40168%2F3640.gif_wh300.gif&refer=http%3A%2F%2Fimg95.699pic.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1670371552&t=0f9ef33e76ede7da6bf7296773b101ce

梦油 发表于 2022-11-7 10:42

黑黑朋友早晨好!《记事本》设计得很有个性,祝贺你。

闲言不语 发表于 2022-11-7 11:00

貌似事情多的乱如麻,必须记下来{:4_199:}

马黑黑 发表于 2022-11-7 12:26

闲言不语 发表于 2022-11-7 11:00
貌似事情多的乱如麻,必须记下来

记事本就是记下这些乱如麻的东东,然后烧掉重来{:4_170:}

马黑黑 发表于 2022-11-7 12:29

梦油 发表于 2022-11-7 10:42
黑黑朋友早晨好!《记事本》设计得很有个性,祝贺你。

感谢支持

小辣椒 发表于 2022-11-7 13:31

这个记事本还蛮漂亮的,换我舍不得烧的{:4_189:}

小辣椒 发表于 2022-11-7 13:36

我手机看不出这些线框怎么来的{:4_203:}

小辣椒 发表于 2022-11-7 13:37

应该不是图片里面自的吧,黑黑代码编辑的?

小辣椒 发表于 2022-11-7 13:53

谢谢黑黑分享新的东东{:4_178:}
每天一个更新,太厉害了{:4_199:}

梦油 发表于 2022-11-7 15:20

马黑黑 发表于 2022-11-7 12:29
感谢支持

别客气。

相约爱晚亭 发表于 2022-11-7 16:17

欣赏音画佳作!

马黑黑 发表于 2022-11-7 17:32

梦油 发表于 2022-11-7 15:20
别客气。

{:5_108:}下午好

梦油 发表于 2022-11-7 17:46

马黑黑 发表于 2022-11-7 17:32
下午好

黑黑朋友辛苦啦!

红影 发表于 2022-11-7 21:16

这些图案设计真漂亮,层层叠叠封锁起的心事{:4_187:}

马黑黑 发表于 2022-11-7 22:17

红影 发表于 2022-11-7 21:16
这些图案设计真漂亮,层层叠叠封锁起的心事

理解正确{:5_108:}
页: [1]
查看完整版本: 记事本