《风雨恋》刘秋仪
本帖最后由 焱鑫磊 于 2023-5-22 00:36 编辑 <br /><br /> <style>#papa { margin: 100px -280px ;width: 1164px;height: 640px;background: tan url('https://img.fy6b.com/2023/05/21/bdbca81fced13.jpg');
box-shadow: 0 0 8px #000;
display: grid;
place-items: center;
position: relative;
overflow: hidden;
--state: paused;
}
#vid {
position: absolute;
width: 1400px;
height: 100%;
border-radius: 2%;
opacity: .76;
object-fit: cover;
pointer-events: none;
mix-blend-mode: screen;
}
css-doodle { position: absolute; }
</style>
<div id="papa">
<!-- 播放器 -->
<css-doodle grid="1" id="mplayer">
:doodle {
@size: 1164px 640px;
background: url('') no-repeat center/cover;
box-shadow: 0 0 6px #000;
position: relative;
z-index: 1;
}
@size: 100px;
clip-path: @shape(
fill: evenodd;
points: 400;
x: cos(2t) * cos(5t) * sin(t);
y: sin(2t) * sin(4t) * cos(5t);
);
position: absolute;
background: rgb(@m3(@r(255)));
offset-path: path('M212 180a300 120 0 1 0 600 0a300 120 0 1 0 -600 0z');
animation: move 40s infinite linear var(--state);
cursor: pointer;
@keyframes move { to { offset-distance: 100%;} }
</css-doodle>
<css-doodle id="lrc">
:doodle {
@size: auto 4em;
top: 10px;
--geci: "css-doodle player"; --motion: cover2; --tt: 1s;}/* 单元格两个伪元素显示lrc歌词 */
display: grid;
place-items: center start;
:before, :after {
content: var(--geci);
color:LightGrey; /* 歌词底色 */
font: bold 2em sans-serif;
text-shadow: 1px 1px 2px #000;
white-space: pre;
}
:after {
position: absolute;
width: 0;
color: DarkSeaGreen; /* 同步歌词颜色 */
overflow: hidden;
animation: var(--motion) var(--tt) linear forwards var(--state);
}
@keyframes cover1 { from { width: 0; } to { width: 100%; } }
@keyframes cover2 { from { width: 0; } to { width: 100%; } }
</css-doodle>
<video id="vid" src="https://img.tukuppt.com/video_show/2402760/00/02/34/5b56b9d9dfec9.mp4" autoplay="" loop="" muted=""></video>
<audio id="aud" src="https://www.joy127.com/url/105058.mp3" autoplay="autoplay" loop="loop"></audio></div>
<script>
(function() {
let script = document.createElement('script');
script.src = 'https://638183.freep.cn/638183/web/api/css-doodle.js';
document.head.appendChild(script);
let slip = 0.5, mFlag = true, mKey = 0, clickIdx = 0, progChg = 0, cursors = ['default','pointer','pointer'];
let lrcAr = [
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
];
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 showLrc = (time) => {lrc.style.setProperty('--motion', mFlag ? 'cover1' : 'cover2');lrc.style.setProperty('--geci', '"' + lrcAr + '"');lrc.style.setProperty('--tt', time + 's');mKey += 1;mFlag = !mFlag;};
aud.addEventListener('play', mState, false);
aud.addEventListener('pause', mState, false);
aud.addEventListener('timeupdate', () => {for (j = 0; j < lrcAr.length; j++) {if (aud.currentTime - slip >= lrcAr) {cKey = j;if (mKey === j) showLrc(lrcAr);else continue;}}mplayer.style.setProperty('--ttmsg1', `'${toMin(aud.currentTime)}'`);mplayer.style.setProperty('--ttmsg2', `'${toMin(aud.duration)}'`);mplayer.style.setProperty('--prog',`${100 * aud.currentTime / aud.duration}%`);});
mplayer.onclick = () => aud.paused ? aud.play() : aud.pause();
})();
</script>
老师真棒,沙发点赞! 这个小蝴蝶在这个帖子里很漂亮。欣赏焱鑫磊好帖{:4_187:} 梦江南 发表于 2023-5-22 08:21
老师真棒,沙发点赞!
问好梦江南{:4_204:}{:4_204:}{:4_204:} 红影 发表于 2023-5-22 08:53
这个小蝴蝶在这个帖子里很漂亮。欣赏焱鑫磊好帖
送红影{:4_187:}{:4_187:}{:4_187:}{:4_204:}{:4_204:}{:4_204:} 好美的帖,歌真好听,感谢分享!{:4_204:} 焱鑫磊 发表于 2023-5-22 09:04
送红影
问好焱鑫磊,新周快乐{:4_204:}
页:
[1]