亦是金 发表于 2025-7-12 14:41

《爱情慢慢摇》 - 老 猫

本帖最后由 亦是金 于 2025-7-15 17:39 编辑 <br /><br /><div class="t_fsz">
<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_1860773">

<div style="width: 1200px;height: 700px;box-shadow:0px 0px 1px 2px #045768, 0px 0px 0px 8px #99e5f5,0px 0px 5px 15px #045768;overflow:hidden;border-radius:1%;margin-top:50px;margin-LEFT: -310px;">

<style>
#papa {
      margin: auto;
      top: -83px;
      left: 0px;
        width: 1200px;
        height: 700px;
        background: url('https://file.moyubuluo.com/d/file/2023-05-31/9398a96193f4ef851f3433f73c093555.jpg') center/cover no-repeat;
        box-shadow: 3px 3px 20px #000;
        position: relative;
        opacity: 1;
        z-index: 1;
}
#papa:hover
#mplayer { transition: .7s; opacity: .9; }
#vid {
      display: none;
      top: 200px;
      left: 0px;
        width: 1200px;
        height: 700px;
}
#canv {
        position: absolute;
        display: block;
        opacity: 1;
        animation: opa 10s infinite alternate linear;
}
#mplayer {
        position: absolute;
        left: calc(50% - 15px);
        bottom: 10px;
        width: 30px;
        height: 30px;
        border: 2px solid white;
        border-radius: 50%;
        opacity: 0;
        transition: .7s;
        display: grid;
        place-items: center;
        --disp1: 0; --disp2: 1;
}
#mplayer::before,
#mplayer::after {
        position: absolute;
        content: '';
        border-style: solid;
        border-color: white;
        cursor: pointer;
        transition: .4s;
}
#mplayer::before {
        width: 0;
        height: 0;
        left: 10px;
        border-width: 10px 12px;
        border-color: transparent transparent transparent white;
        opacity: var(--disp1);
}
#mplayer::after {
        width: 2px;
        height: 20px;
        border-width: 0 4px 0 4px;
        opacity: var(--disp2);
}
@keyframes opa { to {opacity: 0;} }


</style>


<style type="text/css">

@keyframes mv { from { background-position: 1200px 0; } to { background-position: 0 0; } }

body { overflow-x: hidden; }
#baiBox {
      margin: auto;
      width: 800px;
      text-align: center;
      font-family:微软简中圆;
      font-size: 2.5rem;
      font-weight: bold;
      color: #f46ff6;
      transform-origin: top;
      animation: yao 1.0s linear infinite alternate;
}

@keyframes yao {
      from{transform: perspective(800px) rotatex(30deg); }
      to { transform: perspective(800px) rotatex(-30deg); }
}



.tit { position: relative;width: 300px;height: 30px;top:20px;LEFT: -350px;z-index: 100;filter: drop-shadow(-1px 1px 1px #ffffff)drop-shadow(0px -1px 1px #ffffff)drop-shadow(0px 0px 1px #ffffff)drop-shadow(0px 0px 1px #ffffff)drop-shadow(0px 0px 1px #ffffff) }
#tit:hover { color: green; }
/*标题位置 移动范围设置*/

</style>

<div id="hu" >
<div id="baiBox"
<div class="tit">
<span style="color:#fb52f9;"><span style="font-size:32px;">《 爱 情 慢 慢 摇 》 </span>
<span style="color:#3d46f7;"><span style="font-size:20px;"> -老 猫 </span></div>

<div style="position: relative;width: 500px;height: 50px;top:610px;LEFT: 1000px;z-index: 100;filter: drop-shadow(-1px 1px 1px #e8f552)drop-shadow(0px -1px 1px #e8f552)drop-shadow(0px 0px 1px #e8f552)drop-shadow(0px 0px 1px #e8f552)drop-shadow(0px 0px 1px #e8f552)">
<p><span style="color:#ff0000;"><span style="font-family:华文隶书;"><span style="font-size:26px;">亦是金在线音乐</span></span></span></p></div>

</style>

<div id="papa">
        <canvas id="canv"></canvas>
        <div id="mplayer"></div>
<div id="fg"></div>


<div data-lrc="亦是金在线音乐" id="lrc">亦是金在线音乐</div>
</div>
</div>

<audio id="aud" src="https://s2.cldisk.com/sv-w9/audio/c7/90/80/a0d7558f7342170f8b678df14c081def/audio.mp3" loop autoplay></audio>
<video id="vid"src="https://video-qn.51miz.com/preview/video/00/00/58/69/V-zip-cpmhys6079e-B944D1DD.mp4" autoplay muted loop></video>

<style type="text/css">
#lrc {
        --state: paused;
        --motion: cover2;
        --tt: 2s;
        --bg: linear-gradient(40deg, #fa4354, #fa4354, #7718f8, #18f5f8, #f5f818, #b75004);
        position: absolute;z-index: 4;
        left: 50%;
        transform: translate(-50%);
        top: 85%;
        font: 400 3.0em 华文新魏;
        color: #000078;
        white-space: pre;
        -webkit-background-clip: text;
        filter:drop-shadow(#FFFFFF 1px 0 0)drop-shadow(#FFFFFF 0 1px 0)drop-shadow(#FFFFFF -1px 0 0) drop-shadow(#FFFFFF 0 -1px0);
}
#lrc::before {
        position: absolute;
        content: attr(data-lrc);
        width: 20%;
        height: 100%;
        color: transparent;
        overflow: hidden;
        white-space: pre;
        background: var(--bg);
       
        -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%; } }
</style>
<script >
(function() {
/*原始lrc歌词*/
let lrcStr = `
《爱情慢慢摇》 - 老 猫
词曲:老 猫
演唱:老 猫
LRC编辑:亦是金
。。。。。。
听着音乐慢慢摇
看着我俩慢慢聊
风萧萧雨飘飘
你知道不知道
就让爱情慢慢摇
就让我俩慢慢聊
忘不了逃不掉
岁月催人老
手机里太多的合照
都是回忆的色调
喝一杯奶茶的味道
回到熟悉的街道
点燃爱情的火苗
我俩紧紧地拥抱
这感觉真的好香
让人不由自主的
摇啊摇
我们在这世界上
慢慢的变老
我们在这世界上
彼此找依靠
忘记这世界上
太多纷纷扰扰
你的微笑是解药

我们在这世界上
慢慢的变老
我们在这世界上
彼此找依靠
记住这世界上
最动听的曲调
此时此刻的美妙

听着音乐慢慢摇
看着我俩慢慢聊
风萧萧雨飘飘
你知道不知道
就让爱情慢慢摇
就让我俩慢慢聊
忘不了逃不掉
岁月催人老
日子有多无聊
夜晚有多难熬
和你一起多么奇妙
可以变速的心跳
想念你每分每秒
怀疑我真的会疯掉
这感觉真的好香
让人不由自主的
飘啊飘
我们在这世界上
慢慢的变老
我们在这世界上
彼此找依靠
忘记这世界上
太多纷纷扰扰
你的微笑是解药

我们在这世界上
慢慢的变老
我们在这世界上
彼此找依靠
记住这世界上
最动听的曲调
此时此刻的美妙

听着音乐慢慢摇
看着我俩慢慢聊
风萧萧雨飘飘
你知道不知道
就让爱情慢慢摇
就让我俩慢慢聊
忘不了逃不掉
岁月催人老
慢慢慢慢摇
慢慢慢慢聊
哎吆哎哎吆
哎吆哎哎吆
爱情慢慢摇
慢慢慢慢摇
慢慢慢慢聊
哎吆哎哎吆
哎吆哎哎吆
爱情慢慢聊


`;

/*变量 :mKey - 当前歌词索引;mFlag :调用关键帧动画索引;averAdd :平均值补偿*/
let mKey = 0, mFlag = true, averAdd = 0.3;

/*函数 :获取每句歌词用时,歌词用时若超过平均值则取平均值,最后一句歌词则取平均值*/
let lrcTime = (ar) => {
        let tmpAr = [];
        for(j = 0; j <ar.length - 1; j ++) {
                if(j !== ar.length - 1) tmpAr = parseFloat((ar - ar).toFixed(1));
        }
        let aver = parseInt(tmpAr.reduce((a,b) => a + b) / (tmpAr.length - 1)) + averAdd;
        tmpAr.push(aver);
        tmpAr.forEach((item,key) => {
                ar = item > aver ? aver : item;
        });
        return ar;
};

/*函数 :从原始lrc歌词获取信息并存入 n*3 数组*/
let getLrcAr = (text) => {
        let lrcAr = [];
        let calcRule = ;
        for(x of text.split('\n')) {
                let ar = [];
                let re = /\d+[\.:]\d+([\.:]\d+)?/g;
                let geci = x.replace(re,'');
                if(geci) {
                        geci = geci.replace(/[\[\]\'\"\t,]s?/g,'');
                        let time = x.match(re);
                        if(time != null) {
                                for(y of time) {
                                        let tmp = y.match(/\d+/g);
                                        let sec = 0;
                                        for(z in tmp) sec += tmp * calcRule;
                                        ar = ;
                                        lrcAr.push(ar);
                                }
                        }
                }
        }
        lrcAr.sort((a,b)=> a - b);
        return(lrcTime(lrcAr));
};

/*函数 :模拟显示同步歌词*/
let showLrc = (time) => {
        let name = mFlag ? 'cover1' : 'cover2';
        lrc.innerHTML = lrcAr;
        lrc.dataset.lrc = lrcAr;
        lrc.style.setProperty('--motion', name);
        lrc.style.setProperty('--tt', time + 's');
        lrc.style.setProperty('--state', 'running');
        mKey += 1;
        mFlag = !mFlag;
};

/*函数 :处理当前歌词索引 mKey*/
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);
};

/*格式化时间信息*/
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 mState = () => aud.paused ? (lrc.style.setProperty('--state','paused'),mplayer.style.animationPlayState = 'paused') : (lrc.style.setProperty('--state','running'),mplayer.style.animationPlayState = 'running');

/*监听播放进度*/
aud.addEventListener('timeupdate', () => {
        for (j = 0; j < lrcAr.length; j++) {
                if (aud.currentTime >= lrcAr) {
                        cKey = j;
                        if (mKey === j) showLrc(lrcAr);
                        else continue;
                }
        }
});
aud.addEventListener('pause', () => mState());/*监听暂停事件*/
aud.addEventListener('play', () => mState());/*监听播放事件*/
aud.addEventListener('seeked', () => calcKey());/*监听查询事件*/
let lrcAr = getLrcAr(lrcStr); /*获得歌词数组*/
})();
</script>
<script>
if ('getContext' in document.createElement('canvas')) {
    HTMLImageElement.prototype.play = function() {
      if (this.storeCanvas) {
            // 移除存储的canvas
            this.storeCanvas.parentElement.removeChild(this.storeCanvas);
            this.storeCanvas = null;
            // 透明度还原
            image.style.opacity = '';
      }
      if (this.storeUrl) {
            this.src = this.storeUrl;   
      }
    };
    HTMLImageElement.prototype.stop = function() {
      var canvas = document.createElement('canvas');
      // 尺寸
      var width = this.width, height = this.height;
      if (width && height) {
            // 存储之前的地址
            if (!this.storeUrl) {
                this.storeUrl = this.src;
            }
            // canvas大小
            canvas.width = width;
            canvas.height = height;
            // 绘制图片帧(第一帧)
            canvas.getContext('2d').drawImage(this, 0, 0, width, height);
            // 重置当前图片
            try {
                this.src = canvas.toDataURL("image/gif");
            } catch(e) {
                // 跨域
                this.removeAttribute('src');
                // 载入canvas元素
                canvas.style.position = 'absolute';
                // 前面插入图片
                this.parentElement.insertBefore(canvas, this);
                // 隐藏原图
                this.style.opacity = '0';
                // 存储canvas
                this.storeCanvas = canvas;
            }
      }
    };
}
var image = document.getElementById("testImg"),
    button = document.getElementById("testBtn");
   
if (image && button) {
    button.onclick = function() {
      if (this.value == '') {
         image.play();
            this.value = '.';
      } else {
            image.stop();
            this.value = '';
      }
    };
}

</script>

<script>
(function(){

let ctx = canv.getContext('2d');
let ww = canv.width = papa.offsetWidth, hh = canv.height = papa.offsetHeight;
let loop = () => {ctx.drawImage(vid, 0, 50, ww, hh, 0, 0, ww + 150, hh + 90);if(!vid.paused) {requestAnimationFrame(loop);return;}};
let mState = () => aud.paused ? (mplayer.style.setProperty('--disp1','1'), mplayer.style.setProperty('--disp2','0'), vid.pause()) : (mplayer.style.setProperty('--disp1','0'), mplayer.style.setProperty('--disp2','1'), vid.play());
vid.addEventListener('play', loop, false);
aud.addEventListener('play', () => mState());
aud.addEventListener('pause', () => mState());
mplayer.addEventListener('click', () => aud.paused ? aud.play() : aud.pause());
})();

</script>

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

<DIV style="HEIGHT: 50px">

梦江南 发表于 2025-7-12 15:24

欣赏老师的精彩制作。问好!{:4_199:}

亦是金 发表于 2025-7-12 15:46

梦江南 发表于 2025-7-12 15:24
欣赏老师的精彩制作。问好!

问好老师!谢谢欣赏!{:4_190:}

红影 发表于 2025-7-12 16:07

很浪漫的制作,美好温馨的场景。
欣赏亦是金老师好帖{:4_199:}

亦是金 发表于 2025-7-12 18:08

红影 发表于 2025-7-12 16:07
很浪漫的制作,美好温馨的场景。
欣赏亦是金老师好帖

问好红影!谢谢欣赏点赞!{:4_187:}

红影 发表于 2025-7-12 20:48

亦是金 发表于 2025-7-12 18:08
问好红影!谢谢欣赏点赞!

问好亦是金老师,这制作很漂亮{:4_199:}

亦是金 发表于 2025-7-13 08:51

红影 发表于 2025-7-12 20:48
问好亦是金老师,这制作很漂亮

早上好!谢谢夸奖!{:4_187:}

红影 发表于 2025-7-13 10:51

亦是金 发表于 2025-7-13 08:51
早上好!谢谢夸奖!

问好亦是金老师,周日快乐{:4_187:}

偶然~ 发表于 2025-11-17 15:25

音画唯美

偶然~ 发表于 2025-11-17 15:25

歌声动听

偶然~ 发表于 2025-11-17 15:25

制作大气

偶然~ 发表于 2025-11-17 15:25

音画合一,音乐与画面结合完美

偶然~ 发表于 2025-11-17 15:25

玫瑰花☆╮╮芍药花☆╮╰☆☆╮合欢花花~【*偶然 献花给你啦】

偶然~ 发表于 2025-11-17 15:25

感谢亦是金带来的精彩,辛苦了!祝你开心幸福、阖家安康!
页: [1]
查看完整版本: 《爱情慢慢摇》 - 老 猫