王菲 - 匆匆那年
本帖最后由 岩新新 于 2023-6-20 21:08 编辑 <br /><br /><div style="POSITION: absolute; MARGIN-TOP: 10px; WIDTH: 100%; HEIGHT: 631px; MARGIN-LEFT: -320px; transform: scale(1)"><iframe height="740" marginheight="0" src="https://pan.111t.net/view.php/7eb70e7c27fd7e774912cac010eb1094.html" frameborder="0" width="1400marginWidth=0" scrolling="no"></iframe></div><div style="WIDTH: 100%; HEIGHT: 830px"></div> 这个好像做得有问题,内容没有全部展示,是套用南无月的帖子吧?视频的位置不对,歌词也看不到了呢。新新再调整一下? 去帖子里看了一下,应该是帖子的宽度设置问题。 红影 发表于 2023-6-20 09:41
去帖子里看了一下,应该是帖子的宽度设置问题。
我这里正常呀! https://s1.ax1x.com/2023/06/20/pC3zsG4.png
<style>
#papa {
margin: 0 0 0 calc(50% - 793px);
width: 1400px;
height: 740px;
background: tan url('https://pan.111t.net/view.php/459a0fb983fa43158a61b26eeaed922b.gif')no-repeat center / cover; ;
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: .26;
object-fit: cover;
pointer-events: none;
mix-blend-mode: screen;
}
css-doodle { position: absolute; }
#mydiv {
width: 1024px;
height: 640px;
overflow: hidden;
position: relative;
margin: 30px auto;
--opa1: 0; --opa2: 1; --bgcolor: rgba(255,255,255,.6);
}
.plane {
display: block;
width: 80px;
height: 60px;
left: 20px;
top: 30px;
background: linear-gradient(lightgreen,green,lightgreen);
opacity: .8;
clip-path: polygon(0 0,20% 50%,0 100%,100% 50%);
offset-path: path('M20 30 h1004 30');
offset-distance: 0%;
position: absolute;
animation: fly 40s var(--delay) infinite linear var(--state);
--delay: 0s;
}
.plane:nth-of-type(2),.plane:nth-of-type(4) { --delay: -10s; }
.plane:nth-of-type(3), {
transform: translateY(510px);
opacity: .6;
}
@keyframes fly { to { offset-distance: 100%; } }
</style>
<div id="papa">
<!-- 播放器 -->
<css-doodle grid="1" id="mplayer">
:doodle { @size: 100px; cursor: pointer; right: 455px; top: 260px; opacity: .66;z-index: 4; }
clip-path: @shape(
points: 18;
R: seq(.618, 1, 0);
T: seq(t-.55, t, t);
x: R * cos(T);
y: R * sin(T);
);
background: linear-gradient(DeepSkyBlue,Crimson,MediumPurple);
animation: rot 6s infinite linear var(--state);
@keyframes rot { to { transform: rotate(360deg); } }
</css-doodle>
<!-- 歌词 -->
<css-doodle id="lrc">
:doodle { @size: auto 4em; z-index:5; top: 220px; left:190px; --geci: " css-doodle player"; --motion: cover2; --tt: 1s; }
display: grid;
place-items: center start;
:before, :after {
content: var(--geci);
color: Honeydew;
font: bold 2em sans-serif;
text-shadow: 1px 1px 2px #000;
white-space: pre;
}
:after {
position: absolute;
width: 0;
color:SteelBlue;
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>
<div id="mydiv"><span id="btn"></span><span class="plane"></span><span class="plane"></span><span class="plane"></span><span class="plane"></span></div><video id="vid" src="https://img.tukuppt.com/video_show/2418175/00/01/41/5b42b85fa5edc.mp4" autoplay="" loop="" muted=""></video> <audio id="aud" src="http://music.163.com/song/media/outer/url?id=31514406
" autoplay="autoplay" loop="loop" muted></audio>
</div>
<script>(function() {
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 script = document.createElement('script');
script.src = 'https://638183.freep.cn/638183/web/api/css-doodle.js';
document.body.appendChild(script);
//let mState = () => papa.style.setProperty('--state', aud.paused ? 'paused' : 'running');
let mState = () => aud.paused ? (papa.style.setProperty('--state','paused'), vid.pause()) : (papa.style.setProperty('--state','running'), vid.play());
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.onclick = () => aud.paused ? aud.play() : aud.pause();
})();
</script> 不用空间帖,直接贴代码就对了。 岩新新 发表于 2023-6-20 10:09
我这里正常呀!
我这里只能看到一半的帖子。 红影 发表于 2023-6-20 16:30
我这里只能看到一半的帖子。
我也不明白、用代码发歌词不动! 岩新新 发表于 2023-6-20 17:50
我也不明白、用代码发歌词不动!
现在看到歌词了啊。 醉美水芙蓉 发表于 2023-6-20 20:12
@岩新新 老师可以直接代码!
用代码歌词不动了! 岩新新 发表于 2023-6-20 21:04
用代码歌词不动了!
你源码里面有溢出码,去了就好了 欣赏新新的播放器制作,马老师又多了一个学生{:4_199:} 问好老师,欣赏精彩佳作,谢谢分享!{:4_178:} 起个网名好难 发表于 2023-6-20 11:32
不用空间帖,直接贴代码就对了。
谢谢欣赏!
页:
[1]
2