朵拉 发表于 2024-5-29 21:01

I KNOW(马黑黑原创)

本帖最后由 朵拉 于 2024-5-29 21:12 编辑 <br /><br /><style>
      #papa { margin: 20px 0 20px calc(50% - 721px); width: 1280px; height: 720px; background: lightblue; box-shadow: 2px 2px 6px #000; overflow: hidden; z-index: 1; position: relative; }
      .vid { position: absolute; top: -70px; width: 100%; height: calc(100% + 70px); object-fit: cover; pointer-events: none; }
      .vid:nth-of-type(2) { height: 60%; height: 60%; transform: rotate(-10deg); mix-blend-mode: screen; opacity: .5; }
      .star { position: absolute; left: 300px; top: 40px; cursor: pointer; animation: ani 1.5s linear infinite alternate var(--state); }
      .star:nth-of-type(2) { left: 480px; top: 160px; animation-delay: -.5s; }
      .star:nth-of-type(3) { left: 600px; top: 10px; animation-delay: -1s; }
      @keyframes ani { from { transform: rotate(-10deg) scale(.8); opacity: .2; } to { transform: rotate(10deg) scale(1.5); opacity: .9; } }
</style>

<div id="papa">
      <audio id="aud" src="https://music.163.com/song/media/outer/url?id=2127673618" autoplay loop></audio>
      <video class="vid" src="https://img.tukuppt.com/video_show/2419216/00/01/98/5b5459ad8a034.mp4" loop muted></video>
      <video class="vid" src="https://img.tukuppt.com/video_show/2269348/00/02/02/5b4efb7022208.mp4" loop muted></video>
      <img class="star" alt="" src="https://638183.freep.cn/638183/t22/webp/star.webp" />
      <img class="star" alt="" src="https://638183.freep.cn/638183/t22/webp/star.webp" />
      <img class="star" alt="" src="https://638183.freep.cn/638183/t22/webp/star.webp" />
</div>

<script>
(function() {
      const vids = document.querySelectorAll('.vid'), stars = document.querySelectorAll('.star');
      aud.onplaying = aud.onpause = () => {
                papa.style.setProperty('--state', aud.paused ? 'paused' : 'running');
                vids.forEach( vid => aud.paused ? vid.pause() : vid.play());
                stars.forEach(star => star.title = aud.paused ? '点击播放' : '点击暂停');
      };
      stars.forEach(star => star.onclick = () => aud.paused ? aud.play() : aud.pause());
})();
</script>

朵拉 发表于 2024-5-29 21:13

纪念一下 小破游~~

朵拉 发表于 2024-5-29 21:13

@马黑黑
老师 晚上好,学生交作业,请指正哈{:4_190:}

马黑黑 发表于 2024-5-29 21:19

{:4_199:}

红影 发表于 2024-5-29 21:43

漂亮,欣赏朵宝好帖{:4_204:}

愤怒的葡萄 发表于 2024-5-29 21:58

现在都流行三颗星啊?

梦江南 发表于 2024-5-30 09:25

欣赏老师美帖!{:4_199:}
页: [1]
查看完整版本: I KNOW(马黑黑原创)