有声有色 发表于 2023-5-18 07:38

评弹——秦淮景

本帖最后由 有声有色 于 2023-5-18 09:49 编辑 <br /><br /><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: 140px;
        top: 120px;
        width: 840px;
       
}

.biankuang {
        position: absolute;
        width: 1024px; height: 640px;       
}
#lrc { --motion: cover1; --tt: 5s; --state: paused; position: absolute; left: 50%; 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/2418175/00/01/83/5b4b0c1e236a1.mp4" autoplay="autoplay" loop="loop" muted="muted"></video>
        <img class="biankuang" src="https://s1.ax1x.com/2023/05/18/p9f90PO.png" alt="" />
        <img class="pic" src="https://pic2.imgdb.cn/item/6461cc780d2dde5777b35564.gif" alt="" />
        <img class="pic1" src="" alt="" />
      <div id="lrc" data-lrc="花潮lrc在线">花潮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="https://music.163.com/song/media/outer/url?id=1406232229.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 = [
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
       
];
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;lrc.dataset.lrc = 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 < 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 time = lrcAr - (aud.currentTime - lrcAr);showLrc(time);};
aud.addEventListener('timeupdate', () => {for(let j = 0; j < lrcAr.length; j ++) {if (aud.currentTime >= lrcAr) {if (mKey === j) showLrc(lrcAr);else continue;}}});
aud.addEventListener('pause', () => mState());
aud.addEventListener('play', () => mState());
aud.addEventListener('seeked', () => calcKey());

</script></td></tr></table>

红影 发表于 2023-5-18 09:55

这评弹真好听,很嗲的声音,听得人的心都跟着柔软起来{:4_187:}

红影 发表于 2023-5-18 09:56

这个透明图也好看,好像天生就该如此似的。让那水面多了许多人文气息。有声有色老师的帖子太美了{:4_199:}

有声有色 发表于 2023-5-18 10:12

红影 发表于 2023-5-18 09:56
这个透明图也好看,好像天生就该如此似的。让那水面多了许多人文气息。有声有色老师的帖子太美了

谢谢,看来还没痴呆,能动的出脑筋,

梦缘 发表于 2023-5-18 10:25

好听的评弹,欣赏点赞!{:4_187:}

有声有色 发表于 2023-5-18 10:35

梦缘 发表于 2023-5-18 10:25
好听的评弹,欣赏点赞!

谢谢,鼓励支持

罗浮梦 发表于 2023-5-18 11:21

聆听好声音

有声有色 发表于 2023-5-18 11:53

罗浮梦 发表于 2023-5-18 11:21
聆听好声音

谢谢

红影 发表于 2023-5-18 13:33

有声有色 发表于 2023-5-18 10:12
谢谢,看来还没痴呆,能动的出脑筋,

是啊,您非常会动脑筋呢,这些透明图的设计太棒了{:4_199:}
页: [1]
查看完整版本: 评弹——秦淮景