《归途的光》 - 诺爷 Plus
<style>#papa {
width: 1200px;height: 710px;position:absolute; --state:paused;
box-shadow:0px 0px 1px 2px #045768, 0px 0px 0px 8px #99e5f5,0px 0px 5px 15px #045768;
overflow:hidden;border-radius:1%;display:grid; place-items:center;
margin-top:100px;margin-LEFT: -180px;
}
.vid { position: absolute; width: 1500px; height: 710px; object-fit: cover; }
.vid2 { position: absolute; width: 600px; height: 400px; object-fit: cover; }
.vid3 { position: absolute; width: 600px; height: 400px; object-fit: cover; }
#ptpu{
top: 350px;
left: 250px;
cursor: pointer;
position:absolute;
opacity: 1;
z-index: 4;
}
#canv {filter:hue-rotate(0deg)contrast(140%)brightness(80%);
position: absolute;
display: block;
height: 100%;
position: relative;
cursor: pointer;
z-index: 4;opacity: 0;
}
#baiBox {
width: 500px;
height: 50px;
text-align: center;
font-family:微软简中圆;
font-size: 2.0rem;
font-weight: bold;
color: #f46ff6;
transform-origin: top;
animation: yao 1.0s linear infinite alternate;
position:absolute;left:0px;top:30px;
}
@keyframes yao {
from{transform: perspective(800px) rotatex(30deg); }
to { transform: perspective(800px) rotatex(-30deg); }
}
.tit { position: relative;width: 500px;height: 30px;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) }
css-doodle { position: absolute; }
#canv {
filter:hue-rotate(0deg)contrast(140%)brightness(80%);
position: absolute;
display: block;
height: 100%;
position: relative;
cursor: pointer;
z-index: 4;opacity: 0;
}
#vid { display: none; }
#lrc { --motion: cover2; --tt: 1.5s; position: absolute; left: 50%;top:88%; transform: translate(-50%, 10px);font:normal 2.6em 华文行楷; color:#0000; z-index: 21; }
#lrc::before { position: absolute; content: attr(data-lrc); width: 100%; height: 100%; color: transparent; overflow: hidden; white-space: pre;background: linear-gradient(0deg, #1E9600 0%,#FFF200 50%,#FF0000 100%);background-size: 10vmin 125%;background-position: center center; filter: drop-shadow( 0px 0px 1px #000000)drop-shadow( 0px 0px 1px #000000); -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards; animation-play-state: var(--state); }
@keyframes cover1{0% {opacity: 0;transform: translatex(-600px);}
20% {opacity: 1;transform: scale(1,1);}
21% {opacity: 1;transform: scale(1,1);}
40% {opacity: 1;transform: scale(1,0);filter:brightness(800%)drop-shadow( 0px 0px 1px #000000)drop-shadow( 0px 0px 1px #000000)drop-shadow( 0px 0px 1px #000000);}
70% {opacity: 1;transform: scale(1,1);filter:brightness(800%)drop-shadow( 0px 0px 1px #000000)drop-shadow( 0px 0px 1px #000000)drop-shadow( 0px 0px 1px #000000);}
80% {opacity: 1;transform: scale(1,1);filter:brightness(800%)drop-shadow( 0px 0px 1px #000000)drop-shadow( 0px 0px 1px #000000)drop-shadow( 0px 0px 1px #000000);}
100% {opacity: 0.8;transform: translatex(200px)scale(.7);}
}
@keyframes cover2 {0% {opacity: 0;transform: translatex(0px);}
30% {opacity: 1;transform: scale(1,1);}
40% {opacity: 1;transform: scale(0,1);filter:brightness(800%)drop-shadow( 0px 0px 1px #000000)drop-shadow( 0px 0px 1px #000000)drop-shadow( 0px 0px 1px #000000);}
60% {opacity: 1;transform: scale(1,1);filter:brightness(800%)drop-shadow( 0px 0px 1px #000000)drop-shadow( 0px 0px 1px #000000)drop-shadow( 0px 0px 1px #000000);}
100% {opacity: 0.8;transform: translatex(200px)scale(.7);}
}
</style>
<div id="papa">
<video frameborder="0" class="vid" src="https://img.tukuppt.com/video_show/15653652/01/04/06/61411fc63ce01.mp4" autoplay muted loop="" controls="" style="MARGIN-TOP:0px;MARGIN-LEFT:0px;background:#000 ;width:1400px; height: 710px;-webkit-mask-image: radial-gradient(black 100%, transparent 100%);position:absolute;left:0px;top:0px; opacity: .9;"></video>
<video frameborder="0" class="vid3" src="https://img.tukuppt.com/video_show/2419216/00/01/99/5b50235ec3a92.mp" autoplay muted loop="" controls="" style="MARGIN-TOP: -30px;MARGIN-LEFT:0px;background:#000 ;width:1200px; height: 780px;-webkit-mask-image: radial-gradient(black 100%, transparent 100%);position:absolute;left:0px;top:0px; opacity: .4;"></video>
<metaname="referrer" content="never">
<video frameborder="0" class="vid2"src="https://img.tukuppt.com/video_show/2418175/01/16/56/61afef6ebde1b.mp4" autoplay muted loop="" controls="" style="MARGIN-TOP:0px;MARGIN-LEFT:0px;background:#000 ;width:1400px; height: 710px;-webkit-mask-image: radial-gradient(black 100%, transparent 100%);position:absolute;left:0px;top:0px; opacity: .7;"></video>
<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;"> - 诺爷Plus </span>
</div></div>
<div style="position:absolute;bottom:20px;right:30px;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:24px;"> 亦是金在线音乐 </span></span></span></p></div>
<div style="position:absolute;bottom:60px;left:20px;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)">
<p><span style="color:#3d46f7;"><span style="font-family:微软雅黑;"><span style="font-size:20px;"></span></span></span></p></div>
<div id="lrc" data-lrc="花潮lrc在线">花潮lrc在线</div>
<div id="ptpu">
<img id="testImg" src="https://z3.ax1x.com/2021/08/26/hujGMd.gi" width="1px" height="1px"></div>
<divstyle="width: 1200px;height: 710px;overflow:hidden;margin: 3% 70%;position: absolute;" >
<div id="but">
<css-doodle id="mplayer">
:doodle {
@grid: 2 / 500px 100px;
color: var(--color);
bottom: 70px;
left: 370px;
z-index: 999;
--prog: 0%;
--size: 60px;
--ttmsg1: '00:00';
--ttmsg2: '00:00';
--color: #edeb1d;
position:absolute;
}
/* 时间信息 : 左 */
@nth(1) {@place: 5% 100%; :after { content: var(--ttmsg1); } }
/* 控制器 */
@nth(2) {
@size: 60px;
@shape: windmill;
@place: 50% 35%;
background: var(--color);
animation: rot 6s infinite linear var(--state);
}
/* 时间信息 : 右 */
@nth(3) {
@place: 95% 100%;
:after { content: var(--ttmsg2); }
}
/* 进度条 */
@nth(4) {
@place: 50% 80%;
@size: 100% 2px;
background: Silver;
display: grid;
place-items: center start;
:before {
content: '';
width: var(--prog);
height: 100%;
background: var(--color);
}
}
@keyframes rot { to { transform: rotate(1turn); } }
</css-doodle>
<css-doodle grid="16" id="fFloat">
:doodle {
@size: 1150px 680px;
}
position: absolute;
left: @r(255)%;
top: -10%;
:after {
position: absolute;
content: '@p( ♬, ♪, ♩,♫, ∮,归途, 倔强, ✲,❤, ☺, 回家,出发, ★, ☆,love, ❄)';
color: @p(#ff0000,#ff0ff1,#f8a21b,#2bff0f,#1cdcf8,#5445ea,#faa615);
font-size: @r(15, 30)px;
}
animation: fall 40s @r(-6, 36)s infinite var(--state);
@keyframes fall {
from { transform: rotate(0deg) translate(0px); }
to { transform: rotate(@r(-250,160)deg) translate(-1500px); }
}
</css-doodle>
<css-doodle grid="20">
:doodle {@size: 1200px 700px;margin: 0% 0%;} @grid: 50x1 / 1200px 700px;
:container { perspective: 10vmin; }
pointer-events: auto;
background: @m(@r(30, 30),radial-gradient( @p(#ff0000,#00ff00,#fff000,#ffffff) 6%, transparent 20% )
@r(100%) @r(100%) / @r(1%, 3%) @lr no-repeat);
@size: 30%; @place-cell: center;
border-radius: 50%;
transform-style: preserve-3d; animation: scale-up 15s linear infinite var(--state); animation-delay: calc(@i * -.6s);
@keyframes scale-up { 0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0); } 10% { opacity: 1; } 95% { transform: translate3d(0, 0, @r(50vmin, 55vmin)) rotate(@r(-360deg, 360deg)); }100% { opacity: 0; transform: translate3d(0, 0, 1vmin); } }
</css-doodle>
</div>
</div>
<canvas id="canv"></canvas>
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=2643164201.mp3" autoplay loop></audio>
</div>
<script>
let ctx = canv.getContext('2d');
let ww = canv.width = papa.offsetWidth, hh = canv.height = papa.offsetHeight;
let loop = () => {
ctx.drawImage(vid, 0, 0, ww, hh);
if(!vid.paused) {
requestAnimationFrame(loop);
return;
}
}
let mState = () => aud.paused ? ( mplayer.style.setProperty('--state', 'paused'), vid.pause()) : ( mplayer.style.setProperty('--state', 'running'), vid.play());
vid.addEventListener('play', loop, false);
aud.addEventListener('play', () => mState());
aud.addEventListener('pause', () => mState());
mypic.addEventListener('click', () => aud.paused ? aud.play() : aud.pause());
</script>
<script>
(function() {
let slip = 0.5, mFlag = true, mKey = 0, clickIdx = 0, progChg = 0, cursors = ['default','pointer','pointer'];
let script = document.createElement('script');
script.src = 'https://unpkg.com/css-doodle@0.34.9/css-doodle.min.js';
document.head.appendChild(script);
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 = () => mplayer.style.setProperty('--state', aud.paused ? 'paused' : 'running');
aud.addEventListener('play', mState, false);
aud.addEventListener('pause', mState, false);
aud.addEventListener('timeupdate', () => {
mplayer.style.setProperty('--ttmsg1', `'${toMin(aud.currentTime)}'`);
mplayer.style.setProperty('--ttmsg2', `'${toMin(aud.duration)}'`);
mplayer.style.setProperty('--prog',`${100 * aud.currentTime / aud.duration}%`)
});
mplayer.onclick = (e) => {
if(e.offsetX > 130 && e.offsetX < 170 && e.offsetY < 46) aud.paused ? aud.play() : aud.pause();
if(e.offsetY > 46) aud.currentTime = aud.duration * e.offsetX / mplayer.offsetWidth;
}
})();
</script>
<script >
(function() {
/*原始lrc歌词*/
let lrcStr = `
《归途的光》 — 诺爷Plus
词曲: 徐大耳朵/胡静宜
编曲: 武圣雄
歌词编辑:亦是金
. . . . . .
离家的车 已开走 多少时光
骄傲的少年 早不复那 固执模样
将理想的行囊 丢进现实的远方
每天想的念的都是 那头顶的月光
出发的站 又开始 匆匆忙忙
告别的声音 却洋溢着 幸福响亮
再繁华的城市 也不及她的身旁
快回去听她说说 对你未来的愿望
愿那归途的光 温暖你倔强的脸庞
愿那自由的风 吹起你心里的滚烫
愿那问候的话 卸下你坚毅的伪装
愿那等待的人 是你 一生所想
愿那归途的光 照亮你眼中的前方
愿那自由的风 吹散你身后的彷徨
愿那深夜的灯 重燃你纯真的梦想
愿那枕边的爱 陪你 山高水长
. . . . . .
出发的站 又开始 匆匆忙忙
告别的声音 却洋溢着 幸福响亮
再繁华的城市 也不及她的身旁
快回去听她说说 对你未来的愿望
愿那归途的光 温暖你倔强的脸庞
愿那自由的风 吹起你心里的滚烫
愿那问候的话 卸下你坚毅的伪装
愿那等待的人 是你 一生所想
愿那归途的光 照亮你眼中的前方
愿那自由的风 吹散你身后的彷徨
愿那深夜的灯 重燃你纯真的梦想
愿那枕边的爱 陪你 山高水长
愿那归途的光 温暖你倔强的脸庞
愿那自由的风 吹起你心里的滚烫
愿那问候的话 卸下你坚毅的伪装
愿那等待的人 是你 一生所想
愿那归途的光 照亮你眼中的前方
愿那自由的风 吹散你身后的彷徨
愿那深夜的灯 重燃你纯真的梦想
愿那枕边的爱 陪你 山高水长
- 谢谢欣赏 -
`;
/*变量 :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("but");
button.onclick = function() {
if (this.value == '') {
image.play();
this.value = '.';
} else {
image.stop();
this.value = '';
}
};
(function() {
let vid = document.querySelector('.vid');
let script = document.createElement('script');
script.src = 'https://unpkg.com/css-doodle@0.34.8/css-doodle.min.js';
document.head.appendChild(script);
let mState = () => aud.paused ? (papa.style.setProperty('--state', 'paused'), vid.pause()) : (papa.style.setProperty('--state', 'running'), vid.play());
aud.addEventListener('play', mState, false);
aud.addEventListener('pause', mState, false);
mplayer.onclick = () => aud.paused ? aud.play() : aud.pause();
})();
(function() {
let vid2 = document.querySelector('.vid2');
let mState = () => aud.paused ? (papa.style.setProperty('--state', 'paused'), vid2.pause()) : (papa.style.setProperty('--state', 'running'), vid2.play());
aud.addEventListener('play', mState, false);
aud.addEventListener('pause', mState, false);
mplayer.onclick = () => aud.paused ? aud.play() : aud.pause();
})();
(function() {
let vid3 = document.querySelector('.vid3');
let mState = () => aud.paused ? (papa.style.setProperty('--state', 'paused'), vid3.pause()) : (papa.style.setProperty('--state', 'running'), vid3.play());
aud.addEventListener('play', mState, false);
aud.addEventListener('pause', mState, false);
mplayer.onclick = () => aud.paused ? aud.play() : aud.pause();
})();
</script>
<DIV style="HEIGHT: 750px"> 问好ysj147友友,谢谢精彩分享 约会阳光 发表于 2025-1-5 22:07
问好ysj147友友,谢谢精彩分享
问好约会阳光,谢谢欣赏!:lol 嵌入的二个视频相叠,画面更为绚丽,LRC编写合拍,歌曲悦耳动听,歌曲寄怀!赞,问好老师! 问好ysj147老师,谢谢精彩分享,点赞!:handshake{:1_293:}
页:
[1]