中秋遇上国庆节
本帖最后由 三月的阳光 于 2023-9-29 21:06 编辑 <br /><br /><style>#papa { left: -180px; width: 1024px; height: 640px; box-shadow: 4px 4px 30px #000; border-radius: 6px; overflow: hidden; position: relative; }
#mama {position: absolute; width: inherit; height: inherit; left: 0; top: -640px; background: #ccc url('https://pic.imgdb.cn/item/65129147c458853aefd9582c.jpg') no-repeat center / cover; }
#mama input { border: none; outline: none; opacity: .75; cursor: pointer; }
#mama p { margin: 0; padding: 0; }
.playbox { position: absolute; left: 450px; top: 520px; padding: 10px; font: normal 1em sans-serif; color: #eee; background: rgba(255,255,255,.2); border-radius: 8px; backdrop-filter: blur(1px); overflow: hidden; box-shadow: 1px 1px 2px rgba(0,0,0,.15); z-index: 100; }
#btnplay { width: 30px; height: 30px; border-radius: 50%; }
#btnplay:hover { background: #aaa; color: #ff0000; }
#papa > img { position: absolute; border: none; outline: none; }
#ufo2 { left: 0; top: 0; width: 200px; height: 150px; transition: all 2s; }
#tang1 { top: 420px; width: 220px; height: 220px; opacity: .2; cursor: pointer; }
@keyframes up { to { transform: translateY(-700px); } }
@keyframes down { to { top: 0px; } }
</style>
<div id="papa">
<img id="ufo2" src="https://pic.imgdb.cn/item/6516c1ccc458853aef0bbc52.png" alt="" />
<img id="tang1" src="http://bohann.net/data/attachment/forum/202309/25/173321b4kjk44k9hhqhblj.png" alt="" />
<div id="mama">
<div class="playbox">
<p id="geci" style="font-size: 1.2em; text-shadow: 1px 1px 1px #222">stand by ... </p>
<p style="display: flex; align-items: center; gap: 4px; margin-top: 10px;">
<input id="btnplay" type="button" value=">" />
<input id="slider" type="range" min="0" max="100" value="0" />
<span id="per">0%</span>
</p>
</div>
</div>
</div>
<audio id="aud" src="http://music.163.com/song/media/outer/url?id=2085727553.mp3" loop="loop"></audio>
<script>
let lrcAr = [['0.00', ' 中秋遇上国庆节',9.97],
['10.50', ' 编辑:三月的阳光',5.79],
['16.59', ' 金秋十月好时节',3.46],
['20.23', ' 国旗飘扬在天边',3.55],
['23.97', ' 家国情怀我心间',3.52],
['27.68', ' 国泰民安阖家团圆',3.60],
['31.47', ' 中秋国庆都是佳节',3.60],
['35.26', ' 撞在一起好运连连',3.65],
['39.10', ' 国家小家心相连',3.48],
['42.76', ' 喜笑颜开比蜜甜',5.74],
['48.80', ' 中秋遇上国庆节',3.15],
['52.12', ' 红旗耀眼月饼香甜',3.52],
['55.83', ' 享受假期的每一天',3.59],
['59.61', ' 欢天喜地欢度双节',3.88],
['63.69', ' 国庆遇上中秋节',3.22],
['67.08', ' 共赴国与家的盛宴',3.52],
['70.78', ' 万家灯火欢度双节',3.69],
['74.66', ' 国安月明家家团圆',17.90],
['93.50', ' 中秋国庆都是佳节',3.34],
['97.02', ' 撞在一起好运连连',3.78],
['101.00', ' 国家小家心相连',3.39],
['104.57', ' 喜笑颜开比蜜甜',5.86],
['110.74', ' 中秋遇上国庆节',3.15],
['114.06', ' 红旗耀眼月饼香甜',3.66],
['117.91', ' 享受假期的每一天',3.33],
['121.42', ' 欢天喜地欢度双节',4.01],
['125.64', ' 国庆遇上中秋节',3.13],
['128.94', ' 共赴国与家的盛宴',3.63],
['132.76', ' 万家灯火欢度双节',3.64],
['136.59', ' 国安月明家家团圆',3.93],
['140.73', ' 中秋遇上国庆节',3.14],
['144.03', ' 红旗耀眼月饼香甜',3.57],
['147.79', ' 享受假期的每一天',3.43],
['151.40', ' 欢天喜地欢度双节',4.01],
['155.62', ' 国庆遇上中秋节',3.18],
['158.97', ' 共赴国与家的盛宴',3.71],
['162.88', ' 万家灯火欢度双节',3.53],
['166.60', ' 国安月明家家团圆',4.5]
];
let num = (min, max) => Math.floor(Math.random() * (max-min+1)) + min;
tang1.style.left = num(10,924) + 'px';
ufo2.style.left = num(0,924) + 'px';
tang1.onclick = () => {
tang1.style.opacity = 1;
ufo2.style.left = tang1.offsetLeft+ 30 + 'px';
ufo2.style.top = tang1.offsetTop - 60 + 'px';
setTimeout(() => {
ufo2.style.animation = tang1.style.animation = 'up 4s forwards';
},2200);
setTimeout(() => {
mama.style.animation = 'down 4s forwards';
aud.play();
},4300);
}
slider.onmousedown = () => aud.pause();
slider.onchange = () => { aud.currentTime = slider.value * aud.duration / 100; aud.play(); }
btnplay.onclick = () => aud.paused ? aud.play() : aud.pause();
aud.addEventListener('playing', () => btnplay.value = '||');
aud.addEventListener('pause', () => btnplay.value = '>');
aud.addEventListener('timeupdate', () => {
let prog = 100 * aud.currentTime / aud.duration;
slider.value = prog;
per.innerText = toMin(aud.currentTime) + ' | ' + toMin(aud.duration);
for(j=0; j<lrcAr.length; j++){
if(aud.currentTime >= lrcAr) geci.innerHTML = lrcAr;
}
});
let toMin = (val) => {
if(!val) return '0:0';
val = Math.floor(val);
return parseInt(val / 60) + ':' +parseFloat(val % 60);
}
</script> 这个奇特,点击吃月饼,还能看到美美的音画。欣赏阳光哥哥好帖{:4_199:} 欣赏老师的精美制作{:4_187:} 大福利{:4_170:} 非常开心 发表于 2023-9-29 22:47
欣赏老师的精美制作
从你的【中秋·国庆】欢度国庆 纯音乐 - 欢度国庆 里偷来的代码{:4_189:} 三月的阳光 发表于 2023-10-1 14:43
从你的【中秋·国庆】欢度国庆 纯音乐 - 欢度国庆 里偷来的代码
这个代码黑黑老师分享过的 很早的代码了,现在用的也是好的,吃月饼刚好{:4_173:} 阳光节日快乐!{:4_187:} 制作真棒!欣赏阳光兄好帖,节日快乐!问好!
{:4_187:}{:4_199:}{:4_191:}{:4_179:}
页:
[1]