乔瓦尼 - 云彩之外
本帖最后由 马黑黑 于 2022-6-18 21:05 编辑 <br /><br /><style>.outer { left: -214px; width: 1024px; height: 640px; background: linear-gradient(to right top,black,#eee); position: relative; }
.outer h2 { position: absolute; margin: 20px; font: bold 1.5em sans-serif;color: #ccc; text-shadow: 1px 1px 2px #000; }
.picbox { position: absolute; width: 1024px; height: 640px; animation: fadein 2s; }
.mama { left: 20px; bottom: 40px; width: fit-content; height: fit-content; position: absolute; cursor: pointer; border-radius: 0 100%; background: linear-gradient(transparent,green); }
.wrap { width: 90px; height: 60px; box-reflect: below 0 linear-gradient(rgba(0,0,0,.01),#000); -webkit-box-reflect: below 0 linear-gradient(rgba(0,0,0,.01),#000); position: relative; }
.mama meter { width: 90px; position: relative; }
.wrap span { width: 6px; height: 60px; bottom: -8px; display: inline-block; position: absolute; }
.wrap span::before { position: absolute; content: ''; width: inherit; height: 3px; background: #eee; top: -3px; animation: up 1s ease-in infinite; }
@keyframes up { from { top: -6px; } to { top: -16px; } }
@keyframes fadein { from { opacity: .1; } to {opacity: 1; } }
@keyframes fadeout { from { opacity: 1; } to {opacity: .4; } }
</style>
<div class="outer">
<h2>乔瓦尼 - 云彩之外</h2>
<img class="picbox" src="https://638183.freep.cn/638183/qd/6181.jpg" alt="" />
<div class="mama">
<div class="wrap"></div>
<meter id="meter" value="0" min="0" max="100" low="33" high="66" optimum="70"></meter>
</div>
</div>
<audio id="aud" src="http://www.kumeiwp.com/sub/filestores/2022/06/14/cb2c241e66f488323a6dc1ae7fd35564.mp3" autoplay="autoplay" loop="loop"></audio>
<script>
let mama = document.querySelector('.mama'),
picbox = document.querySelector('.picbox'),
wrap = document.querySelector('.wrap'),
lrcbox = document.querySelector('.lrcbox'),
aud = document.querySelector('#aud'),
meter = document.querySelector('#meter');
let num = (min, max) => Math.floor(Math.random() * (max-min+1)) + min,
prog = (tt, cc) => 100 * cc / tt;
let picAr = ['1','2','3','4','5'], idx = 0, flag = true;
let newPic = picAr.map((img) => {
return ('https://638183.freep.cn/638183/qd/618' + img + '.jpg');
})
Array.from({length: 10}).forEach((ele,key) => {
ele = document.createElement('span');
ele.className = 'sskey';
ele.style.left = key * 6 + key * 3 + 'px';
ele.style.height = num(10,60) + 'px';
ele.style.backgroundColor = `rgba(${num(0,255)},${num(0,255)},${num(0,255)},.95)`;
wrap.appendChild(ele);
})
let sskey = document.querySelectorAll('.sskey');
mama.onclick = () => aud.paused ? aud.play() : aud.pause();
aud.addEventListener('timeupdate', () => {
Array.from(sskey).forEach((ele) => {
ele.style.height = num(10, 60) + 'px';
})
meter.value = prog(aud.duration, aud.currentTime);
});
let timer = setInterval(() => {
picbox.style.animation = '';
idx ++;
if(idx >= picAr.length) idx = 0;
picbox.src = newPic;
flag ? (picbox.style.animation = 'fadeout 2s', flag = false) : (picbox.style.animation = 'fadein 2s', flag = true);
}, 5000);
</script> 沙发我的{:4_174:} 小辣椒 发表于 2022-6-18 21:19
沙发我的
巴适得板 黑黑又一个新产品{:4_178:} 小辣椒 发表于 2022-6-18 21:21
黑黑又一个新产品
这个是简单的图片轮换,加了关键帧动画效果 + img + '.jpg'精彩{:4_178:} 马黑黑 发表于 2022-6-18 21:22
这个是简单的图片轮换,加了关键帧动画效果
黑黑你这个速度真的太快了,每天电脑不关的吧{:4_189:} 小辣椒 发表于 2022-6-18 21:23
+ img + '.jpg'精彩
嗯,试一下 map 函数 小辣椒 发表于 2022-6-18 21:23
黑黑你这个速度真的太快了,每天电脑不关的吧
哪里?准时关机的 我现在这样,上来比你时间少多了,还被批斗{:4_201:} 这最后一个脚能放成这样也是本事啊 小辣椒 发表于 2022-6-18 21:24
我现在这样,上来比你时间少多了,还被批斗
{:4_173:} 绿叶清舟 发表于 2022-6-18 21:25
这最后一个脚能放成这样也是本事啊
都是练过瑜伽的 马黑黑 发表于 2022-6-18 21:25
所以经常漏看,很多帖没有回复 赏心悦目的画面,黑黑老师棒棒哒{:4_187:} 马黑黑 发表于 2022-6-18 21:21
巴适得板
今天这个要学习做一次 全是大美女啊,还有隐约的标题,漂亮的制作{:4_187:} 红影 发表于 2022-6-18 21:52
全是大美女啊,还有隐约的标题,漂亮的制作
这个其实好简单的 哇噻,老黑也发大美女出来玩啦。{:4_189:} 加林森 发表于 2022-6-18 21:56
哇噻,老黑也发大美女出来玩啦。
父亲节吗,要自己犒劳自己{:4_170:}