等我回来
本帖最后由 亚伦影音工作室 于 2026-11-8 18:32 编辑 <br /><br /><style>@import url("https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap");#papa{margin: 10px -250px;
width: 1286px;
height: 720px;
background:#880000;
box-shadow: 0px 0px 0px 2px #eee, 0px 0px 0px 8px #880000;
position: relative;overflow: hidden;
z-index: 12345;}
#loge {
position: absolute;
width: 12%;
height: 12%;
top: 390px;
animation:color1s linear 1.5s infinite;
left: 45px;
opacity: 1;
}
#sp {
position: absolute;
width: 65%;
height: 65%;
top: 40px;
object-fit: cover;
pointer-events: none;
left: 350px;
opacity: 1;
}
#xiaobo {z-index: 100;
width: 350px;
height: 220px;
margin: 100px 3%;
position: relative;
overflow: hidden;
--state:paused;
}
.hexahedron {width: 210px;
height: 210px;
margin: 0px 0px;
border: 2px solid #cccccc;
position: relative; z-index: 1;
background:#8B4513;border-radius: 8px;mask: radial-gradient(circle at 100% 50%,transparent 42px,#red 0%);-webkit-mask: radial-gradient(circle at 100% 50%,transparent 42px,red 0%); }
#cp { position: relative; top: 0px; left: 0px;width: 200px; height: 200px;transition: 2s;animation:opentop 0.5s 1 0s ;border-radius: 50%; box-shadow: 0px 0px 0px 2px #cccccc;}
#all {position: absolute;width:200px; height:200px;top: 6px; left: 115px;z-index: -1; transition: 2s; animation:tion3s linear 1.5s infinite}
@keyframes opentop { 0% {transform: translatex(-50px);} 100% { transform:rotateX(0px);}}
@keyframes tion { 0% {} 100% { transform:rotate(360deg) } }
#bnt{margin: 150px 2px ; width: 90px; height: 35px;position: absolute; cursor: pointer; z-index: 100;transition: all 1s;}
#cndpt{position: absolute; width: 100%; height: 100%;opacity:1;border-radius: 10px;
background: url(https://pic1.imgdb.cn/item/6a276eb33c9809430d38a9dc.png)no-repeat 0 0px/cover;}
#enopg{ position: absolute;width: 100%; height: 100%; border-radius: 10px;
opacity:0;background: url(https://pic1.imgdb.cn/item/6a276eb33c9809430d38a9dd.png)no-repeat 0 0px/cover;
}
#dt{margin: 0px 0px ; width: 200px; height: 200px;position: absolute; z-index: 10;transition: all 1s;}
#cndt{position: absolute; width: 100%; height: 100%; border-radius: 0px;opacity:1;
background: url(https://pic1.imgdb.cn/item/69fef2745a52df004a05f3e7.gif)no-repeat 0 0px/cover;}
#cnpg{ position: absolute;width: 100%; height: 100%; border-radius: 0px;opacity:0;
background: url(https://pic1.imgdb.cn/item/6a27757b3c9809430d38d152.png)no-repeat 0 0px/cover;
}
#tmsg {position: absolute;
font: 400 10px sans-serif;
color: #fff;
bottom: 10px;
left:140px;}
#prog {position:absolute;
width: 98%;
height: 2px;background:#aaa;
cursor: pointer;
top: 22%;border-radius: 10px;
left:1%;
position:relative;
}
#prog-bar {border-radius: 20px;
height: 100%;
background: #FF0000;
width: 0%;
position: relative;
}
#lyricWrap {position: absolute;
width: 100%;top: 86%; left: 0%;
font: 300 44px "华文隶书", serif;
text-align: center;
color: #fff;
text-shadow: 1px 1px 3px #000;
cursor: pointer;
user-select: none;
min-height: 48px;
line-height: 1.4;
}
@keyframes color { from {
filter: hue-rotate(0);
}
to {
filter: hue-rotate(360deg);
}
}
/* 进度条伪元素滑块 */
#prog-bar::after{
content:"";
position:absolute;
right:0;
top:50%;
transform: translate(50%,-50%);
width:10px;
height:10px;
border-radius:50%;
background:#ff0000;
box-shadow:0 0 4px #000000;
z-index:2;
}
/* 字由远到近推进【修复看不见】 */
@keyframes jumpSpin{
0%{
transform: scale(0.4);
opacity: 0.6;
}
100%{
transform: scale(1);
opacity: 1;
}
}
.lyric-char-active{
animation: jumpSpin 0.65s ease-out forwards,color1s linear 1.5s infinite;
transform-origin: center;
}
</style>
<div id="papa">
<video id="sp" src="https://img-baofun.zhhainiao.com/pcwallpaper_ugc/preview/d812148b62f3016a948bd35c0eadae75_preview.mp4" autoplay="" loop="" muted=""></video>
<div id="xiaobo">
<div class="hexahedron">
<div id="bnt" >
<div id="cndpt"></div>
<div id="enopg"></div>
</div>
<div id="dt" >
<div id="cndt"></div>
<div id="cnpg"></div>
<div id="tmsg">00:00/00:00</div>
</div>
</div>
<div id="all">
<img src="https://pic1.imgdb.cn/item/69e5e442198dd6f8d6ac9407.png"id="cp" />
</div>
</div>
<img id="loge" src="https://www.panurl.cn/view.php/6ecfb13be39ce8b9ef64613adb8a2422.png" />
<div id="prog" title="播放进度条"><div id="prog-bar"></div></div>
<div id="lyricWrap"></div>
</div>
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=3431156783.mp3" loop autoplay>
<script>
//原有播放器逻辑
aud.addEventListener('pause', () => mState());
aud.addEventListener('playing', () => mState());
bnt.onclick = () => aud.paused ? (aud.play(), sp.play(),all.style.left = '115px',enopg.style.opacity= '0',cndpt.style.opacity = '1',
cndt.style.opacity= '1',cnpg.style.opacity= '0',all.style.animationPlayState = 'running') : (aud.pause(),sp.pause(),all.style.left = '30px',enopg.style.opacity = '1',cndpt.style.opacity = '0',cndt.style.opacity= '0',cnpg.style.opacity= '1',all.style.animationPlayState = 'paused');
// ========= 拖拽进度条 =========
var isDragging = false;
prog.onmousedown = function(e){
isDragging = true;
updateProgressByMouse(e);
};
function updateProgressByMouse(e){
if(!aud.duration) return;
var rect = prog.getBoundingClientRect();
var x = e.clientX - rect.left;
if(x < 0) x = 0;
if(x > rect.width) x = rect.width;
aud.currentTime = aud.duration * x / rect.width;
}
document.addEventListener('mousemove',function(e){
if(isDragging){
updateProgressByMouse(e);
}
});
document.addEventListener('mouseup',function(){
isDragging = false;
});
var progBar = document.getElementById('prog-bar');
aud.addEventListener('timeupdate', () => {
if(!isDragging){
varpercent= (aud.currentTime / aud.duration) * 100;
progBar.style.width = percent + '%';
}
});
aud.addEventListener('timeupdate', () => {
tmsg.innerText = toMin(aud.currentTime) + ' | ' + toMin(aud.duration);});
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;
};
</script>
<script>
var aud = document.getElementById("aud");
var wrap = document.getElementById("lyricWrap");
var rainbowColors = [
"#ff2a2a",
"#ff7a00",
"#ffcc00",
"#22cc22",
"#00aaff",
"#6666ff",
"#ff55ff"
];
var lrcText = `《等我回来》
作词:董慧
作曲:董慧
演唱:央金拉姆
出品 亚伦影音工作室
阿妈说山那边是远方
可我的思念翻过了山岗
每天打酥油茶都在想
你的笑容比太阳还亮
等我回来 等我回来
草原的花开你别忘摘
等我回来 等我回来
格桑花下我们还相爱
转经筒转了多少圈
每一圈都是你的名字
放羊的时候我唱歌
山风会把思念吹给你
等我回来 等我回来
草原的花开你别忘摘
等我回来 等我回来
格桑花下我们还相爱
你知道吗 月亮圆了三次了
我数着日子 就像数念珠
弦子一响 我就想起你
等我回来 等我回来
山不会倒 我等你在
等我回来 等我回来
这辈子就认准你了
`;
var lrcAr = [];
var charList = [];
var currentLineIndex = -1;
var scanDuration = 3.5;
function timeToSec(str) {
var t = str.match(/\d+/g);
return Number(t) * 60 + Number(t) + Number(t || 0) / 1000;
}
function parseLrc(lrc) {
var reg = /\[(\d{1,}:\d{1,}(?:\.\d{1,})?)\](.*)/g;
var arr = [];
var m;
while ((m = reg.exec(lrc)) !== null) {
arr.push(), m.trim()]);
}
return arr;
}
function renderLine(text) {
wrap.innerHTML = "";
charList = [];
for (var i = 0; i < text.length; i++) {
var span = document.createElement("span");
span.textContent = text;
span.style.display = "inline-block";
span.style.color = "#cccccc";
wrap.appendChild(span);
charList.push({
dom: span,
color: rainbowColors,
done: false
});
}
}
function syncLyric() {
var t = aud.currentTime;
var idx = -1;
for (var i = 0; i < lrcAr.length; i++) {
var nextT = lrcAr ? lrcAr : 9999;
if (t >= lrcAr && t < nextT) {
idx = i;
}
}
if (idx === -1) {
requestAnimationFrame(syncLyric);
return;
}
var line = lrcAr;
var start = line;
var text = line;
if (idx !== currentLineIndex) {
currentLineIndex = idx;
renderLine(text);
}
if (charList.length) {
var offset = t - start;
var progress = Math.min(offset / scanDuration, 1);
var lit = Math.floor(progress * charList.length);
for (var k = 0; k < charList.length; k++) {
if(k < lit && !charList.done){
charList.done = true;
charList.dom.style.color = charList.color;
charList.dom.classList.add("lyric-char-active");
}
}
}
requestAnimationFrame(syncLyric);
}
lrcAr = parseLrc(lrcText);
syncLyric();
</script>
欣赏亚伦老师好帖! 好听好看,效果漂亮,谢谢亚伦老师精彩分享 亚伦老师这个播放器好可爱!
页:
[1]