余生好好爱自己
本帖最后由 亚伦影音工作室 于 2026-11-26 18:13 编辑 <br /><br /><style>@import url("https://fonts.googleapis.com/css2?family=Liu+Jian+Mao+Cao&family=Long+Cang&family=Ma+Shan+Zheng&family=ZCOOL+KuaiLe&family=ZCOOL+QingKe+HuangYou&display=swap");#bj {
margin: 20px 0 0px calc(50% - 880px);
width: 1600px;
height: 900px;
background: url('https://img-baofun.zhhainiao.com/pcwallpaper_ugc/static/e7d78f540e4d8280d3e6aaab820ded99.jpg') no-repeat center/cover;
box-shadow: 0 0 0m1px gray;
overflow: hidden;
z-index: 1;
display: grid;
place-items: center;
position: relative;
}
/* 图片舞台:只放一张图,套水动滤镜 */
#waterBox{z-index: -1;
position:absolute;
width:100%; height:100%;
overflow:hidden;
left:0px; top:0;
}
#waterBox img{
width:100%; height:100%;
object-fit:cover;
filter:url(#water) ;
}
#cd{display: block;}
.song-list-containe {position: absolute;
margin-top: 10%;
margin-left: 10%;
color:#00aa00;
width:400px;
font:400 1.2em/0.1em 仿宋; column-count: 1;
}
.song-list {
list-style: none;
padding: 0;
color: #fff;
overflow-x: hidden;
}
.song-item {
padding: 1rem 1.5rem;
cursor: pointer;
}
.song-item:hover {
color: #00ff00;
}
.song-item.active {
color: #00aa00;
font-weight: 500;
}
/* 两竖列歌词样式 */
.lyrics-container {
position: absolute;
top:50%;
right:12%;
transform: translateY(-50%);
pointer-events: none;
z-index: 9;
font:300 45px/0px "Ma Shan Zheng","STKaiti";
letter-spacing:7px;
line-height:1.32;
}
.lyricCol{
display:inline-block;
vertical-align:top;
}
.lyricCol + .lyricCol{animation: wordWaveDrop 2s ease-out forwards, hueFlow 4s linear infinite;
margin-left:20px;
margin-top:1.4em;
}
.lyricCharItem{
position:relative;
display:block;
}
.lyricBase{
position:relative;
display:inline-block;
color:#cccccc;
text-shadow:1px 1px 0 #000,-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000;
}
.lyricRainbow{
position:absolute;
left:0;top:0;
display:inline-block;
clip-path: inset(0% 0% 100% 0);
text-shadow:1px 1px 0 #000,-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000;
}
@keyframes hueFlow{
0% { color:#ff2a2a; }
14.3%{ color:#ff7a00; }
28.6%{ color:#ffcc00; }
42.9%{ color:#22cc22; }
57.1%{ color:#00aaff; }
71.4%{ color:#6666ff; }
85.7%{ color:#ff55ff; }
100% { color:#ff2a2a; }
}
#bt{ --w: 74%; width: var(--w); overflow: hidden; color: #fff; position: absolute; left:71%;top:88%;font:normal 16px 仿宋;cursor:pointer;}
#bt { word-break: keep-all; white-space: nowrap; animation: bt 23s linear infinite; background:#0000}
@keyframes bt {50% { transform: translateX(calc(0% - var(--w))); }}
#bt:hover {
color: #00ff00;
animation-play-state: paused;
}
#bfq{
position:absolute;
width: 450px;
height:350px;overflow: hidden;
background:#0000;
transform:scale(.4);bottom: -100px;
left: -120px;z-index: 20;}
#cp{
position:absolute;
width: 240px;border-radius: 50%;
height:240px;animation: rotating 6s infinite linear;
top:18%;background:repeating-radial-gradient(black, black 5px, #1C1C1C 6px, #1C1C1C 7px);
cursor: pointer;
left: 12%;z-index: 1;box-shadow:0px 0px 0px 1px #fff,0px 0px 0px 0px #880000;}
@keyframes rotating { to { transform: rotate(360deg); } }
.overlay {
content: '';
left: 50%;
top: 50%; transform: translate(-50%, -50%);
position: absolute;
width: 238px;
height: 238px;
background: linear-gradient(45deg, transparent, 40%, rgba(255,255,255,0.25), 60%, transparent);
border-radius: 50%;
}
.inner {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 100px;
height: 100px;
box-shadow:0px 0px 0px 1px #eee,0px 0px 0px 2px #444;
background:#880000 url('') no-repeat center / cover;
border-radius: 50%;
}
.inner::before {
content: '';
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 15px;
height: 15px;
background: #ccc;
border-radius: 50%;
}
#cz {position: absolute;
top:6%; left:45%;z-index: 2;
width: 150px;background: url('https://pic1.imgdb.cn/item/6688e0dad9c307b7e9a7a3e1.png')no-repeat center/85%;
height: 300px;
cursor: pointer;
}
.pink { transform:rotate(5deg);transform-origin: 100% 0%;}
.purple {transform-origin: 80% 0%;margin: -4px -18px;transform:rotate(-9deg);}
#prog {position: absolute;z-index: 8;
width: 78%;
height: 2px;background:#ccc;
cursor: pointer;
bottom: 46px;
left:12%;
border-radius: 1px;}
#prog-bar {
height: 100%;
background: #FF0000;
width: 0%;
}
#tmsg {position: absolute;z-index: 8;
font: normal 12px sans-serif;
color: #ffffff;
bottom: 42px;
right: 40px;}
#fullscreen {border-radius: 4px;position: relative;background:#0000 ;
color:#fff;box-shadow:0px 0px 0px 1px #fff;
padding: 4px 10px;
font-size: 12px;
border: none;
cursor: pointer;margin: 8px 5px;left: 75%;top: 30px;
}
</style>
<divid="bj">
<div id="waterBox">
<img src="https://img-baofun.zhhainiao.com/pcwallpaper_ugc/static/063dac949ef633b04c607947f19a92af.jpeg" alt="">
<!-- 水动波纹滤镜定义 -->
<svg id="reflect" width="0" height="0" style="position:absolute;left:0;top:0;overflow:hidden;" aria-hidden="true">
<filter id="water" x="0%" y="0%" width="100%" height="100%">
<feTurbulence type="fractalNoise" baseFrequency=".007 .0045" numOctaves="2" seed="3" result="noise1"/>
<feColorMatrix in="noise1" type="hueRotate" values="0" result="noise2">
<animate attributeName="values" from="0" to="720" dur="2.6s" repeatCount="indefinite"/>
</feColorMatrix>
<feDisplacementMap xChannelSelector="R" yChannelSelector="G" scale="8" in="SourceGraphic" in2="noise2"/>
</filter>
</svg>
</div>
<div id="bfq">
<div id="cz"class="pink"></div>
<div id="cp"><div class="inner"></div> <div class="overlay"></div></div>
</div>
<div id="prog" title="播放进度条"><div id="prog-bar"></div></div>
<div id="tmsg">00:00|00:00</div>
<span id="fullscreen">全屏欣赏</span>
<div id="cd">
<div class="song-list-containe">
<p id="song-list" class="song-list"></p>
</div>
</div>
<div id="lyrics" class="lyrics-container w-full max-w-4xl"></div>
<div id="bt"><div>
</div>
<script>
var xmhy = [
["https://music.163.com/song/media/outer/url?id=3386678762.mp3","余生好好爱自己-睡眠火山",`《余生好好爱自己》
演唱:睡眠火山
RLC制作:潇湘翁
余生好好爱自己
这些年你总是在等
等别人满意
等别人认可
等别人心疼
却从来没有等一等
疲惫的自己
这些年你总是在忙
忙着懂事
忙着迁就
忙着照顾
忙着撑起一切
却从来没有犒劳过
忙碌的自己
余生好好爱自己
别再为谁受委屈
这一路多么不容易
希望你的真心被珍惜
这些年
你对得起所有人
唯独亏欠那个
一路咬牙撑到现在的自己
可是又有谁会来问问
你快乐吗
你累不累
所以你又何必为难自己
余生好好爱自己
别再为谁而哭泣
让自己开心
才是天经地义
`],
["https://music.163.com/song/media/outer/url?id=3389382984.mp3","你有没有真的爱过我-林知微",`《你有没有真的爱过我》
演唱:林知微
RLC制作:潇湘翁
风把信纸吹到了角落
你的背影在街头闪烁
雨滴很斑驳
打湿了院落
旧的相片随微风散落
你把日记丢在了长桌
墨水晕染开那句反驳
琴弦早断落
谁还在弹拨
只有窗外枯叶被剥落
时针停在古旧的铜锁
月光照亮了满地残破
树影太单薄
晚风正穿梭
飞鸟越过无人的沙漠
车票褪色我无法触摸
站台只剩昏暗的灯火
行李被冷落
双眼多浑浊
列车开往未知的漩涡
你有没有真的爱过我
为何转身你走得洒脱
手心曾紧握
如今却挣脱
誓言变成风中的泡沫
你有没有真的爱过我
哪怕一次短暂的停泊
像飞蛾扑火
像流星坠落
剧终人散任大雪淹没`],
["https://music.163.com/song/media/outer/url?id=3447491696.mp3","云能带我去见你-云卓拉姆",`《云能带我去见你》
演唱: 云卓拉姆
RLC编辑: 潇湘翁
如果云能带我去见你
我愿跟着云儿走千里
哪怕草原换了四季
我也不改这心意
如果云能带我去见你
我愿穿过千山奔向你
风也念你云也念你
我把牵挂放心里
我望着云儿飘向天际
每朵云都装着我情意
哪怕云儿随风远去
对你的情不会散去
我追着云儿翻过山脊
只愿和你不会再分离
若能换来与你相聚
我愿化作云陪伴你
如果云能带我去见你
我愿跟着云儿走千里
哪怕草原换了四季
我也不改这心意
如果云能带我去见你
我愿穿过千山奔向你
风也念你云也念你
我把牵挂放心里
我望着云儿飘向天际
每朵云都装着我情意
哪怕云儿随风远去
对你的情不会散去
我追着云儿翻过山脊
只愿和你不会再分离
若能换来与你相聚
我愿化作云陪伴你
`]
];
const songList = document.getElementById('song-list');
const aud = document.createElement('audio');
const lyricsDiv = document.getElementById('lyrics');
const fullscreenBtn = document.getElementById('fullscreen');
const cp = document.getElementById('cp');
const cz = document.getElementById('cz');
const bt = document.getElementById('bt');
const prog = document.getElementById('prog');
const progBar = document.getElementById('prog-bar');
const tmsg = document.getElementById('tmsg');
const bj = document.getElementById('bj');
let currentSongIndex = 0;
let lyricList = [];
let groupIndex = -1;
let arrCol1 = [];
let arrCol2 = [];
const rainbowColors = ["#ff2a2a","#ff7a00","#ffcc00","#22cc22","#00aaff","#6666ff","#ff55ff"];
let fs = true;
fullscreenBtn.addEventListener('click',function(){
if(fs){
fullscreenBtn.innerText = '退出全屏';
bj.requestFullscreen&&bj.requestFullscreen().catch(e=>{});
}else{
fullscreenBtn.innerText = '全屏欣赏';
document.exitFullscreen&&document.exitFullscreen().catch(e=>{});
}
fs = !fs;
});
cp.addEventListener('click',togglePlay);
cz.addEventListener('click',togglePlay);
prog.addEventListener('click',function(e){
const rect = prog.getBoundingClientRect();
const p = (e.clientX - rect.left)/rect.width;
aud.currentTime = aud.duration * p;
});
function togglePlay(){
if(aud.paused){ aud.play().catch(e=>{}); }
else { aud.pause(); }
}
xmhy.forEach((song, index) => {
const li = document.createElement('li');
li.className = 'song-item';
li.textContent = (index + 1) + "." + song;
li.dataset.index = index;
li.addEventListener('click', () => selectSong(index));
songList.appendChild(li);
});
function selectSong(index) {
document.querySelectorAll('.song-item').forEach(li => li.classList.remove('active'));
bt.innerHTML = '正在播放:' + xmhy.length + '首' + "/" + (index + 1) + "." + xmhy;
const selectedLi = document.querySelector(``);
selectedLi.classList.add('active');
currentSongIndex = index;
aud.src = xmhy;
parseLrc(xmhy);
aud.play().catch(e=>{});
window.scrollTo({ top: window.scrollY });
}
function parseLrc(lyricsText) {
lyricsDiv.innerHTML = '';
lyricList = [];
groupIndex = -1;
arrCol1 = [];
arrCol2 = [];
const lines = lyricsText.split('\n').map(line => line.trim());
lines.forEach(line => {
let tm = line.match(/\[(\d{2}):(\d{2})\.(\d{3})\]/) || line.match(/\[(\d{2}):(\d{2})\.(\d{2})\]/);
if(!tm) return;
const t = Number(tm)*60 + Number(tm) + Number(tm)/1000;
const txt = line.replace(tm,'').trim();
lyricList.push({time:t, text:txt});
});
aud.removeEventListener('timeupdate', onTick);
aud.addEventListener('timeupdate', onTick);
}
function onTick(){
const ct = aud.currentTime;
let curLine = 0;
for(let i=0;i<lyricList.length;i++){
if(ct >= lyricList.time) curLine = i;
}
const newG = Math.floor(curLine / 2);
if(newG !== groupIndex){
groupIndex = newG;
renderTwoGroup(groupIndex);
}
updateProgress(ct);
tmsg.innerText = toMin(aud.currentTime)+" | "+toMin(aud.duration);
const per = (aud.currentTime / aud.duration)*100;
progBar.style.width = per+"%";
}
function renderTwoGroup(gIdx){
lyricsDiv.innerHTML = "";
arrCol1 = [];
arrCol2 = [];
const i1 = gIdx*2;
const i2 = i1+1;
const item1 = lyricList;
const item2 = lyricList||null;
const c1 = document.createElement("span");
c1.className = "lyricCol";
for(let i=0;i<item1.text.length;i++){
const ch = item1.text;
const wrap = document.createElement("span");
wrap.className = "lyricCharItem";
wrap.style.display="block";
const base = document.createElement("span");
base.className = "lyricBase";
base.textContent = ch;
const rb = document.createElement("span");
rb.className = "lyricRainbow";
rb.textContent = ch;
rb.style.color = rainbowColors;
wrap.appendChild(base);
wrap.appendChild(rb);
c1.appendChild(wrap);
arrCol1.push(rb);
}
lyricsDiv.appendChild(c1);
if(item2){
const c2 = document.createElement("span");
c2.className = "lyricCol";
for(let i=0;i<item2.text.length;i++){
const ch = item2.text;
const wrap = document.createElement("span");
wrap.className = "lyricCharItem";
wrap.style.display="block";
const base = document.createElement("span");
base.className = "lyricBase";
base.textContent = ch;
const rb = document.createElement("span");
rb.className = "lyricRainbow";
rb.textContent = ch;
rb.style.color = rainbowColors;
wrap.appendChild(base);
wrap.appendChild(rb);
c2.appendChild(wrap);
arrCol2.push(rb);
}
lyricsDiv.appendChild(c2);
}
}
function updateProgress(nowTime){
if(groupIndex <0 || !lyricList.length) return;
const idx1 = groupIndex*2;
const idx2 = idx1+1;
const it1 = lyricList;
function getPro(now,item,nextTime){
let dur = (nextTime!==null)? nextTime-item.time : 2.2;
let p = (now-item.time)/dur;
return Math.max(0,Math.min(1,p*1.25));
}
function setCharClip(arr,prog){
let total = arr.length;
let pos = total*prog;
for(let i=0;i<arr.length;i++){
let pc = Math.max(0,Math.min(1,pos-i));
arr.style.clipPath = `inset(0 0 ${100-pc*100}%0 )`;
}
}
let p1 = getPro(nowTime,it1,(idx2<lyricList.length)?lyricList.time:null);
setCharClip(arrCol1,p1);
if(idx2 < lyricList.length){
const it2 = lyricList;
let nextT = (idx2+1 < lyricList.length)? lyricList.time : null;
let p2 = getPro(nowTime,it2,nextT);
setCharClip(arrCol2,p2);
}
}
function toMin(val) {
if (!val) return '00:00';
val = Math.floor(val);
let min = parseInt(val / 60);
let sec = parseFloat(val % 60);
if (min < 10) min = '0' + min;
if (sec < 10) sec = '0' + sec;
return min + ':' + sec;
}
aud.addEventListener('ended', () => {
currentSongIndex = (currentSongIndex + 1) % xmhy.length;
selectSong(currentSongIndex);
});
aud.addEventListener('playing',()=>{
cp.style.animationPlayState = 'running';
bt.style.animationPlayState = 'running';
});
aud.addEventListener('pause',()=>{
cp.style.animationPlayState = 'paused';
bt.style.animationPlayState = 'paused';
});
cp.style.animationPlayState = 'paused';
bt.style.animationPlayState = 'paused';
selectSong(currentSongIndex);
</script>
制作精美,好听好看,谢谢亚伦老师精彩分享 欣赏亚伦老师精彩音画!
页:
[1]