《还是她最美》 黑鸭子(学习套用好难老师《一枝梅》帖)
<div class="t_fsz"><table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_2227969">
<meta name="referrer" content="never" >
<meta charset="utf-8">
<style>
#papa {
margin: 50px -150px0calc(50% - 680px);
width: 1200px;
height: 800px;
background:#000000 url(' ')no-repeat center / cover;
box-shadow: 0px 0px 0px 2px #cccccc, 0px 0px 0px 8px #880000;
position: relative;
overflow: hidden;
border-radius: 32px;
z-index: 12345;
}
</style>
<div id="papa">
<style>
@import url(https://file.uhsea.com/2403/f45f79bba93cd62f8603eae6fa88eb78YS.css);
:root {--rState:running;}
#oBlk {
--w:1200px;--h:800px;
width:var(--w);height:var(--h);
margin-left:calc(50% - 0.5 * var(--w));
overflow:hidden;
position:relative;
border-radius:32px;
box-shadow:4px 4px 10px black;
background:hsla(60, 50% , 80%, .4);
}
#oBlk img {
width:var(--w);height:var(--h);opacity:0;
position:absolute;left:0px;top:0px;
-webkit-mask-image: radial-gradient(black 20%, transparent 80%);
-webkit-mask-size: cover;z-index:1;
}
/** 不满意一般设置也可以调整下 */
.lrcShow {
font: normal 2.6em 楷体;
pointer-events:none;width:1.5em;height:80%;
filter: drop-shadow(1px 0px 0px white) drop-shadow(-1px 0px 0px white) drop-shadow(0px 1px 0px white) drop-shadow(0px -1px 0px white);
writing-mode: vertical-rl;z-index:99;left:15px;top:80px;color:hsla(240,60%, 90%, 0.7);
}
.lrcShow::before {
writing-mode: vertical-rl;
}
@keyframes bgMove0 { from { width: 100%; height: 0; } to { width: 100%; height: 100%; } }
@keyframes bgMove1 { from { width: 100%; height: 0; } to { width: 100%; height: 100%; } }
#processMeter {position: absolute; right:80%; bottom:45px; width: 220px; height:70px; cursor: pointer; z-index:999;}/*播放器位置 歌曲进度条大小设置 */
#mCtrl{transform-origin:50%;animation:rot 5s linear infinite var(--rState);}
@keyframes rot{to{transform: rotate(1turn)}}
</style>
<div id='oBlk'>
<img src="https://up.enterdesk.com/edpic/42/55/1f/42551f63fd1511abe712870cf0bf9207.jpg" alt="" />
<img src="https://up.enterdesk.com/edpic/1b/cf/1c/1bcf1c7bb71f65e358313c8c825d0391.jpg" alt="" />
<img src="https://up.enterdesk.com/edpic/cc/b5/82/ccb58257e8759312c36e0e2dc605ecf4.jpg" alt="" />
<img src="https://up.enterdesk.com/edpic/cd/8a/6c/cd8a6c1072cd343d9fd5b04e82e36cdb.jpg" alt="" />
<img src="https://up.enterdesk.com/edpic/1e/82/3c/1e823c8b1130ca8385651ed2883c3f33.jpg" alt="" />
<img src="https://up.enterdesk.com/edpic/a5/ce/6a/a5ce6a3224f1ae683e8567bd00ca8f58.jpg" alt="" />
<img src="https://up.enterdesk.com/edpic/c5/e5/4f/c5e54f851e9bf63d299940aaec723900.jpg" alt="" />
<div id="processMeter">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 100" id="svgObj">
<radialGradient r="0.8" id="rg">
<stop offset="0.1" stop-color="hsl(0, 70%, 50%)"></stop>
<stop offset="0.5" stop-color="hsl(10, 70%, 75%)"></stop>
<stop offset="1" stop-color="hsl(30, 70%, 90%)"></stop>
</radialGradient>
<path d="M 100 50 A 20 13.333333333333334 0 0 0 140 50 A 20 13.333333333333334 0 0 0 100 50 A 20 13.333333333333334 72 0 0 112.36067977499789 88.04226065180615 A 20 13.333333333333334 72 0 0 100 50 A 20 13.333333333333334 144 0 0 67.63932022500211 73.51141009169893 A 20 13.333333333333334 144 0 0 100 50 A 20 13.333333333333334 216 0 0 67.63932022500211 26.48858990830108 A 20 13.333333333333334 216 0 0 100 50 A 20 13.333333333333334 288 0 0 112.36067977499789 11.957739348193854 A 20 13.333333333333334 288 0 0 100 50 " fill-rule="evenodd" fill="url(#rg)" id="mCtrl"></path>
<g fill='none' stroke-width='5'>
<path d="M 40 97 C -120 -25,330 -25, 150 97" stroke="lightgray" id="bgc"></path>
<path d="M 40 97 C -120 -25,330 -25, 150 97" stroke="pink" id="fgc"></path>
</g>
<g text-anchor="middle" dominant-baseline="middle" fill="red" style="font-size:16px;">
<text x="82%" y="55%" id="durTime">00:00</text>
<text x="18%" y="55%" id="curTime">00:00</text>
</g>
</svg>
</div>
<div class="lrcShow" data-lrc="《还是她最美》"></div>
</div>
<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:-780px;LEFT: 0px;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:32px;">《 还 是 她 最 美 》 黑鸭子 </span>
<span style="color:#3d46f7;"><span style="font-size:24px;"></span></div>
<img src="https://z3.ax1x.com/2021/08/26/hujGMd.gif" alt="" style="position: absolute; width: 200px;height: 60px; transform: translate(250px, -250px); mix-blend-mode: normal;" />
/*小动画位置 大小设置*/
<div style="position: relative;width: 500px;height: 50px;top:-100px;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>
<script>
var sf0 = document.createElement('script');
sf0.type = 'text/javascript';
sf0.src = "https://file.uhsea.com/2410/739c572b5176f670f350463cf9ade957QB.js";
sf0.charset = "utf-8";
document.body.appendChild(sf0);
sf0.onload = () => {
const keyFrames = [
[
[
{offset: 0.0, opacity:0,transform:'scale(0.3)'},
{offset: 0.5, opacity:1,transform:'scale(1.05)'},
{offset: 0.7, opacity:1,transform:'scale(0.9)'},
{offset: 1.0, opacity:1,transform:'scale(1)'}
],
[
{offset: 0.0, transform:'scale(1)'},
{offset: 0.25,transform:'scale(0.95)'},
{offset: 0.75,transform:'scale(1.1)'},
{offset: 1.0, opacity:0,transform:'scale(0.3)'}
]
],
[
[
{offset:0, opacity:0, transform:'translateY(-30%)'},
{offset:1, opacity:1, transform:'translateY(0)'}
],
[
{opacity:1, transform:'translateY(0)'},
{opacity:0, transform:'translateY(30%)'}
]
],
[
[
{offset:0, transformOrigin:'left bottom',transform:'rotate(-90deg)',opacity:0},
{offset:1, transformOrigin:'left bottom',transform:'rotate(0)', opacity:1}
],
[
{offset:0, transformOrigin:'right bottom',transform:'rotate(0)', opacity:1},
{offset:1, transformOrigin:'right bottom',transform:'rotate(-90deg)', opacity:0}
]
],
[
[
{offset:0, transform:'perspective(400px) rotateX(90deg)',opacity:0 },
{offset:.4, transform:'perspective(400px) rotateX(-10deg)' },
{offset:.7, transform:'perspective(400px) rotateX(10deg)' },
{offset:1, transform:'perspective(400px) rotateX(0)', opacity:1 }
],
[
{offset:0, transform:'perspective(400px) rotateX(0)', opacity:1},
{offset:1, transform:'perspective(400px) rotateX(90deg)', opacity:0}
]
],
[
[
{offset:0, transform:'translateY(1200px) scale(.7)',opacity:.7},
{offset:.8,transform:'translateY(0) scale(.7)', opacity:.7},
{offset:1, transform:'scale(1)', opacity:1}
],
[
{offset:0, transform:'scale(1)',opacity:1},
{offset:.2,transform:'translateY(0) scale(.7)',opacity:.7},
{offset:1, transform:'translateY(700px) scale(.7)',opacity:.7}
]
],
[ // Roll in/out
[
{offset:0, transform: 'translateX(-800px) rotate(-540deg)', opacity: 0 },
{offset:1, transform: 'translateX(0) rotate(0deg)', opacity: 1 }
],
[
{offset:0, transform: 'translateX(0) rotate(0deg)', opacity: 1 },
{offset:1, transform: 'translateX(-1000px) rotate(-540deg)', opacity: 0 }
]
],
[
[ // PuFF in/out
{offset:0, transform: 'scale(2)', filter: 'blur(4px)', opacity: 0 },
{offset:1, transform: 'scale(1)', filter: 'blur(0px)', opacity: 1 }
],
[
{offset:0, transform: 'scale(1)', filter: 'blur(0px)', opacity: 1 },
{offset:1, transform: 'scale(2)', filter: 'blur(4px)', opacity: 0 }
]
],
[ // scale-in/out-center
[
{offset:0, transform: 'scale(0)', opacity: 1 },
{offset:1, transform: 'scale(1)', opacity: 1 }
],
[
{offset:0, transform: 'scale(1)', opacity: 1 },
{offset:1, transform: 'scale(0)', opacity: 1 }
]
]
];
const EffectTiming =
[
{
duration: 2000,
iterations: 1,
delay: 0,
fill: 'forwards'
},
{
duration: 2000,
iterations: 1,
delay: 9000,
fill: 'forwards'
}
];
const lrctxt = `
《还是她最美》
作词 : 悟义\n 作曲 : 小春\n歌手:黑鸭子\n* * * * * *\n我喜欢那朵未开的花蕾\n时常勾起了我初恋的回味\n心动的感觉无法表达\n以心传心有滋有味\n我喜欢那朵未开的花蕾\n微微的笑脸藏着含蓄美\n脉脉眼中情心领神会\n以情传情醉了心扉\n红尘滚滚满天飞\n千里有缘来相会\n花未全开月未圆\n山河也陶醉\n心地清清似春水\n一生相守也无悔\n花未全开月未圆\n还是她最美\n\n我喜欢那朵未开的花蕾\n时常勾起了我初恋的回味\n心动的感觉无法表达\n以心传心有滋有味\n我喜欢那朵未开的花蕾\n微微的笑脸藏着含蓄美\n脉脉眼中情心领神会\n以情传情醉了心扉\n红尘滚滚满天飞\n千里有缘来相会\n花未全开月未圆\n山河也陶醉\n心地清清似春水\n一生相守也无悔\n花未全开月未圆\n还是她最美\n红尘滚滚满天飞\n千里有缘来相会\n花未全开月未圆\n山河也陶醉\n心地清清似春水\n一生相守也无悔\n花未全开月未圆\n还是她最美\n谢谢欣赏 !\n
`;
let opts = {
lrcTxt:lrctxt,
audioURL:"https://music.163.com/song/media/outer/url?id=476254432.mp3",
}
let lrcPlayer = new lrcPlayerY(opts);
let imgSet = document.querySelectorAll('#oBlk > img');
let aniObjs = ;
function chg_cur_pic() {
let aniIdx = parseInt(Math.random() * keyFrames.length);
let Idx = parseInt(Math.random() * imgSet.length);
for(let i = 0; i < EffectTiming.length; i++) {
if(aniObjs) aniObjs.cancel();
//console.log(oBlk.offsetWidth,oBlk.offsetHeight);
aniObjs = imgSet.animate(keyFrames, EffectTiming);
}
aniObjs.onfinish = chg_cur_pic;
}
chg_cur_pic();
// 格式化时间数据
let formatTime = (time) => {
let min = ('' + parseInt(time / 60)).padStart(2,'0');
let sec = ('' + parseInt(time % 60)).padStart(2,'0');
return (`${min}:${sec}`);
};
// 计算/设置控制路径有关的数据
let circlePoints = [];
let bgcLen = bgc.getTotalLength();
fgc.style.strokeDasharray = bgc.style.strokeDasharray = bgcLen;
for(let i = 0; i < bgcLen; i++) {
circlePoints.push(bgc.getPointAtLength(i));
}
// 在 timeupdate 事件处理中添加与控制路径有关的处理
lrcPlayer.mObj.addEventListener('timeupdate', function() {
let processValue = lrcPlayer.mObj.currentTime / lrcPlayer.mObj.duration;
fgc.style.strokeDashoffset = bgcLen * (1 - processValue);
durTime.textContent = formatTime(lrcPlayer.mObj.duration);
curTime.textContent = formatTime(lrcPlayer.mObj.currentTime);
});
// 动态元素监测
let runState = () => {
lrcPlayer.mObj.paused
? (mCtrl.style.setProperty('--rState','paused'),aniObjs.forEach(aObj => {if(aObj) aObj.pause()}))
: (mCtrl.style.setProperty('--rState','running'),aniObjs.forEach(aObj => {if(aObj) aObj.play()}));
}
// SVG viewBox 与 实际尺寸的比值
let factorX = svgObj.viewBox.baseVal.width / svgObj.clientWidth;
let factorY = svgObj.viewBox.baseVal.height / svgObj.clientHeight;
//console.log(factorX, factorY);
// 歌曲进度条鼠标移动处理
let seeking = false;
let moveEventProc = (event) => {
if(!seeking) return;
let thePoint = 0, minV = 100;
circlePoints.forEach((point, idx ) => {
let mx = (point.x - event.offsetX * factorX), my = (point.y - event.offsetY * factorY);
let mv = mx*mx + my*my;
if(mv < minV) {
minV = mv; thePoint = idx;
}
})
let chkVal = thePoint / bgcLen;
let chkTime = lrcPlayer.mObj.duration * chkVal;
fgc.style.strokeDashoffset = bgcLen * (1 - chkVal);
let fIdx = false;
lrcPlayer.lrcVec.forEach((lrc,idx) => {
if(!fIdx && lrc.seconds >= chkTime ) {
fIdx = !fIdx; lrcPlayer.idx = idx;
lrcPlayer.mObj.currentTime = chkTime;
return fIdx;
}
});
};
fgc.addEventListener("mousemove", (event) => moveEventProc(event));
bgc.addEventListener("mousemove", (event) => moveEventProc(event));
fgc.onclick = bgc.onclick = (event) => seeking = !seeking;
// 歌曲、歌词 及 动态元素 启/停控制
mCtrl.onclick = () => {
lrcPlayer.mObj.paused ? (lrcPlayer.mObj.play()) : (lrcPlayer.mObj.pause());
}
lrcPlayer.mObj.addEventListener('play', () => runState());
lrcPlayer.mObj.addEventListener('pause', () => runState());
lrcPlayer.mObj.play().catch(_ = () => runState());
}
</script></td></tr></table> 图片尽显朦胧特效,图片切换式样灵动有序,歌曲甜美,蕴情,怡心,让人陶醉!赞,问好老师! 容轩听雨 发表于 2024-12-28 11:36
图片尽显朦胧特效,图片切换式样灵动有序,歌曲甜美,蕴情,怡心,让人陶醉!赞,问好老师!
谢谢容轩听雨版主欣赏点赞!{:1_292:}
页:
[1]