月圆花好 TO红影
<div class="t_fsz">
<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_1952254">
<br /><br /><style>
#papa{ margin: 10px -300px;width: 1164px;box-shadow: 0px 0px 0px 2px #cccccc, 0px 0px 0px 6px #880000; overflow: hidden;height: 640px;background:#000000;border: 1px solid;display: grid;position: relative;z-index: 12345; --state: running;}
#mplayer {position:absolute;top:90%;left:2%;cursor: pointer;font: normal 1.6em/0em 华文隶书;
color:#fff000;z-index: 1650;animation: rot 0.5s linear infinite;}
@keyframes rot{0% {opacity: 1;transform: scale(1);}100% {opacity: 1;transform:scale(1);filter:hue-rotate(360deg)contrast(100%)brightness(250%);}}
#lrc {
--state: paused;
--motion: cover2;
--tt: 2s;
--bg: linear-gradient(0deg, #ff0000, #ff0000, #ff0000);
position: absolute;z-index: 6;
left: 52%;
transform: translate(-50%);
top: 85%;
font:normal 1.9em 华文新魏;
font-weight:200;
color: #000080;
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{0% { width: 0%;transform:rotateY(0deg)scale(1)}100% { width: 100%;transform:rotateY(0deg)scale(1);filter:hue-rotate(360deg)}}
@keyframes cover2 { 0% { width: 0%;transform:rotateY(0deg)scale(1)}100% { width: 100%;transform:rotateY(0deg)scale(1);filter:hue-rotate(360deg)}}
.photo {width: 100%;
height: 100%;
position: absolute;z-index: 4;
top:0px; left:0px;
opacity: 0;
animation: round 30s linear infinite;}
@keyframes round{
0% {opacity: 1;transform: scale(1);filter:blur(1px)}
5% {opacity: 1;transform: scale(1);filter:hue-rotate(360deg)contrast(120%)brightness(120%);}
10% {opacity: 1;transform: scale(1);}
27% {opacity: 1;transform:scale(4)rotateY(0deg);filter:blur(0px)}
28% {opacity: 0;transform:scale(4)rotateY(0deg);filter:blur(2px)}
}
.photo:nth-child(1) {animation-delay: 24s;background: url('https://pic.imgdb.cn/item/64ee9ea2661c6c8e547a5a37.jpg') no-repeat center/cover;}
.photo:nth-child(2) {animation-delay: 18s;background: url('https://pic.imgdb.cn/item/64ee9eb9661c6c8e547a646c.jpg') no-repeat center/cover;}
.photo:nth-child(3) {animation-delay: 12s;background: url('https://pic.imgdb.cn/item/64ee9ed2661c6c8e547a67ee.jpg') no-repeat center/cover;}
.photo:nth-child(4) {animation-delay: 6s;background: url('https://pic.imgdb.cn/item/64ee9ee9661c6c8e547a6a44.jpg') no-repeat center/cover;}
.photo:nth-child(5) {animation-delay: 0s;background: url('https://pic.imgdb.cn/item/64ee9f05661c6c8e547a6e44.jpg') no-repeat center/cover;}
.stop .photo:nth-child(1){animation-play-state: paused;}
.stop .photo:nth-child(2){animation-play-state: paused;}
.stop .photo:nth-child(3){animation-play-state: paused;}
.stop .photo:nth-child(4){animation-play-state: paused;}
.stop .photo:nth-child(5){animation-play-state: paused;}
#dt{position: absolute;top:0%; left:0%;width: 100%;height: 100%;z-index: 4;mix-blend-mode: lighten; }
#papa:hover #fullscreen { display:block ;}
#fullscreen { position: absolute; top:5%; left:83%;color:#ffffff; filter:drop-shadow( 1px 1px 1px #000000);font: normal 1.6em华文新魏; opacity: 1; cursor: pointer; z-index: 1660}
</style>
<div id="papa">
<div id="Img" >
<div class="photo" ></div>
<div class="photo" ></div>
<div class="photo" ></div>
<div class="photo" ></div>
<div class="photo" ></div>
</div>
<div id='dt' ></div>
<span id="fullscreen">全屏观赏</span>
<div id="lrc" data-lrc="月圆花好">月圆花好</div>
<div id="mplayer" ><span id="bf">暂停</span></div>
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=1499474357.mp3" autoplay="" loop=""></audio>
</div>
<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); /*获得歌词数组*/
})();
let fs = true;
fullscreen.onclick = () => {
fs ? (fullscreen.innerText = '退出全屏',papa.requestFullscreen()) : (fullscreen.innerText = '全屏观赏', document.exitFullscreen());
fs = !fs;
};
</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 imagee= document.getElementById("Img");
var image= document.getElementById("testImg");
var aud= document.getElementById('aud');
var mplayer=document.getElementById("bf");
mplayer.onclick = function() {
if ( bf.innerText == '暂停') {
image.stop();aud.pause(); imagee.classList.add('stop');
bf.innerText="播放";
} else {
image.play();aud.play(); imagee.classList.remove('stop');
bf.innerText="暂停";
}
};
</script>
</td></tr></table> 图美、曲好。
祝影子快乐!
祝东篱闲人快乐! 这么多民国美女啊。真漂亮。谢谢东篱大哥好礼,很喜欢{:4_187:} 梦油 发表于 2023-8-30 10:08
图美、曲好。
祝影子快乐!
祝东篱闲人快乐!
祝老梦更快乐!{:5_112:} 红影 发表于 2023-8-30 10:14
这么多民国美女啊。真漂亮。谢谢东篱大哥好礼,很喜欢
嗯嗯,你和她拼一拼。。。。。{:5_116:} 东篱闲人 发表于 2023-8-30 10:19
嗯嗯,你和她拼一拼。。。。。
人家是名媛,俺就一个上班族,怎么比啊{:4_173:} 梦油 发表于 2023-8-30 10:08
图美、曲好。
祝影子快乐!
祝东篱闲人快乐!
多谢梦油,也祝你快乐{:4_187:} 东篱大哥好贴!赞一个!{:4_187:} 老头是网易音乐吧,手机听不到,去黒黑分享的链接去注册一个上传空间,可以上传还可以做频谱音乐 红影 发表于 2023-8-30 10:21
人家是名媛,俺就一个上班族,怎么比啊
你比名媛更名。。。。{:5_116:} 焱鑫磊 发表于 2023-8-30 10:32
东篱大哥好贴!赞一个!
受你那个图的启发。。。{:5_117:} 醉美水芙蓉 发表于 2023-8-30 11:27
欣赏老师佳作!
芙蓉喝水。。。{:4_190:} 小辣椒 发表于 2023-8-30 11:32
老头是网易音乐吧,手机听不到,去黒黑分享的链接去注册一个上传空间,可以上传还可以做频谱音乐
坚决不注册,俺没有注册的习惯。。。。{:5_106:} 东篱闲人 发表于 2023-8-30 11:36
坚决不注册,俺没有注册的习惯。。。。
那我手机都听不到了{:4_198:} 小辣椒 发表于 2023-8-30 11:44
那我手机都听不到了
上电脑就好了。。。{:5_117:} 东篱闲人 发表于 2023-8-30 12:15
上电脑就好了。。。
现在上电脑时间少,做播放器都来不及 东篱闲人 发表于 2023-8-30 11:34
你比名媛更名。。。。
我只剩下身份证上的名了{:4_189:} 东篱闲人 发表于 2023-8-30 10:18
祝老梦更快乐!
老哥们儿一起快乐! 红影 发表于 2023-8-30 10:22
多谢梦油,也祝你快乐
这真是一件好礼物。
页:
[1]
2