|
|

楼主 |
发表于 2026-6-2 12:00
|
显示全部楼层
- <div class="t_fsz">
- <table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_1876423">
- <style>
- #papa {
- margin: 80px 0 0 calc(50% - 593px);
- width: 1024px;
- height: 640px;
- box-shadow: 4px 8px 20px #000;
- position: relative;
- overflow: hidden;
- }
- #mplayer {
- left: 50%;
- bottom: 20px;
- transform: translate(-50%);
- width: fit-content;
- height: fit-content;
- color: tan;
- position: absolute;
- }
- #mplayer::before, #mplayer::after {
- position: absolute;
- content: attr(data-cu);
- bottom: 16px;
- }
- #mplayer::before { left: 10px; }
- #mplayer::after {
- content: attr(data-du);
- right: 10px;
- }
- #btn {
- display: block;
- margin: auto;
- margin-bottom: 10px;
- width: 80px;
- height: 80px;
- border-radius: 50%;
- cursor: pointer;
- animation: rot 6s infinite linear var(--state);
- }
- #prog {
- width: 400px;
- height: 5px;
- border: 1px solid tan;
- border-radius: 5px;
- display: grid;
- place-items: center start;
- position: relative;
- }
- #prog::before, #prog::after {
- position: absolute;
- content: '';
- cursor: pointer;
- }
- #prog::before {
- width: var(--ww);
- height: 5px;
- border-radius: 5px;
- background: linear-gradient(to right, LightSkyBlue, green, LightSkyBlue);
- }
- #prog::after {
- width: 100%;
- height:30px;
- border: 0px solid red;
- }
- .cap {
- position: absolute;
- left: calc(var(--ww) - 2px);
- width: 16px;
- height: 16px;
- background: LightSkyBlue;
- border-radius: 50%;
- }
- .pic {
- position: absolute;
- right: 0px;
- bottom: -80px;
- width: 250px;
- filter: blur(.5px) opacity(.8);
-
- }
- .pic1 {
- position: absolute;
- left: 80px;
- top: 420px;
- width: 240px;
-
- }
- .biankuang {
- position: absolute;
- width: 1024px; height: 640px;
- }
- #lrc { --motion: cover1; --tt: 5s; --state: paused; position: absolute; left: 20%; transform: translate(-50%); top: 510px; font: bold 2.4em sans-serif; color: hsl(300, 100%, 100%); -webkit-background-clip: text; filter: drop-shadow(1px 1px 2px hsla(0, 0%, 0%, .95)); }
- #lrc::before { position: absolute; content: attr(data-lrc); width: 20%; height: 100%; color: transparent; overflow: hidden; white-space: pre; background: linear-gradient(180deg, hsla(120, 100%, 50%, .45), hsla(200, 100%, 66%, .6), hsla(60, 100%, 50%, .75)); 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%; } }
- .vid { position: absolute; width: 1024px; height: 640px; object-fit: cover; }
- @keyframes rot { to { transform: rotate(1turn); } }
- </style>
- <div id="papa">
- <video class="vid" src="//img.tukuppt.com/video_show/2405179/00/02/37/5b5a9633a12f2.mp4" autoplay="autoplay" loop="loop" muted="muted"></video>
- <img class="biankuang" src="http://cccimg.com/view.php/3e0572b5c51b941b88f9dbca04007093.jpg" alt="" />
- <img class="pic" src="" alt="" />
- <img class="pic1" src="" alt="" />
- <div id="lrc" data-lrc="唐 伯 虎">秋 香</div>
- <div id="mplayer" data-du="00:00" data-cu="00:00">
- <img id="btn" src="https://s1.ax1x.com/2023/05/17/p9R5NcQ.png" alt="" />
- <div id="prog"><span class="cap"></span></div>
- </div>
- </div>
- <audio id="aud" src="http://cccimg.com/view.php/2b6113300a96b6378f17bdd1f194eea8.mp3" loop autoplay></audio>
- <script>
- let canmove = false;
- btn.addEventListener('click', () => aud.paused ? aud.play() : aud.pause());
- aud.addEventListener('play', () => mplayer.style.setProperty('--state','running'));
- aud.addEventListener('pause', () => mplayer.style.setProperty('--state','paused'));
- aud.addEventListener('timeupdate', () => {
- if(!canmove) prog.style.setProperty('--ww', aud.currentTime * prog.offsetWidth / aud.duration + 'px');
- mplayer.dataset.cu = toMin(aud.currentTime);
- mplayer.dataset.du = toMin(aud.duration);
- });
- prog.addEventListener('mousemove', (e) => {
- if (!canmove) return;
- let pos = e.offsetX;
- if (pos < 0) pos = 0;
- if (pos > prog.offsetWidth) pos = prog.offsetWidth;
- prog.style.setProperty('--ww', e.offsetX + 'px');
- });
- prog.addEventListener('mousedown', (e) => {
- canmove = true;
- });
- prog.addEventListener('mouseup', (e) => {
- canmove = false;
- aud.currentTime = aud.duration * e.offsetX / prog.offsetWidth;
- });
- document.addEventListener('mouseup', () => canmove = false);
- 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;
- };
- let mKey = 0, mFlag = true;
- let lrcAr = [
- [0.84,"一呀嘛更儿里",2.5],
- [4.02,"月了影儿照花台",2.9],
- [7.55,"秋香姐定下了计",3.6],
- [11.41,"她说晚不上郎来",2.9],
- [14.92,"哟牡丹哪亭前",3.2],
- [18.41,"我们多恩爱呀",3.7],
- [22.46,"但愿得鸾凤早早",4.6],
- [27.06,"配和谐哎哎哎",4.0],
- [33.59,"左等也不来右等也不来",6.2],
- [40.86,"唐解元望苍天",3.4],
- [44.44,"止不住的好伤怀",3.1],
- [48.17,"美人呐秋香嗨",3.7],
- [51.88,"勾了魂的女裙钗",0.3],
- [54.34,"哎哎哎",1.9],
- [85.37,"二呀嘛正儿里",0.8],
- [86.61,"明月照花前",3.1],
- [90.31,"花香府困住了多情的唐解元",6.0],
- [96.92,"痴心的才子我风流的汉",7.5],
- [105.04,"我在那佛前我求了几千年",6.2],
- [111.26,"哎哎哎哎",2.8],
- [114.51,"不见那女天仙",2.3],
- [117.73,"不见那女婵娟",3.1],
- [121.6,"唐伯虎望明月",3.3],
- [125.09,"止不住的好伤残",3.4],
- [128.84,"美人爱秋香嗨",3.5],
- [132.56,"勾了魂的女婵娟",2.4],
- [134.95,"哎哎哎",2.5],
- [154.8,"三呀嘛更儿里",2.5],
- [158.3,"明月照当空",2.8],
- [162.03,"轻敲锣鼓响",3.4],
- [165.69,"眼前铁马声",2.9],
- [169.36,"牡丹啊亭前我哭满院",6.7],
- [176.52,"点点的相思长叹一阵风",6.8],
- [186.08,"天边月朦胧庭前恨无穷",6.7],
- [193.32,"恨与老银河谷你不来栓红绳",6.7],
- [200.78,"女人哎秋香嗨",3.4],
- [205.72,"勾了魂的女花容",5.3]
- ];
- let vid = document.querySelector('.vid');
- let mState = () => aud.paused ? (lrc.style.setProperty('--state', 'paused'), vid.pause()) : (lrc.style.setProperty('--state', 'running'), vid.play());
- let showLrc = (time) => {let name = mFlag ? 'cover1' : 'cover2';lrc.innerHTML = lrcAr[mKey][1];lrc.dataset.lrc = lrcAr[mKey][1].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 < lrcAr.length; j++) {if (aud.currentTime <= lrcAr[j][0]) {mKey = j - 1;break;}}if (mKey < 0) mKey = 0;if (mKey > lrcAr.length - 1) mKey = lrcAr.length - 1;let time = lrcAr[mKey][2] - (aud.currentTime - lrcAr[mKey][0]);showLrc(time);};
- aud.addEventListener('timeupdate', () => {for(let j = 0; j < lrcAr.length; j ++) {if (aud.currentTime >= lrcAr[j][0]) {if (mKey === j) showLrc(lrcAr[j][2]);else continue;}}});
- aud.addEventListener('pause', () => mState());
- aud.addEventListener('play', () => mState());
- aud.addEventListener('seeked', () => calcKey());
- </script></td></tr></table>
复制代码 |
|