不再流泪 不再喝醉 (歌手:郭力)
本帖最后由 宁静 于 2023-3-18 19:45 编辑 <br /><br /><style>#papa {
--state: paused;
margin: 80px 0 0 calc(50% - 760px);
width: 1365px;
height: 700px;
background: lightgreen url(' https://xlaj.cn/assets/file/zp/20230318193421.gif') center/cover no-repeat;
box-shadow: 3px 3px 20px #000;
display: grid;
place-items: center;
position: relative;
}
#lrc {
--motion: cover2;
--tt: 2s;
--bg: linear-gradient(180deg, hsla(120, 70%, 50%, .75), hsla(120, 70%, 50%, .75));
position: absolute;
top: 520px;
left: 780px;
font: bold 2.4em sans-serif;
color: snow;
white-space: pre;
-webkit-background-clip: text;
filter: drop-shadow(1px 1px 1px hsla(0, 0%, 0%, .95));
}
#lrc::before {
position: absolute;
content: attr(data-lrc);
width: 20%;
height: 100%;
color: transparent;
overflow: hidden;
white-space: pre;
background: var(--bg);
filter: inherit;
-webkit-background-clip: text;
animation: var(--motion) var(--tt) linear forwards;
animation-play-state: var(--state);
}
#face {
position: absolute;
left: 380px;
top: 30px;
width: 110px;
height: 93px;
border: 1px solid #;
border-radius: 100% 100% 80% 80%;
cursor: pointer;
}
#face > span {
position: absolute;
top: 39px;
width: 10px;
height: 16px;
border-radius: 50%;
background: #000;
}
#face > span:nth-of-type(1) {
left: 25px;
animation: mov .5s infinitealternate var(--state);
--xx: 10px;
}
#face > span:nth-of-type(2) {
left: 70px;
animation: mov .5s infinite linear alternate var(--state);
--xx: -10px;
}
#face > span:nth-of-type(3) {
height: 8px;
background: none;
border: 1px solid #000;
top: 68px;
left: 45px;
transform: scale(.5);
animation: scale .15s infinite alternate var(--state);
}
@keyframes cover1 { from { width: 0; } to { width: 100%; } }
@keyframes cover2 { from { width: 0; } to { width: 100%; } }
@keyframes mov {to { transform: translate(var(--xx)); } }
@keyframes scale { to {transform: scale(1.5); } }
#dt2{ position: absolute; width: 200px; height: 113px; top: 160px; left: 775px; }
</style>
<div id="papa">
<img id="dt2" src="https://xlaj.cn/assets/file/zp/20230318193525.gif" alt="" style="position: absolute; mix-blend-mode: multiply; transform: translate(30px, 40px) rotate(360deg); " />
<audio id="aud" src="https://xlaj.cn/assets/file/zp/20230318193603.mp3" loop autoplay></audio>
<div id="lrc" data-lrc="HCPlayer">HCPlayer</div>
<div id="face">
<span></span>
<span></span>
<span></span>
</div>
</div>
<script>
let averAdd = 0, offset = 0, mKey = 0, mFlag = true;
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;};
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;};
let calcKey = () => { for (j = 0; j < lrcAr.length; j++) { if (aud.currentTime <= lrcAr) { mKey = j - 1; break; } } if (mKey < 0) mKey = 0; if (mKey > lrcAr.length - 1) mKey = lrcAr.length - 1; let time = lrcAr - (aud.currentTime - lrcAr); showLrc(time); };
let mState = () => papa.style.setProperty('--state', aud.paused ? 'paused' : 'running');
let lrcAr = [
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
];
aud.addEventListener('timeupdate', () => {for (j = 0; j < lrcAr.length; j++) {if (aud.currentTime >= lrcAr) {cKey = j;if (mKey === j) showLrc(lrcAr);else continue;}}});
aud.addEventListener('pause', () => mState());
aud.addEventListener('play', () => mState());
aud.addEventListener('seeked', () => calcKey());
face.addEventListener('click', () => aud.paused ? aud.play() : aud.pause());
</script>
<br><br><br><br><br> 手机欣赏点击月亮播放器音乐打开 很可爱的播放器按钮,黑白色的风格伴着歌声都是满满的回忆! 月亮的眼睛,嘴巴都会动{:9001:} 好像是新歌的{:9022:} 好漂亮啊,最喜欢这种黑白灰,若隐若现的背景色调,蕴含着清冷而又高贵的意境 背景有闪动效果{:9022:} 月亮播放器萌萌哒{:10_402:} 郭力这新歌挺好听的{:9022:} 继续听歌
页:
[1]
2