撒哈拉的雨 发表于 2023-6-28 12:50

拥抱你离去


<style>
#papa {
      margin: 150px 0 0 calc(50% - 780px);
      display: grid;
      place-items: center;
      width: 1400px;
      height: 686px;
      background: lightblue url('https://pan.doliy.cn/filestores/2023/06/28//3e0094d3bb08ca1108e3d2c67334756a.jpg') no-repeat center/cover;
      box-shadow: 6px 3px 20px #000;
      user-select: none;
      position: relative;
      z-index: 1;
}
#tit {
      position: absolute;
      width: fit-content;
      height: fit-content;
      right: 2%;
      bottom: 55%;
      color: SkyBlue;
       font: bold 45px/45px 'Microsoft YaHei',serif;

}
.mysp {
      position: relative;
      display: block;
}

@keyframes move {
      0% { right: 10px; transform: rotate(0); color: Yellow; }
      50% { right: 100px; transform: rotate(360deg); color: red; }
      100% { right: 10px; transform: rotate(720deg); color: Snow; }
}

</style>

<div id="papa">
   

      <div id="tit"></div>
</div>
<audio id="aud" src="https://pan.doliy.cn/filestores/2023/06/28//24cf1dd62a512e63bf540c7b3b207b9a.mp3" loop autoplay></audio>

<script >
(function() {
      (function(mkPlayer) {let defaults = {lrcAr: [],lrc_css: 'top: 10px; left: 15px;',player_css: '',playerCode: `<style>#mplayer {position: absolute;left: left: calc(50% - 60px);bottom: 10px;--track: hsla(100,30%,80%,.65);--prog: hsla(100,60%,50%,.55);--color: #e9f1f6;}#btnwrap { display: block; fill: var(--color); opacity: .85; cursor: pointer; }#btnwrap:hover { opacity: 1; }#track { fill: none; stroke: var(--track); }#prog { fill: none; stroke: var(--prog); }#tmsg { fill: var(--color); stroke: none; font: bold 1em sans-serif; }#lrc {--motion: cover2;--tt: 1s;--state: running;--bg: linear-gradient(180deg,hsla(100,10%,50%,.75),hsla(100,100%,20%,.65));position: absolute;font: bold 2.4em sans-serif;color: hsl(100, 100%, 90%);white-space: pre;-webkit-background-clip: text;filter: drop-shadow(1px 1px 1px 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: pre;background: var(--bg);filter: inherit;-webkit-background-clip: text;animation: var(--motion) var(--tt) linear forwards;animation-play-state: var(--state);}@keyframes cover1 { from { width: 0; }to { width: 100%; } }@keyframes cover2 { from { width: 0; }to { width: 100%; } }</style> <svg id="mplayer"width="120" height="120"><g id="circle_wrap" transform="rotate(-90, 60, 60)" style="cursor: pointer;"><circle id="track" cx="60" cy="60" r="50" stroke-width="10" /><circle id="prog" cx="60" cy="60" r="50" stroke-width="10" /></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="HCPlayer">HCPlayer</div>`,};let playCode = (user_config) => {let data = Object.assign({}, defaults, user_config);papa.innerHTML += data.playerCode;mplayer.style.cssText += data.player_css;lrc.style.cssText += data.lrc_css;let mKey = 0, mFlag = true, 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();circle_wrap.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('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 < data.lrcAr.length; j++) {if (aud.currentTime >= data.lrcAr) {if (mKey === j) showLrc(data.lrcAr);else continue;}}});aud.addEventListener('pause', () => mState());aud.addEventListener('play', () => mState());aud.addEventListener('seeked', () => calcKey());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 = data.lrcAr;lrc.dataset.lrc = data.lrcAr.replace(/<br>/, '\n');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 < data.lrcAr.length; j++) {if (aud.currentTime <= data.lrcAr) {mKey = j - 1;break;}}if (mKey < 0) mKey = 0;if (mKey > data.lrcAr.length - 1) mKey = data.lrcAr.length - 1;let time = data.lrcAr - (aud.currentTime - data.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;};};mkPlayer.HCPlayer = playCode;})(this);
      (function(mkFS) {let setFullScreen = (user_set) => {let pa = user_set.pa;if(typeof(pa) !== 'object') return false;if(!user_set.set) user_set.set = 'color: snow; background: black; border: 2px solid snow; left: 40px; bottom: 40px;';btnMsg = document.createElement('span');btnMsg.style.cssText = `position: absolute; border-radius: 8px; padding: 4px; cursor: pointer; z-index:998; ${user_set.set}`;btnMsg.innerText = '全屏观赏';btnMsg.style.display = 'none';pa.appendChild(btnMsg);let timerId, fs = false;btnMsg.onclick = () => fs ? document.exitFullscreen() : pa.requestFullscreen();pa.addEventListener('mousemove', (e) => {clearTimeout(timerId);btnMsg.style.display = 'block';timerId = setTimeout('btnMsg.style.display = "none"', 3000);});document.addEventListener('fullscreenchange', () => {if (document.fullscreenElement !== null) {fs = true;btnMsg.innerText = '退出全屏';} else {fs = false;btnMsg.innerText = '全屏观赏';}});};mkFS.FS = setFullScreen;})(this);

       let lrcAr = [
                ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
       
];


      HCPlayer({
                lrcAr: lrcAr,
                player_css: 'bottom: 5%; right: 50%;',
                lrc_css: 'left: 220px; top:100px;',
      });

      FS({
                pa: papa,
                set: 'color: snow; background:OliveDrab; border: 2px solid snow;right: 51.7%;bottom: 30%;',
      });

      let spans = [],idx = 0, last = null;

      [...'拥抱你离去'].forEach((item,key) => {
                let sp = document.createElement('span');
                sp.className = 'mysp';
                sp.innerHTML = item + '<br>';
                spans.push(sp);
                tit.appendChild(sp);
      });

      let mov = () => {
                if(last != null) spans.style.animation = '';
                spans.style.animation = 'move 2s';
                last = idx;
                idx += 1;
                if(idx >= spans.length) idx = 0;
                setTimeout(mov,2000);
      };

      mov();
})();
</script>
<br><br><br><br><br>

撒哈拉的雨 发表于 2023-6-28 12:52

偷懒了,没有做图,直接MV截图了

伤痕泪泪 发表于 2023-6-28 14:38

同意补上!

墨羽 发表于 2023-6-28 15:19

这个也漂亮啊,浑然一体!

展泉岩 发表于 2023-6-28 16:18

进来听听歌{:9022:}

夏如夕 发表于 2023-6-28 16:59

这个歌好听。曾经做过图图。。

夏如夕 发表于 2023-6-28 17:00

标题特效好漂亮呢。。问好帅

瞳萤 发表于 2023-6-28 22:08

这样也挺好看,歌儿也好听,欣赏~

宁静 发表于 2023-6-28 22:23

这个偷懒说实话也是要技术的{:9007:}

宁静 发表于 2023-6-28 22:24

撒哈拉的雨 发表于 2023-6-28 12:52
偷懒了,没有做图,直接MV截图了

大哥晚上好,这个歌词同步化时间吧,谢谢大哥分享{:10_402:}
页: [1] 2
查看完整版本: 拥抱你离去