加林森 发表于 2022-3-19 19:29

本帖最后由 加林森 于 2022-5-20 22:01 编辑 <br /><br />大猫咪 发表于 2022-3-19 19:28
嗯嗯和队长一起继续努力
好的,猫猫我们一起努力。{:4_179:}

<style>
.wrap {
      left: -30px;
      width: 820px; height: 528px;
      background: teal url('https://pic.imgdb.cn/item/62879ee6094754312975ac03.jpg') no-repeat center/cover;
      position: relative;
}
.circle {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 80px; height: 80px;
      left: 10px; bottom: 10px;
      border: solid 6px transparent;
      border-radius: 50%;
      background-image: radial-gradient(ghostwhite, transparent), linear-gradient(120deg,tomato,green,red,gold);
      background-origin: border-box;
      background-clip: content-box, border-box;
      cursor: pointer;
      font: normal 14px sans-serif;
      position: absolute;
}
.circle::before { position: absolute; content: attr(data-per); bottom: 20%;}
.circle::after { position: absolute; content: ''; width: 10px; height: 10px; background: olive; border-radius: 50%; }
.hand {
      position: absolute; width: 2px; height: 50%;
      bottom: 50%; background: rgba(200,20,20,.45);
      transform-origin: bottom;
}
</style>

<div class="wrap">
      <div class="circle" data-per="0%">
                <div class="hand"></div>
      </div>
</div>
<audio id="aud" src="http://www.kumeiwp.com/sub/filestores/2022/05/08/2ed19b10f0fff838c20c3183be49afa0.mp3" autoplay="autoplay" loop="loop"></audio>

<script>
let circle = document.querySelector('.circle');
let hand = document.querySelector('.hand');
let aud = document.querySelector('#aud');
let current, task;

aud.addEventListener('timeupdate', function(){
      task = aud.duration;
      current = aud.currentTime;
      setProgress(task,current);
});

circle.onclick = () =>{ aud.paused ? aud.play() : aud.pause(); };

function setProgress(tt,cc) {
      if(tt <= 0 || cc <= 0) return false;
      let prog = 100 * cc / tt;
      hand.style.transform = `rotate(${360*prog/100}deg`;
      circle.setAttribute('data-per', prog.toFixed(2) + '%');
}
</script>

红影 发表于 2022-3-19 20:28

加林森 发表于 2022-3-19 15:31
谢谢红影支持!

队长的帖子越做越漂亮了{:4_187:}

加林森 发表于 2022-3-19 20:47

红影 发表于 2022-3-19 20:28
队长的帖子越做越漂亮了

还在学习中~~~~~~~~~~~

红影 发表于 2022-3-19 22:52

加林森 发表于 2022-3-19 20:47
还在学习中~~~~~~~~~~~

这个很棒的{:4_187:}

加林森 发表于 2022-3-19 23:19

红影 发表于 2022-3-19 22:52
这个很棒的

嗯嗯

红影 发表于 2022-3-20 14:20

加林森 发表于 2022-3-19 23:19
嗯嗯

队长的这个蝴蝶在这个帖子里特别漂亮,我收藏了{:4_173:}

加林森 发表于 2022-3-20 16:17

红影 发表于 2022-3-20 14:20
队长的这个蝴蝶在这个帖子里特别漂亮,我收藏了

蝴蝶好看,你收藏吧。

红影 发表于 2022-3-21 11:38

加林森 发表于 2022-3-20 16:17
蝴蝶好看,你收藏吧。

已经收藏了{:4_173:}

加林森 发表于 2022-3-21 12:24

红影 发表于 2022-3-21 11:38
已经收藏了

嗯嗯,那就好。
页: 1 [2]
查看完整版本: 《 繁花尽》 -- 锦零