当风解开思念的结 - 门丽【控】
本帖最后由 亚伦影音工作室 于 2023-9-15 09:39 编辑 <br /><br /><style >#papa{margin: 10px -300px ;width: 1164px;overflow: hidden;height: 780px;background: url(https://pic.imgdb.cn/item/6502b5e5661c6c8e54e629a5.png)repeat center/100% 100%;position: relative;z-index: 20;}
#biank{width:77%;height:61%;position: absolute;top:7%; left:11%;box-shadow: 0px 0px 0px 2px #cccccc, 0px 0px 0px 4px #000000; overflow: hidden;background:#000000 ;}
.photo {width: 100%;
height: 180%;
position: absolute;z-index: 2;
top:0px; left:0px;
opacity: 0;
animation: round 60s linear infinite;-webkit-mask-image: radial-gradient(black 100% ,transparent 100%);}
@keyframes round{
0% {
-webkit-transform:rotate(0)scale(1)translate(0%,0%);filter:hue-rotate(360deg);
opacity:1}
10% {
-webkit-transform:rotate(0)scale(1)translate(0%,-40%);filter:hue-rotate(0deg);
opacity:1}
18% {
-webkit-transform:rotate(0deg)scale(1)translate(0%,0%);filter:hue-rotate(0deg);
opacity:1}
22% {
-webkit-transform:rotate(0deg)scale(1)translate(0%,0%);filter:hue-rotate(0deg);
opacity:0}
}
.photo:nth-child(1) {animation-delay: 48s;background: url('https://pic.imgdb.cn/item/64fd5599661c6c8e5429c0e2.jpg') no-repeat center/cover;}
.photo:nth-child(2) {animation-delay: 36s;background: url('https://pic.imgdb.cn/item/6440cbff0d2dde57773ead84.jpg') no-repeat center/cover;}
.photo:nth-child(3) {animation-delay: 24s;background: url('https://pic.imgdb.cn/item/6440b79d0d2dde57772447d6.jpg') no-repeat center/cover;}
.photo:nth-child(4) {animation-delay: 12s;background: url('https://pic.imgdb.cn/item/6440cbd70d2dde57773e7877.png') no-repeat center/cover;}
.photo:nth-child(5) {animation-delay: 0s;background: url('https://pic.imgdb.cn/item/64fd530c661c6c8e542948df.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;}
#biank:hover #fullscreen { display:block ;}
#fullscreen { position: absolute; top:5%; left:80%;color:#FFffff; filter:drop-shadow( 1px 1px 1px #000000);font: normal 1.8em华文行楷; opacity: 1; cursor: pointer; z-index: 111}
#dt{position: absolute;top:0%; left:0%;z-index: 2;
width:100%;mix-blend-mode: lighten;
height:100%; transition: .3s all ease;}
#mplayer {top:2.5%; left:45.5%;z-index: 20;
position: absolute;
background: #Ff0000;
border: 2px solid #222222;
box-shadow: 0 0 0px #ff0000;
cursor: pointer;
width: 12px;
height: 12px;
border-radius: 50%;
animation: mm 0.3s infinite ;
}
@keyframes mm {
to { box-shadow: 0 0 30px white; }}
#audio{top:88%; left:0%;z-index: 6;
position: absolute;
width:100%;
cursor: pointer;
mix-blend-mode:lighten; filter:invert(100%)
}
#flyBox { --w: 90%; width: var(--w); overflow: hidden; color: #cccccc; position: absolute; left:3%;top:95%;font-size: 14px; z-index: 36;}
#flyBox div { word-break: keep-all; white-space: nowrap; animation: fly 60s linear infinite; background:#0000}
@keyframes fly { from { transform: translateX(100%); } to { transform: translateX(calc(0% - var(--w))); }}
</style>
<div id='papa'>
<div id="mplayer"></div>
<div id='biank'>
<div id="Img" >
<p class="photo" ></p>
<p class="photo" ></p>
<p class="photo" ></p>
<p class="photo" ></p>
<p class="photo" ></p>
</div>
<span id="fullscreen">全屏观赏</span>
<div id='dt'><img id="testImg" src="https://pic.imgdb.cn/item/64f84335661c6c8e54f84cc0.gif" width="100%" height="100%"></div>
<div id="lrc" data-lrc="亚伦影音工作室">亚伦影音工作室</div>
<div id='audio'>
<audio id="MusicPlayer" src="https://www.qqmc.com/mp3/music299045460.mp3"style="width:100%;"autoplay="autoplay" controls="controls" height="100%" loop="loop"></audio></div>
<div id="flyBox"><div>当风解开思念的结 - 门丽
词:周洪/赵润泽
曲:张潼瑶
原唱:门丽发行:亚伦影音工作室</div></div>
</div>
</div>
<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");
varbutton = document.getElementById("mplayer");
let mState = () => MusicPlayer.paused ?image.stop(): image.play();
MusicPlayer.addEventListener('play', mState,false);
MusicPlayer.addEventListener('pause', mState,false);
let fs = true;
fullscreen.onclick = () => {
fs ? (fullscreen.innerText = '退出全屏', biank.requestFullscreen()) : (fullscreen.innerText = '全屏观赏', document.exitFullscreen());
fs = !fs;
};
</script>
<style>
#lrc {
--state: paused;
--motion: cover2;
--tt: 2s;
--bg: linear-gradient(180deg, #880000, #880000);
position: absolute;
left: 50%;z-index: 20;
transform: translate(-50%);
top: 78%;
font:normal 3em 华文隶书;
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 = `当风解开思念的结 - 门丽
词:周洪/赵润泽
曲:张潼瑶
原唱:门丽
编混:可心文化娱乐工作室
制作人:赵润泽
监制:赵润泽
出品人:亚伦
出品:亚伦影音
美丽的邂逅是一场情劫
千言万语不忍说离别
飘落的花叶远去的蝴蝶
其中的无奈有谁了解
无声的眼泪浸湿了梦夜
心冷的像一层层冰雪
风也吹不开思念的摇曳
此时的牵挂给谁去写
当风解开了岁月的结
两心相悦才不忘誓约
看楼挂月 月缺月圆
再次相逢在花开时节
当风解开了思念的结
情意绵绵才不顾一切
看檐春燕 燕飞燕停
飞不出你花丛的蝴蝶
无声的眼泪浸湿了梦夜
心冷的像一层层冰雪
风也吹不开思念的摇曳
此时的牵挂给谁去写
当风解开了岁月的结
两心相悦才不忘誓约
看楼挂月 月缺月圆
再次相逢在花开时节
当风解开了思念的结
情意绵绵才不顾一切
看檐春燕 燕飞燕停
飞不出你花丛的蝴蝶
当风解开了岁月的结
两心相悦才不忘誓约
看楼挂月 月缺月圆
再次相逢在花开时节
当风解开了思念的结
情意绵绵才不顾一切
看檐春燕 燕飞燕停
飞不出你花丛的蝴蝶`;
/*变量 :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(); });
let lrcAr = getLrcAr(lrcStr); /*获得歌词数组*/
})();
</script>
<script>
var imagee = document.getElementById("Img"),
mplayer= document.getElementById("mplayer");
mplayer .onclick = function() {
if (this.value == '') {
imagee.classList.remove('stop');
this.value = '.';
} else {
imagee.classList.add('stop');
this.value = '';
}
};
</script>
亚伦新的背景出来了,漂亮的制作{:4_199:} 亚伦,现在这个播放器碰到一个问题,我做好发微信,手机要手动点击的,有时候会出来是白的播放器长条,这个可以设置手机也是自动播放可以吗 欣赏亚伦的精彩制作,效果特别的好{:4_178:} 小辣椒 发表于 2023-9-14 21:14
亚伦,现在这个播放器碰到一个问题,我做好发微信,手机要手动点击的,有时候会出来是白的播放器长条,这个 ...
手机的配置不同效果不一样,我用的小米手机,效果和电脑一样的,是自动播放的且一键控制! 亚伦影音工作室 发表于 2023-9-14 21:24
手机的配置不同效果不一样,我用的小米手机,效果和电脑一样的,是自动播放的且一键控制!
哦,那我是苹果 华为 oppo。好像不能直接出来 亚伦影音工作室 发表于 2023-9-14 21:24
手机的配置不同效果不一样,我用的小米手机,效果和电脑一样的,是自动播放的且一键控制!
感觉还是手机的浏览器问题 小辣椒 发表于 2023-9-14 21:31
感觉还是手机的浏览器问题
我用的是360 这个好漂亮,从之前的手机形状的图图变成了笔记本的,而且上面还有闪烁的视频头。
非常赞的制作,给亚伦老师点赞{:4_199:}
页:
[1]