试帖:《红尘酒世人醉》(伦巴)张奥妮
本帖最后由 亦是金 于 2024-1-26 20:25 编辑 <br /><br /><div class="t_fsz">
<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_1894597">
<style type="text/css">
#papa {
width: 1200px;height: 710px;position:relative; --state:paused;
box-shadow:0px 0px 1px 2px #045768, 0px 0px 0px 8px #99e5f5,0px 0px 5px 15px #045768;
overflow:hidden;border-radius:1%;display:grid; place-items:center;
margin-top:10px;margin-LEFT:-310px;/*位置设置*/
}
.vid { position: absolute; width: 1500px; height: 710px; object-fit: cover; opacity: 1; }/*位置设置*/
.mypic { position: absolute; width: 10px; height: 10px;left: 82px;top: 380px; }
.photo {
width: 1200px;
height: 730px;
position: absolute;top:0px; left:0px;z-index: 300;
filter:contrast(120%)brightness(100%);-webkit-mask-image: radial-gradient(black 30% ,transparent 70%);
animation: round 54s infinite;
opacity: 0;
}
@keyframes round {
0% {opacity: 0;filter:hue-rotate(360deg)}
10% {opacity: 1;}
18% {opacity: 0;}
}
img:nth-child(9) {animation-delay: 48s;}
img:nth-child(8) {animation-delay: 42s;}
img:nth-child(7) {animation-delay: 36s;}
img:nth-child(6) {animation-delay: 30s;}
img:nth-child(5) {animation-delay: 24s;}
img:nth-child(4) {animation-delay: 18s;}
img:nth-child(3) {animation-delay: 12s;}
img:nth-child(2) {animation-delay: 6s;}
img:nth-child(1) {animation-delay: 0s;}
#baiBox {
width: 500px;
height: 50px;
text-align: center;
font-family:微软简中圆;
font-size: 2.0rem;
font-weight: bold;
color: #f46ff6;
transform-origin: top;
animation: yao 1.0s linear infinite alternate;
position:absolute;left:50px;top:30px;/*位置设置*/
}
@keyframes yao {
from{transform: perspective(800px) rotatex(30deg); }
to { transform: perspective(800px) rotatex(-30deg); }
}
.tit { position: relative;width: 500px;height: 30px;filter: drop-shadow(-1px 1px 1px #ffffff)drop-shadow(0px -1px 1px #ffffff)drop-shadow(0px 0px 1px #ffffff)drop-shadow(0px 0px 1px #ffffff)drop-shadow(0px 0px 1px #ffffff) }
</style>
<div id="papa">
<video class="vid"src="https://img.tukuppt.com/video_show/2475824/00/07/96/5d1418a498afe.mp4" autoplay muted loop="" id="vio"></video>
<img class="mypic" src="https://z3.ax1x.com/2021/08/26/hujGMd.gif" alt="" />
<img alt="" class="photo" src="https://s1.ax1x.com/2023/05/22/p9IrB1H.jpg" />
<img alt="" class="photo" src="https://s1.ax1x.com/2023/05/22/p9IrdhD.jpg" />
<img alt="" class="photo" src="https://s1.ax1x.com/2023/05/22/p9Ir09e.jpg" />
<img alt="" class="photo" src="https://s1.ax1x.com/2023/05/22/p9IratO.jpg" />
<img alt="" class="photo" src="https://s1.ax1x.com/2023/05/22/p9IrUAK.jpg" />
<img alt="" class="photo" src="https://s1.ax1x.com/2023/05/22/p9IrDcd.jpg" />
<img alt="" class="photo" src="https://s1.ax1x.com/2023/05/22/p9IrrjA.jpg" />
<img alt="" class="photo" src="https://s1.ax1x.com/2023/05/22/p9IrynI.jpg" />
<img alt="" class="photo" src="https://s1.ax1x.com/2023/05/22/p9Ir6Bt.jpg" />
<css-doodle grid="16" id="fFloat">
:doodle {
@size: 1150px 680px;
}
position: absolute;
left: @r(255)%;
top: -10%;
:after {
position: absolute;
content: '@p(爱你, ♬, ♪, ♩,♫, ∮, ✲, ❉, ❤, 爱, ☺, ☀, ★, ☆,love, ❄)';
color:#fb52f9;
font-size: @r(15, 25)px;
}
animation: fall 40s @r(-6, 36)s infinite var(--state);
@keyframes fall {
from { transform: rotate(0deg) translate(0px); }
to { transform: rotate(@r(-250,160)deg) translate(-1500px); }
}
</css-doodle>
<css-doodle id="mplayer">
:doodle {
@grid: 2 / 500px 100px;
color: var(--color);
bottom: 70px;
z-index: 999;
--prog: 0%;
--size: 60px;
--ttmsg1: '00:00';
--ttmsg2: '00:00';
--color: #ff0000;
position:absolute;
}
/* 时间信息 : 左 */
@nth(1) {@place: 5% 100%; :after { content: var(--ttmsg1); } }
/* 控制器 */
@nth(2) {
@size: 60px;
@shape: windmill;
@place: 50% 35%;
background: var(--color);
animation: rot 6s infinite linear var(--state);
}
/* 时间信息 : 右 */
@nth(3) {
@place: 95% 100%;
:after { content: var(--ttmsg2); }
}
/* 进度条 */
@nth(4) {
@place: 50% 80%;
@size: 100% 2px;
background: Silver;
display: grid;
place-items: center start;
:before {
content: '';
width: var(--prog);
height: 100%;
background: var(--color);
}
}
@keyframes rot { to { transform: rotate(1turn); } }
</css-doodle>
<css-doodle id="lrc">
:doodle {
@size: auto 3.5em;
bottom: 20px;
--geci: "花潮lrc在线";
--motion: cover2;
--tt: 1s;
position:absolute;
}
/* 单元格两个伪元素显示lrc歌词 */
display: grid;
place-items: center start;
:before, :after {
content: var(--geci);
color: snow; /* 歌词底色 */
font: bold 2.4em sans-serif;
text-shadow: 1px 1px 1px #000;
white-space: pre;
}
:after {
position: absolute;
width: 0;
color: #fb52f9; /* 同步歌词颜色 */
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="baiBox">
<div class="tit">
<span style="color:#fb52f9;"><span style="font-size:32px;">《红尘酒世人醉》(伦巴)</span>
<span style="color:#3d46f7;"><span style="font-size:20px;"> -张奥妮</span>
</div></div>
<div style="position:absolute;bottom:10px;right:50px;filter: drop-shadow(-1px 1px 1px #e8f552)drop-shadow(0px -1px 1px #e8f552)drop-shadow(0px 0px 1px #e8f552)drop-shadow(0px 0px 1px #e8f552)drop-shadow(0px 0px 1px #e8f552)">
<p><span style="color:#ff0000;"><span style="font-family:华文隶书;"><span style="font-size:26px;"> 亦是金在线音乐 </span></span></span></p></div>
<audio id="aud" src="https://www.kumeiwp.com/sub/filestores/2023/05/16/9a1f99f4addfe8d1db1d2bb4bb78be10.mp3" autoplay loop></audio>
</div>
<script>
(function() {
let slip = 0.5, mFlag = true, mKey = 0, clickIdx = 0, progChg = 0, cursors = ['default','pointer','pointer'];
let lrcAr = [
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
];
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;};
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 = () => aud.paused ? (papa.style.setProperty('--state', 'paused') ) : (papa.style.setProperty('--state','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('seeked', () => calcKey());
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-aud.currentTime)}'`);mplayer.style.setProperty('--prog',`${100 * aud.currentTime / aud.duration}%`);});
mplayer.onclick = () => {if(clickIdx === 1) aud.paused ? aud.play() : aud.pause();if(clickIdx === 2) aud.currentTime = progChg;};
mplayer.onmousemove = (e) => {let size = parseInt(window.getComputedStyle(mplayer).getPropertyValue('--size')), ww = mplayer.offsetWidth, hh = mplayer.offsetHeight;clickIdx = e.offsetY > hh/1.5 ? 2 : (e.offsetX > (ww - size)/2 && e.offsetX < (ww + size)/2 && e.offsetY < hh/1.5 ? 1 : 0);mplayer.style.cursor = cursors;if(clickIdx > 1) progChg = aud.duration * e.offsetX / ww;};
})();
(function() {
let vid = document.querySelector('.vid');
let script = document.createElement('script');
script.src = 'https://unpkg.com/css-doodle@0.34.8/css-doodle.min.js';
document.head.appendChild(script);
let mState = () => aud.paused ? (papa.style.setProperty('--state', 'paused'), vid.pause()) : (papa.style.setProperty('--state', 'running'), vid.play());
aud.addEventListener('play', mState, false);
aud.addEventListener('pause', mState, false);
mplayer.onclick = () => aud.paused ? aud.play() : aud.pause();
})();
</script>
</td></tr></table> 这是半成品的帖子,有诸多的问题待解决!1.风车播放器不转动;2.歌词不能同步变色;……。我反复折腾未能解决,将它发表上来,期待能得到老师们的指导!谢谢了!向老师们致敬!{:4_190:}{:4_191:}{:4_176:}{:4_187:} 亦是金 发表于 2023-5-16 17:37
这是半成品的帖子,有诸多的问题待解决!1.风车播放器不转动;2.歌词不能同步变色;……。我反复折腾未能解 ...
亦是金老师做过这个类型的帖子啊,跟自己的帖子对照一下,也会发现问题在哪的啊{:4_187:} 亦是金 发表于 2023-5-16 17:37
这是半成品的帖子,有诸多的问题待解决!1.风车播放器不转动;2.歌词不能同步变色;……。我反复折腾未能解 ...
调整了一下,放在https://www.huachaowang.com/forum.php?mod=viewthread&tid=68697
不知是否能看的过眼。 漂亮! 代码开始处的
https://www.huachaowang.com/forum.php?mod=viewthread&tid=68697
<div class="t_fsz">
<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_1894597">
是多余的,它使得帖子版面变形了。 起个网名好难 发表于 2023-5-16 18:54
调整了一下,放在https://www.huachaowang.com/forum.php?mod=viewthread&tid=68697
不知是否能看的过 ...
感谢老师的精心修复,我用老师的代码替代了我的代码!致敬老师!{:4_190:}{:4_191:}{:4_176:}
页:
[1]