加林森 发表于 2022-4-24 21:03

本帖最后由 加林森 于 2022-6-19 14:38 编辑 <br /><br />大猫咪 发表于 2022-4-24 21:02

{:4_179:}{:5_161:}

<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://s1.ax1x.com/2022/06/19/XXIwOf.jpg" alt="" />
let picAr =[
    'https://s1.ax1x.com/2022/06/19/XXo7b8.jpg',
    'https://pic.imgdb.cn/item/62a487090947543129e21464.jpg',
    'https://pic.imgdb.cn/item/62a1b7d40947543129a2100c.jpg'
    'https://pic.imgdb.cn/item/62ae90260947543129fde36e.jpg',
    'https://pic.imgdb.cn/item/62ae91570947543129ff6e25.jpg'
];
       <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/18/c5f20b1544312d255428602d376c8605.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;

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 = picAr;
        flag ? (picbox.style.animation = 'fadeout 2s', flag = false) : (picbox.style.animation = 'fadein 2s', flag = true);
}, 5000);

</script>

红影 发表于 2022-4-25 21:17

加林森 发表于 2022-4-24 16:40
我在新的编辑器里面制作的,结果它就自动反转了、

有个绕Y轴旋转的语句在里面的。

加林森 发表于 2022-4-25 21:22

红影 发表于 2022-4-25 21:17
有个绕Y轴旋转的语句在里面的。

嗯嗯,现在修改过来了。

红影 发表于 2022-4-25 21:48

马黑黑 发表于 2022-4-24 17:12
我的原帖用了rotateY,是因为图片不合适,要调整一下。队长应该吧这个去掉,这样就可以了

饿呢,一猜就是这原因{:4_173:}

红影 发表于 2022-4-25 22:05

马黑黑 发表于 2022-4-24 18:47
正解。这是根据需要来的

所以,有的时候,照搬会有问题的{:4_173:}

红影 发表于 2022-4-25 23:11

加林森 发表于 2022-4-25 21:22
嗯嗯,现在修改过来了。

嗯,看到了,文字变过来了。

马黑黑 发表于 2022-4-25 23:19

红影 发表于 2022-4-25 22:05
所以,有的时候,照搬会有问题的

对。吃透源码,再改装,这是比较理想的拿来主义

加林森 发表于 2022-4-25 23:20

红影 发表于 2022-4-25 23:11
嗯,看到了,文字变过来了。

嗯嗯。谢谢你!

马黑黑 发表于 2022-4-25 23:25

红影 发表于 2022-4-25 21:48
饿呢,一猜就是这原因
也挺好玩的

红影 发表于 2022-4-26 21:24

马黑黑 发表于 2022-4-25 23:25
也挺好玩的

弄过一遍,队长一定会体会更深的。

马黑黑 发表于 2022-4-26 21:24

红影 发表于 2022-4-26 21:24
弄过一遍,队长一定会体会更深的。

应该是
页: 1 [2]
查看完整版本: 《思念一个人可以思念到多久》 -- 南宫嘉骏