《梦中的村落》 - 郭 玲
<div class="t_fsz"><table cellspacing="0" cellpadding="0">
<td class="t_f" id="postmessage_1846164">
<div style="z-index: 32768;position: absolute;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:30px;margin-LEFT: -310px;">
<metaname="referrer" content="never">
<video frameborder="0" src="https://lanye.org/api/xigua2.php?url=https://www.ixigua.com/7190364158326637113" autoplay muted loop="" controls="" style="MARGIN-TOP:0px;MARGIN-LEFT:0px;background:#000 ;width:1400px; height: 700px;-webkit-mask-image: radial-gradient(black 100%, transparent 100%);position:absolute;left:-80px;top:0px;"></video> </video>
<style>
#papa {
margin: auto;
left: 0px;
bottom: 0px;
width: 1200px;
height: 700px;
background: url('https://s1.ax1x.com/2023/03/23/ppwmpo8.png') center/cover no-repeat;
box-shadow: 3px 3px 0px #cccccc;
position: relative;
z-index: 1;
--state: paused;
}
#dt{position: absolute;top:3%; left:22%;z-index: 2;
width:40px;
height:40px; transition: .3s all ease;/*一定要加上不然看着突兀*/}
#mplayer {
width: 80px;
height: 160px;
left: 40px;
bottom: 150px;
background: black;
border-radius: 8px;z-index: 8;
box-shadow: 6px 4px 12px snow;
transition: .6s;
position: absolute;
pointer-events: none;
}
#mplayer::before,
#mplayer::after {
position: absolute;
content: '';
}
#mplayer::before {
width: 30px;
height: 30px;
left: calc(50% - 15px);
bottom: 15px;
border-radius: 50%;
background: #333;
pointer-events: auto;
cursor: pointer;
border: 2px solid snow;
box-shadow: 0 0 10px blue;
animation: flash .3s infinite alternate var(--state);
}
#mplayer::after {
content:attr(data-tt);
top: 6px; right: 6px; bottom: 60px; left: 6px;
background: #333;
color: lightblue;
font-size: 14px;
text-align: center;
padding: 4px;
white-space:pre;
}
#mplayer:active { transform: rotate(5deg); }
#vid { display: none; }
#canv {
position: absolute;
display: block;
top: 0px;
left: 0px;
width: 1200px;
height: 700px;
border-radius: 0%;
opacity: 1;
}
@keyframes flash {
to { box-shadow: 0 0 30px white; }
}
#fg{width: 100%;height: 100%;top:0px; left:0px;position: absolute; z-index: 3;animation: slider 3s linear infinite ;opacity: 0;}
@keyframes slider {0% { background: radial-gradient(ellipse 100% 100% at 51% 54%, rgba(0, 153, 247, 0.07) 19%,rgba(241, 23, 18, 0.91) 86%); } 50% {background: url(https://www.kumeiwp.com/sub/filestores/2022/11/21/8cc174354eb646c775ac6beaa058a5b3.png) 0 0/100% 100%;100%} { background: radial-gradient(ellipse 100% 100% at 51% 54%, rgba(0, 153, 247, 0.07) 19%,rgba(18, 181, 441, 0.91) 86%);} }
</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: -380px;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:40px;">《梦中的村落》 </span>
<span style="color:#3d46f7;"><span style="font-size:28px;"> - 郭 玲</span></div>
<div style="position: relative;width: 500px;height: 50px;top:600px;LEFT: 980px;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">
<div id="fg"></div>
<canvas id="canv"></canvas>
<divid="testBtn"><div id="mplayer" data-tt="欢迎欣赏 00:00 00:00">
</div></div>
<div data-lrc="亦是金在线音乐" id="lrc">亦是金在线音乐</div>
</div>
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=2020441717.mp3" autoplay loop></audio>
<video id="vid" src=" " loop autoplay muted></video>
<script>
let ctx = canv.getContext('2d');
let ww = canv.width = 1164, hh = canv.height =620;
let loop = () => {ctx.drawImage(vid, 0, 0, ww, hh);if(!vid.paused) {requestAnimationFrame(loop);return;}}
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 ? (papa.style.setProperty('--state', 'paused'),vid.pause()) : (papa.style.setProperty('--state', 'running'),vid.play());
vid.playbackRate = 0.5;
vid.addEventListener('play', loop, false);
aud.addEventListener('play', () => mState());
aud.addEventListener('pause', () => mState());
aud.addEventListener('timeupdate', () => mplayer.dataset.tt = '梦中村落\n\n' + toMin(aud.duration) + '\n' + toMin(aud.currentTime));
mplayer.addEventListener('click', () => aud.paused ? aud.play() : aud.pause());
fg.style.animationPlayState = aud.paused ? 'paused' : 'running';
aud.addEventListener('playing', () =>fg.style.animationPlayState = 'running');
aud.addEventListener('pause', () =>fg.style.animationPlayState = 'paused');
</script>
<style type="text/css">
#lrc {
--state: paused;
--motion: cover2;
--tt: 2s;
--bg: linear-gradient(180deg, #880000, #880000);
position: absolute;z-index: 4;
left: 50%;
transform: translate(-50%);
top: 70%;
font:normal 2.5em 微软简中圆;
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>
</td></tr></table>
<DIV style="HEIGHT: 500px"> 这个背景视频漂亮,歌词同步和播放器也漂亮,可是无法评分呢{:4_173:} 呀,我的回复也缩上去了,咋回事呢{:4_203:} 是的,怎么没有评分的空间?还越界占据了下一楼的空间!我不知道怎么修改代码!请黑黑老师和诸位大神指点,谢谢了! 我原来代码最后的两行是这样的
</td></tr></table>
<DIV style="HEIGHT: 500px">
现在发现变为
</td></tr></table>
<DIV style="HEIGHT: 500px"> </td></tr></table>
莫名多了一段 </td></tr></table>
不知道为什么? 我也曾把代码
</td></tr></table>
<DIV style="HEIGHT: 500px">
删除最后一行<DIV style="HEIGHT: 500px">去掉,
结果仍然出现帖子越界现象, 同样的代码,在这里使用就不会出现帖子越界现象呢。
http://43.226.74.150/forum.php?mod=viewthread&tid=14168&extra=page%3D1 不过最好把<DIV style="HEIGHT: 500px">,改为<DIV style="HEIGHT: 800px">。这样就有评分空间了
页:
[1]