亚伦影音工作室 发表于 2024-2-10 11:32

祝福大家新年好

本帖最后由 亚伦影音工作室 于 2024-2-10 21:41 编辑 <br /><br /><style>
#papa {margin: 10px -300px;
        width: 1164px;
        height: 640px;
        background:#333 url('https://pic.imgdb.cn/item/645088790d2dde577794490d.jpg') no-repeat center/cover;
        box-shadow: 0px 0px 0px 2px #cccccc, 0px 0px 0px 8px #880000;
        position: relative;overflow: hidden;
        z-index: 12345;
}
#mb{ position: absolute; width: 100%; height: 100%; top:0%;   opacity: 1;z-index: 2; background:linear-gradient(0deg, #000000 10%,#Ffffff 11%,rgba(2, 2, 2, 0) 2%,rgba(52, 152, 219, 0) 47%,rgba(2, 2, 2, 0) 90%,#000000 100%,black 100%);}
#vid { position: absolute; width: 100%; height: 100%; top:0%; object-fit: cover; pointer-events: none;opacity: 1;z-index: 1; transition: 0.1s all ease; }
#papa::before { position: absolute; content: ''; inset: 0 0 0 0; background: url('https://pic.imgdb.cn/item/65c7424e9f345e8d033ddcc0.jpg') no-repeat center/cover; opacity: .8; transition: opacity .75s; -webkit-mask: url('https://638183.freep.cn/638183/web/svg/heart.svg') no-repeat center; -webkit-mask-size: 0%; animation: chgMask 15sinfinitealternate; z-index: 2;}
@keyframes chgMask { 20% { -webkit-mask-size: 0; } 100% { -webkit-mask-size: 400%; } }
#pic { position: absolute;transform-origin: 0% 0;transform:skew(-6deg); animation: swear 3s infinite alternate ; z-index: 3; top: 0px; left: 10px;width: 250px; height: 220px; }
@keyframes swear {0%{ transform: skew(3deg); } }
#picc{ position: absolute;transform-origin: 0% 0;transform:skew(3deg); animation: swearr 3s infinite alternate ; z-index: 3; top: -30px; right: 30px;width: 400px; height: 380px; }
@keyframes swearr {0%{ transform: skew(-3deg); } }
#mplayer {z-index: 90;
        position: absolute;
        top:93%; left:3%;
        bottom: 5px;
        width: 30px;
        height: 30px;
        border: 0px solid #cccccc;
        border-radius: 0%;
        opacity: 1;
        transition: .7s;
        display: grid;
        place-items: center;
        --disp1: 0; --disp2: 1;
}
#mplayer::before, #mplayer::after {
        position: absolute;
        content: '';
        border-style: solid;
        border-color: #cccccc;
        cursor: pointer;
        transition: .4s;
}
#mplayer::before {
        width: 0;
        height: 0;
        left: 12px;
        border-width: 10px 12px;
        border-color: transparent transparent transparent #cccccc;
        opacity: var(--disp1);
}
#mplayer::after {
        width: 2px;
        height: 20px;
        border-width: 0 4px 0 4px;
        opacity: var(--disp2);
}
@keyframes opa { to {opacity: 1;} }
#tmsg {position: absolute;z-index: 91;
      font: normal 15px sans-serif;
      color: #ffffff;
         top:93.5%;
      left:85%;}

#prog {position: absolute;z-index: 91;
      width: 76%;
      height: 0.3%;
      cursor: pointer;
         top:95%;
color: #cccccc;
box-shadow: 0px 0px 0.1px 0.1px #000000;
         left:7%;
border-radius: 2px;}
#papa:hover #fullscreen { display:block ;opacity: 1;}
#fullscreen { position: absolute; top:94.5%; left:calc(95% - 15px);font: normal 2em/0em 楷体;color:#ffffff; opacity: 1; cursor: pointer; z-index: 111}
#bt{ width: 500px; height: 50px;color: #00ff00; position: absolute; left:3%;top:3%;font-size: 24px; font-family:华文隶书;z-index: 21; animation: wz 20s linear infinite ; }
@keyframes wz {
50% {opacity: 1;filter:hue-rotate(0deg)contrast(100%)brightness(480%); left: 60%;}
}
#lrc { --motion: cover1; --tt: 2s; --state: paused; position: absolute; left: 50%; transform: translate(-50%); top: 80%; font: normal 3.5em 华文新魏; color:#ff0000; -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);z-index: 10}
#lrc::before { position: absolute; content: attr(data-lrc); width: 0%; height: 100%; color: transparent; overflow: hidden; white-space: pre; background:#000080 ; filter: #ffffff; -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards; animation-play-state: var(--state); }
@keyframes cover1{0% { width: 0%;filter: hue-rotate(360deg)brightness(150%)}
100% { transform: rotateY(0deg)rotatex(0deg);filter: hue-rotate(0deg)brightness(150%);width: 100%;}
}
@keyframes cover2 { 0% { width: 0%;filter: hue-rotate(360deg)brightness(150%)}
100% { transform: rotateY(0deg)rotatex(0deg);filter: hue-rotate(0deg)brightness(150%);width: 100%;}
}
</style>

<div id="papa">
<span id="fullscreen">全屏</span>
<div id="mb"></div>
<div id="bt">亚伦祝福大家新年快乐!</div>
<img id="pic" src="https://pic.imgdb.cn/item/65c708a19f345e8d039a3e0f.png" alt="" />
      <img id="picc" src="https://pic.imgdb.cn/item/65b9f53b871b83018af0d46a.png" alt="" />

<video id="vid"src="https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/9c4fae7387ff03256a97071e957d4b6b_preview.mp4" muted autoplay loop></video>
<div id="tmsg">00:00 | 00:00</div>
<divid="prog"></div>
<div id="mplayer"></div>
<div id="lrc" data-lrc="祝福大家新年快乐">祝福大家新年快乐</div>
</div>
<audio id="aud" src="https://mp3.t57.cn:7087/kwlink_d.php?id=256199761" loop autoplay></audio>
<script>

(function() {
/*原始lrc歌词*/
let lrcStr = `作词:刘俊
作曲:刘俊
舞曲制作:文华
原唱:刘俊/杨美华
男:新的一年又来到哪
家家户户放鞭炮呀
女:放鞭炮呀
男:大红灯笼高高挂呀
欢声笑语乐陶陶
女:欢声笑语乐陶陶
人人都在迎新年哪
穿着新衣带新帽
男:带新帽
女:一碗汤圆饺子包呀
阖家欢乐吉祥照
男:阖家欢乐吉祥照
祝福大家新年好
生活美满无烦恼
女:好运都围着你跑呀
一年四季财神到
男独白:恭喜发财
恭喜发财
男:祝福大家新年好
除旧迎新步步高
女:健康常伴平安罩呀
一年更比一年好
祝福论坛朋友新年快乐!      
男:人人都在迎新年哪
穿着新衣带新帽
女:带新帽
一碗汤圆饺子包呀
阖家欢乐吉祥照
男:阖家欢乐吉祥照
祝福大家新年好
生活美满无烦恼
女:好运都围着你跑呀
一年四季财神到
男独白:恭喜发财
恭喜发财
男:祝福大家新年好
除旧迎新步步高
女:健康常伴平安罩呀
一年更比一年好
男:祝福大家新年好
生活美满无烦恼
女:好运都围着你跑呀
一年四季财神到
男独白:恭喜发财
恭喜发财
男:祝福大家新年好
除旧迎新步步高
女:健康常伴平安罩呀
一年更比一年好
独白:祝大家新春快乐
万事如意
祝福大家身体安康,事事如意!
`;

/*变量 :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); /*获得歌词数组*/
})();

(function(){let mState = () => aud.paused ? (mplayer.style.setProperty('--disp1','1'), mplayer.style.setProperty('--disp2','0')) : (mplayer.style.setProperty('--disp1','0'), mplayer.style.setProperty('--disp2','1'));
mplayer.addEventListener('click', () => aud.paused ? aud.play() : aud.pause());
aud.addEventListener('play', () => mState());
aud.addEventListener('pause', () => mState());
})();
pic.style.animationPlayState = aud.paused ? 'paused' : 'running';
aud.addEventListener('playing', () =>pic.style.animationPlayState = 'running');
aud.addEventListener('pause', () =>pic.style.animationPlayState = 'paused');

picc.style.animationPlayState = aud.paused ? 'paused' : 'running';
aud.addEventListener('playing', () =>picc.style.animationPlayState = 'running');
aud.addEventListener('pause', () =>picc.style.animationPlayState = 'paused');
</script>
<script>
let fs = true;
      fullscreen.onclick = () => {
                fs ? (fullscreen.innerText = '退出', papa.requestFullscreen()) : (fullscreen.innerText = '全屏', document.exitFullscreen());
                fs = !fs;
      };
prog.onclick = (e) => {
                aud.currentTime = aud.duration * e.offsetX / prog.offsetWidth;
      }
aud.addEventListener('timeupdate', () => {
               aud.addEventListener('timeupdate', () => {prog.style.background= 'linear-gradient(90deg, red, red, red ' + aud.currentTime / aud.duration * 100 + '%, snow 0)';});
                tmsg.innerText = toMin(aud.currentTime) + ' | ' + toMin(aud.duration);

      });
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;
      };

/*控制视频*/
vid=document.querySelector('#vid');
mplayer.onclick =function() { aud.paused ? vid.pause(): vid.play() };
/*结束*/

/*控制文字颜色*/
dt.style.animationPlayState = aud.paused ? 'paused' : 'running';
aud.addEventListener('playing', () => dt.style.animationPlayState = 'running');
aud.addEventListener('pause', () =>dt.style.animationPlayState = 'paused');
/*结束*/


</script>

红影 发表于 2024-2-10 11:39

好喜庆的贺帖,借帖给全体坛友拜年,也给亚伦老师拜年了{:4_177:}

冬天的雨 发表于 2024-2-10 11:46

欣赏精彩贺帖{:4_187:}

冬天的雨 发表于 2024-2-10 11:46

祝楼主新年快乐!

亦是金 发表于 2024-2-10 12:38

祝亚伦老师新年快乐!

梦油 发表于 2024-2-10 13:56

亚伦朋友过年好!

樵歌 发表于 2024-2-10 17:03

亚伦老师新年好!

醉美水芙蓉 发表于 2024-2-10 17:16

醉美水芙蓉 发表于 2024-2-10 17:16

马黑黑 发表于 2024-2-10 18:41

{:4_199:}

起个网名好难 发表于 2024-2-10 19:03

节日快乐!
页: [1]
查看完整版本: 祝福大家新年好