|
|

楼主 |
发表于 2024-1-26 13:22
|
显示全部楼层
本帖最后由 马黑黑 于 2024-1-26 14:06 编辑
帖子代码- <style>
- #papa { margin: 0 0 0 calc(50% - 681px); width: 1200px; height: 674px; position: relative; background: lightblue url('https://638183.freep.cn/638183/t24/jpg/ifai.jpg') no-repeat center/cover; box-shadow: 4px 4px 8px rgba(0,0,0,.6); overflow: hidden; display: grid; place-items: center; --state: paused; }
- #mplayer { position: absolute; bottom: 10px; text-align: center; color: white; }
- #mplayer p { margin: 0; padding: 0; cursor: pointer; }
- #mprog { width: 240px; accent-color: darkgreen; outline: none; cursor: pointer; }
- #btnplay { width: 80px; animation: rotating 6s infinite linear var(--state); }
- #lrc { --motion: cover2; --tt: 1s; --bg: linear-gradient(180deg,hsla(100,10%,50%,.75),hsla(100,100%,20%,.65)); position: absolute; top: 15px; font: bold 2.4em sans-serif; color: hsl(100, 100%, 90%); white-space: pre; -webkit-background-clip: text; filter: drop-shadow(1px 1px 2px hsla(0, 100%, 0%, .85)); pointer-events: none; z-index: 900; }
- #lrc::before { position: absolute; content: attr(data-lrc); width: 0%; height: 100%; color: transparent; overflow: hidden; white-space: pre; background: var(--bg); filter: inherit; background-clip: text; -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards var(--state); }
- #vid { position: absolute; top: -70px; width: 100%; height: calc(100% - 70px); object-fit: cover; pointer-events: none; mix-blend-mode: screen; }
- @keyframes cover1 { from { width: 0%; } to { width: 100%; } }
- @keyframes cover2 { from { width: 0%; } to { width: 100%; } }
- @keyframes rotating { to { transform: rotate(360deg); } }
- </style>
- <div id="papa">
- <audio id="aud" src="https://music.163.com/song/media/outer/url?id=2005492357" autoplay loop></audio>
- <video id="vid" src="https://img.tukuppt.com/video_show/2629112/00/01/51/5b448e6c1c0ca.mp4" loop muted></video>
- <div id="mplayer">
- <p><img id="btnplay" src="https://638183.freep.cn/638183/small/002_133507167677724892.png" title="播放/暂停" alt="" /></p>
- <output id="mdu">0:00</output>
- <input id="mprog" type="range" min="0" step="1" max="100" value="0" title="调节进度" />
- <output id="mcur">0:00</output>
- </div>
- <div id="lrc" data-lrc="HuaChao LRC Player">HuaChao LRC Player</div>
- </div>
- <script>
- var geci = [ [2,"家家 - 尘埃",8.4], [10.4,"作词 : 木兰号AKA陈韦伶",9.9], [20.29,"作曲 : 木兰号AKA陈韦伶",7.9], [28.23,"星星一直都在 这一片云海",5.5], [34.6,"等着太阳疲倦之后离开",6.5], [42.7,"我也一直待在 这个模糊地带",5.0], [48.91,"等着你疲倦了回来",5.4], [55.37,"天黑之后才拥有光彩",2.9], [58.91,"才能看见微弱的存在",2.9], [62.38,"我就好像星星在距你千里之外",6.3], [69.61,"白云总是对蓝天依赖",2.9], [73.19,"我的爱也因你而存在",2.9], [76.38,"哪怕你不懂我的感慨和等待",6.1], [83.83,"我的爱像尘埃 散落在边疆地带",6.6], [90.76,"不再对谁期待",2.2], [93.01,"难道是一种自由自在",4.2], [97.65,"而承诺像尘埃 不断被时间掩埋",6.7], [104.81,"谁还记得大雨之中的告白",7.3], [123.86,"时间走得太快 要爱得痛快",5.2], [129.86,"宁愿受伤也不想要空白",6.9], [137.94,"谁都想被疼爱 找一个未来",5.6], [144.3,"不要在孤独里徘徊",5.5], [150.79,"天黑之后才拥有光彩",2.8], [154.16,"才能看见微弱的存在",2.9], [157.86,"我就好像星星在距你千里之外",6.4], [164.92,"白云总是对蓝天依赖",2.9], [168.46,"我的爱也因你而存在",2.9], [171.6,"哪怕你不懂我的感慨和等待",6.4], [179.06,"我的爱像尘埃 散落在边疆地带",6.7], [186.01,"不再对谁期待",2.2], [188.39,"难道是一种自由自在",4.4], [193.09,"而承诺像尘埃 不断被时间掩埋",6.6], [199.97,"谁还记得大雨之中的告白",9.2], [228.5,"我的爱像尘埃 散落在边疆地带",6.6], [235.38,"不再对谁期待",2.2], [237.8,"难道是一种自由自在",4.2], [242.51,"而承诺像尘埃 不断被时间掩埋",6.6], [249.45,"谁还记得大雨之中的告白",6.8], [256.64,"谁还记得大雨之中的告白",9.2], [268.51,"谁都想被疼爱 找一个未来",5.1], [274.83,"不要在孤独里徘徊",6] ];
- var sf = document.createElement('script');
- sf.src = 'https://638183.freep.cn/638183/web/js/lrcku.js';
- sf.charset = 'utf-8';
- document.querySelector('body').appendChild(sf);
- sf.onload = () => {
- var mseek = false;
- aud.addEventListener('pause', () => mState());
- aud.addEventListener('playing', () => mState());
- aud.addEventListener('seeked', () => calcKey());
- aud.addEventListener('timeupdate', () => {
- if(!mseek) mprog.value = aud.currentTime / aud.duration * 100;
- mcur.value = toMin(aud.currentTime);
- mdu.value = toMin(aud.duration);
- for (let j = 0; j < geci.length; j++) {
- if (aud.currentTime >= geci[j][0]) {
- if (mKey === j) showLrc(geci[j][2]);
- else continue;
- }
- }
- });
- mprog.onchange = () => aud.currentTime = mprog.value * aud.duration / 100;
- mprog.onmousedown = () => mseek = true;
- mprog.onmouseup = () => mseek = false;
- mprog.onmousemove = () => {
- if(mseek) mcur.value = toMin(mprog.value * aud.duration / 100);
- };
- btnplay.onclick = () => aud.paused ? aud.play() : aud.pause()
- var mState = () => aud.paused ? (stateSetting([papa,lrc],'--state','paused'), vid.pause()) : (stateSetting([papa,lrc],'--state','running'), vid.play());
- };
- </script>
复制代码
|
|