归途有风(DJ 阿卓版)【可控】
本帖最后由 亚伦影音工作室 于 2023-7-29 11:36 编辑 <br /><br /><style >#papa{margin: 10px -300px ;
width: 1164px;box-shadow: 0px 0px 0px 2px #cccccc, 0px 0px 0px 6px #880000; overflow: hidden;
height: 620px;
background: #333 url('https://img-baofun.zhhainiao.com/pcwallpaper_ugc/static/42014cb258802bb1fe7bc96506aedee3.jpg') no-repeat center/cover;
position: relative;z-index: 1;}
#papa::before{ position: absolute;top:0px; left:0px; content: ''; width: 100%; height: 100%; background:url('https://img-baofun.zhhainiao.com/pcwallpaper_ugc/static/42014cb258802bb1fe7bc96506aedee3.jpg') no-repeat center/cover; transition:2s;z-index: -2;transform:perspective(600px) rotateY(180deg)scale(1); }
#papa:hover::before { transform:perspective(600px) rotatey(0deg)scale(1);}
#papa:hover #fullscreen { display:block ;}
#fullscreen { position: absolute; top:5%; left:80%;color:#FFffff; filter:drop-shadow( 1px 1px 1px #000000);font: normal 3em华文隶书; opacity: 1; cursor: pointer; z-index: 1111}
#dt{position: absolute;top:0%; left:0%;z-index: 2;
width:100%;mix-blend-mode: lighten;
height:100%; transition: .3s all ease;}
#mplayer {top:85%; left:5%;z-index: 999;
position: absolute;
font: normal 7em/0em serif;
color:#ffffff;
cursor: pointer;
animation: spin 10s infinite linear;
}
@keyframes spin {0% { transform: rotate(360deg); }
}
</style>
<div id='papa'>
<div id="before" ></div>
<div id="testImg1" >
<div class="set">
<div><img src="https://365.tf/disk/tf/1676290871.png" alt="1"/></div>
<div><img src="https://365.tf/disk/tf/1676290871.png" alt="2"/></div>
<div><img src="https://365.tf/disk/tf/1676272017.png" alt="3"/></div>
<div><img src="https://365.tf/disk/tf/1676334769.png" alt="4"/></div>
<div><img src="https://365.tf/disk/tf/1676315333.png" alt="5"/></div>
<div><img src="https://365.tf/disk/tf/1676354932.png" alt="6"/></div>
<div><img src="https://365.tf/disk/tf/1676300401.png" alt="7"/></div>
</div>
<div class="set set2">
<div><img src="https://365.tf/disk/tf/1676290871.png" alt="1"/></div>
<div><img src="https://365.tf/disk/tf/1676290871.png" alt="2"/></div>
<div><img src="https://365.tf/disk/tf/1676272017.png" alt="3"/></div>
<div><img src="https://365.tf/disk/tf/1676334769.png" alt="4"/></div>
<div><img src="https://365.tf/disk/tf/1676315333.png" alt="5"/></div>
<div><img src="https://365.tf/disk/tf/1676354932.png" alt="6"/></div>
<div><img src="https://365.tf/disk/tf/1676300401.png" alt="7"/></div>
</div>
<div class="set set3">
<div><img src="https://365.tf/disk/tf/1676290871.png" alt="1"/></div>
<div><img src="https://365.tf/disk/tf/1676290871.png" alt="2"/></div>
<div><img src="https://365.tf/disk/tf/1676272017.png" alt="3"/></div>
<div><img src="https://365.tf/disk/tf/1676334769.png" alt="4"/></div>
<div><img src="https://365.tf/disk/tf/1676315333.png" alt="5"/></div>
<div><img src="https://365.tf/disk/tf/1676354932.png" alt="6"/></div>
<div><img src="https://365.tf/disk/tf/1676300401.png" alt="7"/></div>
</div>
</div>
<span id="fullscreen">全屏观赏</span>
<div id='dt'><img id="testImg" src="https://img.365.tf/file/2023/07/05/y087m8.gif" width="100%" height="100%"></div>
<div id="lrc" data-lrc="亚伦影音工作室">亚伦影音工作室</div>
<div id="mplayer">🕸️</div>
</div>
<audio id="MusicPlayer" src="https://www.qqmc.com/mp3/music261874728.mp3" loop autoplay></audio>
<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;
}
}
};
}
let fs = true;
fullscreen.onclick = () => {
fs ? (fullscreen.innerText = '退出全屏', papa.requestFullscreen()) : (fullscreen.innerText = '全屏观赏', document.exitFullscreen());
fs = !fs;
};
</script>
<style>
#lrc {
--state: paused;
--motion: cover2;
--tt: 2s;
--bg: linear-gradient(0deg, #880000, #880000);
position: absolute;
left: 50%;z-index: 180;
transform: translate(-50%);
top: 85%;
font:normal 3.8em 华文隶书;
color: #0000;
white-space: pre;
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%;letter-spacing: 15px; color:#000090;}100% { width: 350%; letter-spacing: 0px;color:#ff0000; } }
@keyframes cover2 {0% { width: 0%;letter-spacing: 0px; color:#00ff00;}100% { width: 350%; letter-spacing: 15px;color:#ff0000; }}
</style>
<script >
(function() {
/*原始lrc歌词*/
let lrcStr = `
归途有风(DJ 阿卓版)
词:学松
曲:学松
编曲:DJ 阿卓
制作人:亚伦
OP:影音工作室
设计:亚伦
回望来时的颠簸
前路多少起和落
只为心中那盏灯火
万水千山都值得
不问去路多坎坷
可有拼出个结果
想到等你的那个人
忘了自己在漂泊
风吹你头上的霜啊
肩上的雨哟
脚下的南北东西
明天要吹你到哪里
不改心头的归期
风吹你身上的伤啊
身旁的雾哟
身后的山河万里
想起故乡那片暖阳
等着曾年少的你
我们奔波在路上
多少理想来又往
少年越过了千重浪
眼里还有万丈光
只要你别来无恙
翻山过海又何妨
想到熟悉的那张脸
归途就不再漫长
风吹你头上的霜啊
肩上的雨哟
脚下的南北东西
明天要吹你到哪里
不改心头的归期
风吹你身上的伤啊
身旁的雾哟
身后的山河万里
想起故乡那片暖阳
等着曾年少的你
漫漫前程还有多遥远的路
人山人海总有一条是归途
回头望
愿你拍去岁月落下的尘土
走多远 笑容依然如故
风吹你头上的霜啊
肩上的雨哟
脚下的南北东西
明天要吹你到哪里
不改心头的归期
风吹你身上的伤啊
身旁的雾哟
身后的山河万里
想起故乡那片暖阳
等着曾年少的你`;
/*变量 :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 (MusicPlayer.currentTime <= lrcAr) {
mKey = j - 1;
break;
}
}
if (mKey < 0) mKey = 0;
if (mKey > lrcAr.length - 1) mKey = lrcAr.length - 1;
let time = lrcAr - (MusicPlayer.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 = () => MusicPlayer.paused ? (lrc.style.setProperty('--state','paused'),mplayer.style.animationPlayState = 'paused') : (lrc.style.setProperty('--state','running'),mplayer.style.animationPlayState = 'running');
/*监听播放进度*/
MusicPlayer.addEventListener('timeupdate', () => {
for (j = 0; j < lrcAr.length; j++) {
if (MusicPlayer.currentTime >= lrcAr) {
cKey = j;
if (mKey === j) showLrc(lrcAr);
else continue;
}
}
});
MusicPlayer.addEventListener('pause', () => mState());/*监听暂停事件*/
MusicPlayer.addEventListener('play', () => mState());/*监听播放事件*/
MusicPlayer.addEventListener('seeked', () => calcKey());/*监听查询事件*/
mplayer.addEventListener('click', () => { MusicPlayer.paused ? MusicPlayer.play() : MusicPlayer.pause(); });
mplayer.style.animationPlayState = MusicPlayer.paused ? 'paused' : 'running';
MusicPlayer.addEventListener('playing', () =>mplayer.style.animationPlayState = 'running');
MusicPlayer.addEventListener('pause', () =>mplayer.style.animationPlayState = 'paused');
let lrcAr = getLrcAr(lrcStr); /*获得歌词数组*/
})();
var image = document.getElementById("testImg"),
image1 = document.getElementById("testImg1"),
button = document.getElementById("mplayer");
if (image && button) {
button.onclick = function() {
if (this.value == '') {
image.play(); image1.classList.remove('stop');
this.value = '.';
} else {
image.stop();image1.classList.add('stop');
this.value = '';
}
};
}
</script>
<style>
.set {top: 0;
left: 100px;
position: absolute;
width: 100%;
height: 100%;
}
.set div {
position: absolute;
display: block;
user-select: none;
}
.set div img {pointer-events: none;
max-width: 50px;
max-height: 80px;
}
.set div:nth-child(1) {
left: 20%;
animation: animate 15s linear infinite;
animation-delay: -7s;
}
.set div:nth-child(2) {
left: 50%;
animation: animate 20s linear infinite;
animation-delay: -5s;
}
.set div:nth-child(3) {
left: 70%;
animation: animate 25s linear infinite;
}
.set div:nth-child(4) {
left: 0%;
animation: animate 15s linear infinite;
animation-delay: -5s;
}
.set div:nth-child(5) {
left: 85%;
animation: animate 18s linear infinite;
animation-delay: -10s;
}
.set div:nth-child(6) {
left: 15%;
animation: animate 12s linear infinite;
animation-delay: -7s;
}
.set div:nth-child(7) {
left: 60%;
animation: animate 14s linear infinite;
animation-delay: -7s;
}
.stop .set div:nth-child(1) {
animation-play-state: paused;
}
.stop .set div:nth-child(2) {
animation-play-state: paused;
}
.stop .set div:nth-child(3) {
animation-play-state: paused;
}
.stop .set div:nth-child(4) {
animation-play-state: paused;
}
.stop .set div:nth-child(5) {
animation-play-state: paused;
}
.stop .set div:nth-child(6) {
animation-play-state: paused;
}
.stop .set div:nth-child(7) {
animation-play-state: paused;
}
@keyframes animate {
0% {
opacity: 0;
top: -10%;
transform: translateX(20px) rotate(0deg);filter:hue-rotate(30deg);
}
10% {
opacity: 1;
}
20% {
transform: translateX(-20px) rotate(45deg);
}
40% {
transform: translateX(-20px) rotate(90deg);
}
60% {
transform: translateX(-20px) rotate(135deg);
}
80% {
transform: translateX(-20px) rotate(180deg);
}
100% {
top: 110%;
transform: translateX(-20px) rotate(225deg);
}
}
.set2 {
transform: scale(2) rotateY(180deg);
filter: blur(2px);
}
.set3 {
transform: scale(0.8) rotateY(30deg);
filter: blur(4px);
}
</style>
樱 口一张,满屏玫瑰飘落。好赏心悦目的视屏。 又是一个漂亮的符号运用。欣赏亚伦老师好帖{:4_199:} 那些下落的花朵太大了些{:4_173:} 欣赏亚伦精彩的制作{:4_199:} 欣赏老师的佳作,收藏学习了。
页:
[1]