亚伦影音工作室 发表于 2022-9-26 13:20

总以为来日方长(DJ默涵版) - 梅朵

本帖最后由 亚伦影音工作室 于 2022-9-27 14:43 编辑 <br /><br /><style>
      #papa { margin: auto; width: 1024px; height: 600px; top:0px; left:-210px;background: rgba(0,0,0,.45) url('https://img-baofun.zhhainiao.com/pcwallpaper_ugc/static/949ba98cb8b37afe1f20d817f47166be.jpg') no-repeat center/cover; box-shadow: 3px 3px 20px #000; display: grid; place-items: center; overflow: hidden; position: relative; z-index: 1; }
      #mplayer { position: absolute; bottom: 0; width: 300px; height: 80px; user-select: none; display: grid; place-items: center; cursor: pointer; }
      #mplayer:hover #btnwrap, #mplayer:hover #prog { transform: translateY(var(--yy)); }
      #mplayer:hover #btnwrap { background: linear-gradient(to top right, purple, orange); border-radius: 50%; opacity: .75; }
      #btnwrap, #prog { position: absolute; display: grid; place-items: center; transition: .5s; }
      #btnwrap { --yy: -15px; width: 40px; height: 40px; transform: rotate(45deg); border: 1px solid tan; border-radius: 6px; opacity: 0; }
      #btnplay { width: 20px; height: 20px; transform: translateX(3px); background: #eee; clip-path: polygon(0 0, 0% 100%, 100% 50%); }
      #btnpause { width: 2px; height: 20px; border-style: solid; border-width: 0px 4px; border-color: transparent #eee; display: none; }
      #prog { --yy: 20px; width: 300px; height: 16px; border-radius: 10px; background: linear-gradient(90deg, orange, purple 100%, transparent 0); border: 1px solid tan; font: normal 14px / 16px sans-serif; color: #ff0000; text-shadow: 1px 1px 0 #000; opacity: .8; }
      #lrcwrap { position: absolute; top: 20px; font: bold 2.8em '华文隶书',sans-serif; }
      #lrc1, #lrc2 { width: 100%; height: 100%; color: #000080; white-space: nowrap; filter:drop-shadow(#ffffff 1px 0 0)drop-shadow(#ffffff 0 1px 0)drop-shadow(#ffffff -1px 0 0) drop-shadow(#ffffff 0 -1px0);}
      #lrc2 { position: absolute; top: 0px; left: 0px; color: #FF0000; overflow: hidden;filter:drop-shadow(#000080 1px 0 0)drop-shadow(#000080 0 1px 0)drop-shadow(#000080 -1px 0 0) drop-shadow(#000080 0 -1px0); }
      #mpic { position: absolute; transform: rotateY(180deg); top: 30px; left: 0; width: 100px; offset-distance: 0%; offset-path: path("m482,185c749,286.31216 450,-494.37752 450,-494.37752c0,0 -1199,208.06536 -450,494.37752z"); cursor: pointer; }
      @keyframes fly { from { offset-distance: 0%; } to { offset-distance: 100%; } }
      @keyframes mov1 { from { width: 0%;} to { width: 100%; } }
      @keyframes mov2 { from { width: 0%;} to { width: 100%; } }
</style>

<div id="papa" data-lr="no">
      <img id="mpic" alt="" src="https://638183.freep.cn/638183/t22/51/plane.gif" />
      <div id="lrcwrap">
                <span id="lrc1">花潮lrc在线</span>
                <span id="lrc2">花潮lrc在线</span>
      </div>
      <div id="mplayer">
                <div id="btnwrap"><span id="btnplay"></span><span id="btnpause"></span></div>
                <div id="prog">00:00 | 00:00</div>
      </div>
</div>

<script>
let mKey = 0, mFlag = true, aud = new Audio();
let lrcAr = [
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
       
];
aud.src = 'https://www.qqmc.com/mp3/music215622571.mp3';
aud.autoplay = true;
aud.loop = true;
mpic.onmouseover = () => {
      mpic.style.animation = 'fly 16s linear forwards';
      setTimeout(() => { mpic.style.animation = ''; },16000);
}
btnwrap.onclick = () => aud.paused ? aud.play() : aud.pause();
prog.onclick = (e) => aud.currentTime = aud.duration * e.offsetX / prog.offsetWidth;
aud.addEventListener('pause', () => mState());
aud.addEventListener('play', () => mState());
aud.addEventListener('seeked', () => calcKey());
aud.addEventListener('timeupdate', () => {
      prog.style.background = 'linear-gradient(90deg, orange, purple ' + aud.currentTime / aud.duration * 100 + '%, snow 0)';
      prog.innerText = toMin(aud.currentTime) + ' | ' + 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', lrc2.style.animationPlayState = 'paused') : (btnplay.style.display = 'none', btnpause.style.display = 'block', lrc2.style.animationPlayState = 'running');
let showLrc = (time) => {
      lrc2.style.animation = (mFlag ? 'mov1 ' : 'mov2 ') + time + 's linear forwards';
      lrc1.innerHTML = lrc2.innerHTML = lrcAr;
      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 mtime = lrcAr - (aud.currentTime - lrcAr);
      showLrc(mtime);
};
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>

起个网名好难 发表于 2022-9-26 13:43


<svg width="100%" height="100%" viewBox="0 0 1000 300"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
   <path id="MyPath"
         d="
      M 200 200
      m -150, -50
      a 200,100 0 1,0 400,0
      a 200,100 0 1,1 400,0
"/>
</defs>

<use xlink:href="#MyPath" fill="none" stroke="transparent"/>

<text font-family="Verdana" font-size="50" stroke="red" fill="yellow">
    <textPath xlink:href="#MyPath">
      欣赏、学习、点赞!
             <animate attributeName="startOffset" from="0" to ="1028" begin="0s" dur="10s" repeatCount="indefinite" />

    </textPath>
</text>
</svg>

红影 发表于 2022-9-26 13:52

制作漂亮,欣赏亚伦老师好帖{:4_187:}

醉美水芙蓉 发表于 2022-9-26 18:59

加林森 发表于 2022-9-27 13:52

好听好看,不错的。
页: [1]
查看完整版本: 总以为来日方长(DJ默涵版) - 梅朵