孙大剩
<style>#papa { left: -214px; width: 1024px; height: 640px; background: url('https://638183.freep.cn/638183/t22/webp/sydaug.webp') no-repeat center/cover; box-shadow: 3px 3px 20px #000; position: relative; display: grid; place-items: center; user-select: none; z-index: 1; --opt: .25; }
#papa::before { position: absolute; content: url('https://638183.freep.cn/638183/t22/webp/swk.webp'); width: 132px; height: 132px; left: 10px; top: 10px; border: 2px solid gold; transform: rotate(15deg); opacity: .4; }
#mplayer { position: absolute; bottom: 10px; display: grid; grid-template-columns: auto auto auto; place-items: center; gap: 6px; user-select: none; }
#btnplay { background: linear-gradient(120deg,black,orange); border-radius: 50%; width: 35px; height: 35px; cursor: pointer; animation: rot linear 3s infinite; }
#prog { --ww: 0px; width: 300px; height: 12px; border: 1px solid green; border-radius: 6px; background: snow; opacity: .65; position: relative; }
#prog::before { position: absolute; content: ''; width: var(--ww); height: 12px; border-radius: 6px; background: snow linear-gradient(90deg, orange, red); opacity: .65; }
#audtime { font: normal 14px sans-serif; color: snow; }
#lrc { --motion: cover1; --tt: 5s; --state: paused; position: absolute; bottom: 60px; font: bold 2.4em sans-serif; color: hsl(0,10%,90%); -webkit-background-clip: text; filter: drop-shadow(1px 1px 2px hsla(0,0%,0%,.95)); }
#lrc::before { position: absolute; content: attr(data-lrc); width: 20%; height: 100%; color: transparent; overflow: hidden; white-space: nowrap; background: linear-gradient(180deg,hsla(60,100%,50%,.45),hsla(0,100%,50%,.75)); filter: inherit; -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards; animation-play-state: var(--state); }
@keyframes cover1 { from { width: 0; } to { width: 100%; } }
@keyframes cover2 { from { width: 0; } to { width: 100%; } }
@keyframes rot { to { transform: rotate(-1turn); } }
</style>
<div id="papa">
<img src="https://638183.freep.cn/638183/t22/webp/125.gif" alt="" style="position: absolute; top: 10px; right: 10px;border-radius: 40%" />
<img src="https://638183.freep.cn/638183/t22/webp/sywuks.gif" alt="" id="swk" style="position: absolute; left: 510px; top: 220px; mix-blend-mode: difference; transition: all 1.2s;" />
<div id="lrc" data-lrc="花潮lrc在线">花潮lrc在线</div>
<div id="mplayer">
<span id="btnplay"></span>
<span id="prog"></span>
<span id="audtime">00:00 | 00:00</span>
</div>
</div>
<script>
(function() {
let aud = new Audio(), mKey = 0, mFlag = true, down = true;
let lrcAr = [,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,];
aud.src = 'https://music.163.com/song/media/outer/url?id=32628933.mp3';
aud.loop = true;
aud.autoplay = true;
if(aud.paused) btnplay.style.animationPlayState = 'paused';
btnplay.onclick = () => aud.paused ? aud.play() : aud.pause();
let jump = () => {swk.style.transform = 'translateY(' + (down ? 150 : 0) + 'px)';down = !down;setTimeout(jump, 10000);};
prog.onclick = (e) => aud.currentTime = aud.duration * e.offsetX / prog.offsetWidth;
aud.addEventListener('seeked', () => calcKey());
aud.addEventListener('pause', () =>mState());
aud.addEventListener('play', () =>mState());
aud.addEventListener('timeupdate', () => {let prg = aud.currentTime * prog.offsetWidth / aud.duration < 6 ? 6 : aud.currentTime * prog.offsetWidth / aud.duration;prog.style.setProperty('--ww', prg + 'px');audtime.innerText = toMin(aud.currentTime) + ' | ' + toMin(aud.duration);for(j=0; j<lrcAr.length; j++) {if(aud.currentTime >= lrcAr) {cKey = j;if(mKey === j) showLrc(lrcAr);else continue;}}});
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 showLrc = (time) => {let name = mFlag ? 'cover1' : 'cover2';lrc.innerHTML = 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 mState = () => aud.paused ? (btnplay.style.animationPlayState='paused',lrc.style.setProperty('--state', 'paused'),papa.style.setProperty('--opt','0')) : (btnplay.style.animationPlayState='running', lrc.style.setProperty('--state', 'running'),papa.style.setProperty('--opt','.25'));
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;}
setTimeout(jump, 10000);
})();
</script>
源码(全)
<style>
#papa { margin: auto; width: 1024px; height: 640px; background: url('https://638183.freep.cn/638183/t22/webp/sydaug.webp') no-repeat center/cover; box-shadow: 3px 3px 20px #000; position: relative; display: grid; place-items: center; user-select: none; z-index: 1; --opt: .25; }
#papa::before { position: absolute; content: url('https://638183.freep.cn/638183/t22/webp/swk.webp'); width: 132px; height: 132px; left: 10px; top: 10px; border: 2px solid gold; transform: rotate(15deg); opacity: .4; }
#mplayer { position: absolute; bottom: 10px; display: grid; grid-template-columns: auto auto auto; place-items: center; gap: 6px; user-select: none; }
#btnplay { background: linear-gradient(120deg,black,orange); border-radius: 50%; width: 35px; height: 35px; cursor: pointer; animation: rot linear 3s infinite; }
#prog { --ww: 0px; width: 300px; height: 12px; border: 1px solid green; border-radius: 6px; background: snow; opacity: .65; position: relative; }
#prog::before { position: absolute; content: ''; width: var(--ww); height: 12px; border-radius: 6px; background: snow linear-gradient(90deg, orange, red); opacity: .65; }
#audtime { font: normal 14px sans-serif; color: snow; }
#lrc { --motion: cover1; --tt: 5s; --state: paused; position: absolute; bottom: 60px; font: bold 2.4em sans-serif; color: hsl(0,10%,90%); -webkit-background-clip: text; filter: drop-shadow(1px 1px 2px hsla(0,0%,0%,.95)); }
#lrc::before { position: absolute; content: attr(data-lrc); width: 20%; height: 100%; color: transparent; overflow: hidden; white-space: nowrap; background: linear-gradient(180deg,hsla(60,100%,50%,.45),hsla(0,100%,50%,.75)); filter: inherit; -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards; animation-play-state: var(--state); }
@keyframes cover1 { from { width: 0; } to { width: 100%; } }
@keyframes cover2 { from { width: 0; } to { width: 100%; } }
@keyframes rot { to { transform: rotate(-1turn); } }
</style>
<div id="papa">
<img src="https://638183.freep.cn/638183/t22/webp/125.gif" alt="" style="position: absolute; top: 10px; right: 10px;border-radius: 40%" />
<img src="https://638183.freep.cn/638183/t22/webp/sywuks.gif" alt="" id="swk" style="position: absolute; left: 510px; top: 220px; mix-blend-mode: difference; transition: all 1.2s;" />
<div id="lrc" data-lrc="花潮lrc在线">花潮lrc在线</div>
<div id="mplayer">
<span id="btnplay"></span>
<span id="prog"></span>
<span id="audtime">00:00 | 00:00</span>
</div>
</div>
<script>
(function() {
let aud = new Audio(), mKey = 0, mFlag = true, down = true;
let lrcAr = [,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,];
aud.src = 'https://music.163.com/song/media/outer/url?id=32628933.mp3';
aud.loop = true;
aud.autoplay = true;
if(aud.paused) btnplay.style.animationPlayState = 'paused';
btnplay.onclick = () => aud.paused ? aud.play() : aud.pause();
let jump = () => {swk.style.transform = 'translateY(' + (down ? 150 : 0) + 'px)';down = !down;setTimeout(jump, 10000);};
prog.onclick = (e) => aud.currentTime = aud.duration * e.offsetX / prog.offsetWidth;
aud.addEventListener('seeked', () => calcKey());
aud.addEventListener('pause', () =>mState());
aud.addEventListener('play', () =>mState());
aud.addEventListener('timeupdate', () => {let prg = aud.currentTime * prog.offsetWidth / aud.duration < 6 ? 6 : aud.currentTime * prog.offsetWidth / aud.duration;prog.style.setProperty('--ww', prg + 'px');audtime.innerText = toMin(aud.currentTime) + ' | ' + toMin(aud.duration);for(j=0; j<lrcAr.length; j++) {if(aud.currentTime >= lrcAr) {cKey = j;if(mKey === j) showLrc(lrcAr);else continue;}}});
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 showLrc = (time) => {let name = mFlag ? 'cover1' : 'cover2';lrc.innerHTML = 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 mState = () => aud.paused ? (btnplay.style.animationPlayState='paused',lrc.style.setProperty('--state', 'paused'),papa.style.setProperty('--opt','0')) : (btnplay.style.animationPlayState='running', lrc.style.setProperty('--state', 'running'),papa.style.setProperty('--opt','.25'));
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;}
setTimeout(jump, 10000);
})();
</script>
马师精彩,欣赏学习{:4_178:} CSS和JS代码以行为单位做了压缩,需要格式化的可借助在线工具展开代码。
按钮:用线性渐变做元素背景图,通过渐变角度、颜色、动画等配套设计,效果有一定的立体感——
#btnplay {
background: linear-gradient(120deg,black,orange);
border-radius: 50%;
width: 35px;
height: 35px;
cursor: pointer;
animation: rot linear 3s infinite;
}
二、左上角用帖子父框伪元素、右上角用 img 标签放图。左上角的孙大圣形象是孙大剩的自我期许,因此放在伪元素中合适;
三、宝马观后镜里的孙大圣也是孙大剩的自我期盼,或想象,因此,它的本事只能约束在镜里和车门这个小天地,它在此方天地做盖世英雄。这里,用了一个自定义JS完成上蹿下跳的动作:
let down = true;
let jump = () => {
swk.style.transform = 'translateY(' + (down ? 150 : 0) + 'px)';
down = !down;
setTimeout(jump, 10000);
}; 本帖最后由 马黑黑 于 2022-10-23 08:08 编辑
这首歌应发行于2016年,貌似不怎么火,甚至被遗忘。哎,理解,毕竟,孙大剩虽有名有姓却应划入无名之辈,籍籍无名者,能图个啥?
然而这首歌,我认为很成功。它是描述性的、总结性的,有期待,有无奈,有批判,有同情……总之,一首实实在在的歌曲,所描述的主角儿,很多人好像都可以对号入座。
我等平庸、失败,但我将要不得不开宝马迎娶爱人…… 这孙悟空虎跃龙跳地真可爱。 梦油 发表于 2022-10-23 08:59
这孙悟空虎跃龙跳地真可爱。
它是孙大剩的幻想和自我期盼 醉美水芙蓉 发表于 2022-10-23 09:06
黑黑老师好早呀!欣赏学习老师新作品!
希望你已经能够使用花潮LRC在线增强版改造你的歌词了 马黑黑 发表于 2022-10-23 09:12
它是孙大剩的幻想和自我期盼
这可真是黑黑朋友十分美好的创意,赞! 马黑黑 发表于 2022-10-23 08:06
这首歌应发行于2016年,貌似不怎么火,甚至被遗忘。哎,理解,毕竟,孙大剩虽有名有姓却应划入无名之辈,籍 ...
笑s,黑黑还特别逗{:4_170:} 小辣椒 发表于 2022-10-23 10:22
笑s,黑黑还特别逗
我的歌评可能不那么严肃{:4_173:} 非常惊艳的效果,手机看得也是那么的好玩,悟空太厉害了,武功盖天下 梦油 发表于 2022-10-23 09:59
这可真是黑黑朋友十分美好的创意,赞!
{:4_191:} 这个播放器又换了颜色,漂亮 小辣椒 发表于 2022-10-23 10:24
非常惊艳的效果,手机看得也是那么的好玩,悟空太厉害了,武功盖天下
有空我也用手机瞧瞧到底行不行 小辣椒 发表于 2022-10-23 10:25
这个播放器又换了颜色,漂亮
这个可以随意的 这个效果只能借黑黑的悟空玩了{:4_170:} 欣赏音画佳作! 相约爱晚亭 发表于 2022-10-23 11:03
欣赏音画佳作!
{:4_191:}