朵拉 发表于 2022-8-28 09:48:48

星河叹

本帖最后由 朵拉 于 2022-8-28 17:56 编辑 <br /><br /><style>
#papa { left: -100px; width: 1024px; height: 640px; background: gray url('https://pic.imgdb.cn/item/630abad516f2c2beb10f0468.jpg') no-repeat center/cover;box-shadow: 3px 3px 20px #000; position: relative; z-index: 1; }
#player { padding: 10px; position: absolute; left: 20px; bottom: 20px; width: fit-content; height: fit-content; display: flex; gap: 10px; flex-direction: column; }
#lrctext { font: bold 1.4em sans-serif; color: silver; text-shadow: 1px 1px 2px #000; user-select: none; transition: all 1.5s; }
#btnwrap { width: fit-content; height: fit-content; display: flex; gap: 8px; align-items: center; }
#btnmain { width: 36px; height: 36px; display: grid; place-items: center; background: rgba(0,0,0,.5); border-radius: 50%; cursor: pointer; transition: all 2s; }
#btnmain:hover { background: orange; }
#btnplay {width: 16px; height: 16px; background: #ccc; 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; }
#prgline { width: 200px; height: 4px; background: #ccc linear-gradient(to right,red,orange,green,red) no-repeat center left; background-size: 1px 4px; cursor: pointer;}
#tmsg { font: normal 16px sans-serif; color: orange; user-select: none; text-shadow: 1px 1px 1px #000; transition: 1.5s; }
#tmsg:hover, #lrctext:hover { color: tomato; }
</style>

<div id="papa">
      <div id="player">
                <div id="lrctext">lrc歌词</div>
                <div id="btnwrap">
                        <span id="btnmain"><span id="btnplay"></span><span id="btnpause"></span></span>
                        <span id="prgline"></span><span id="tmsg">00:00 | 00:00</span>
                </div>
      </div>
</div>

<script>
let lrcAr = [
      ['00.00', '星河叹 - 黄龄'],
      ['260.00','感谢欣赏']
];
let aud = new Audio();

aud.src = 'http://www.kumeiwp.com/sub/filestores/2022/08/25/535aa5257b39689a10c46a52a0936f8b.mp3';
aud.autoplay = true;
aud.loop = true;
btnmain.onclick = () => aud.paused ? aud.play() : aud.pause();
prgline.onclick = (e) => aud.currentTime = aud.duration * e.offsetX / prgline.offsetWidth;
aud.addEventListener('pause', () => btnstate());
aud.addEventListener('play',() => btnstate());
aud.addEventListener('timeupdate', () => {
      prgline.style.backgroundSize = prgline.offsetWidth * aud.currentTime / aud.duration + 'px 4px';
      tmsg.innerText = toMin(aud.duration) + ' | ' + toMin(aud.currentTime);
      for(j=0; j<lrcAr.length; j++) {
                if(aud.currentTime >= lrcAr) lrctext.innerText = lrcAr;
      }
});
let btnstate = () => aud.paused ? (btnplay.style.display = 'block', btnpause.style.display = 'none') : (btnplay.style.display = 'none', btnpause.style.display = 'block');
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-8-28 10:56:48

很好听的一首歌,优美深情,图图也意境满满,欣赏朵拉的音乐佳作{:2_126:}

青树 发表于 2022-8-28 10:57:49

谢谢朵拉分享的音乐佳作,制作辛苦了,祝周末开开心心{:2_124:}{:2_124:}

以玫 发表于 2022-8-28 18:07:09

制作精心精彩,歌曲好听 音质无可挑剔!好帖狠赞!!{:4_218:}

以玫 发表于 2022-8-28 18:07:47

听乐赏图,真是美美哒!听音乐带来好心情,赞赞赞!

以玫 发表于 2022-8-28 18:09:23

欣赏美图聆听美音真是美美哒,感谢精彩分享,感谢给大家带来美滴享受!!欣赏点赞!!天天好心情!

墨染锦年 发表于 2022-8-29 06:40:31

问好朵拉!漂亮音乐贴!

墨染锦年 发表于 2022-8-29 06:42:23

图图处理得柔和自然,意境唯美,歌曲动听

墨染锦年 发表于 2022-8-29 06:43:26

遥啊遥楚天阔
盼明月满星河
一念拂袖花落
谈笑间起风波
飘啊飘无奈何
叹恩怨难割舍............

美的旋律,美的享受!

墨染锦年 发表于 2022-8-29 06:45:37

感谢精彩分享!欣赏点赞!{:3_268:}{:3_268:}{:4_219:}{:4_219:}{:4_219:}
页: [1] 2
查看完整版本: 星河叹