楼主: 花简静

花简静贴子代码及说明汇总(翻页有新贴)

[复制链接]
 楼主| 发表于 2024-7-28 19:31 | 显示全部楼层
本帖最后由 花简静 于 2024-7-28 19:32 编辑

点评
回复

使用道具

 楼主| 发表于 2024-7-28 19:31 | 显示全部楼层
本帖最后由 花简静 于 2024-8-18 15:40 编辑

<!-- 第一部分 :css代码 -->   <style> /* 帖子容器id选择器 */ #mydiv {     position: relative;     margin: 30px 0 30px calc(50% - 931px);     width: 1700px;     height: 900px;     background: url('https://pic.imgdb.cn/item/66a62b9cd9c307b7e9c9a138.webp') no-repeat center/cover;     overflow: hidden; }   /* 小播class选择器 */ .player {     position: absolute;     bottom: 40px;     width: 120px;     height: 120px;     opacity: .7;     cursor: pointer;     mix-blend-mode: screen;     animation: rot 8s linear infinite var(--state); } .player:nth-of-type(3) { width: 130px;height: 130px;right: 558px;bottom:60px; } /* 对标的 img 标签排在帖子中第3位 */ .player:nth-of-type(4) {border-radius: 50%;width: 95px;height: 95px; right: 296px;bottom:67px; } /* 对标的 img 标签排在帖子中第4位 */ .player:nth-of-type(5) {border-radius: 50%;width: 72px;height: 72px; right: 66px;bottom:127px; } /* 对标的 img 标签排在帖子中第5位 */   /* 飞鹰图片选择器 */ .bird {     position: absolute;     right: 280px;     top: 300px; -webkit-mask: linear-gradient(0deg,transparent,red 20% );/* 这是第一个人物图片,裙边加了个羽化效果,如果不需要可以删掉 */ } .bird:nth-of-type(2) {mix-blend-mode: screen;right: -100px;top: 120px; animation: fly 10s linear infinite var(--state);} /* 对标的 img 标签排在帖子中第2位 :提前2秒执行动画 */     /* 视频class选择器 */ .vid {     position: absolute;     bottom: 0;     width: 200px;     height: 200px;     object-fit: cover;     border-radius: 50%;     pointer-events: none;     opacity: 1;     mix-blend-mode: screen; } .vid:nth-of-type(1) { width: 193px;height: 193px;left: 221px; bottom:169px;} /* 对标的 video 标签排在帖子中第1位 */ .vid:nth-of-type(2) { width: 293px;height: 291px;left: 215px; top:53px; filter: hue-rotate(170deg);} /* 对标的 video 标签排在帖子中第2位 */ .vid:nth-of-type(3) { width: 173px;height: 163px;left: 612px; bottom:100px; } /* 对标的 video 标签排在帖子中第2位 */ @keyframes rot { to { transform: rotate(360deg); } } @keyframes fly { to { right: 1600px; } } </style>   <!-- 第二部分 :html代码 父元素带9个子元素 --> <div id="mydiv">     <audio id="aud" src="https://music.163.com/song/media/outer/url?id=554533308" autoplay loop></audio>     <video class="vid" src="https://img.tukuppt.com/video_show/7165162/00/20/67/5f33b039ec172.mp4" autoplay loop muted></video>     <video class="vid" src="https://img.tukuppt.com/video_show/2418175/00/02/29/5b549aa7d9d73.mp4" autoplay loop muted></video>     <video class="vid" src="https://img.tukuppt.com/video_show/2405179/00/02/42/5b5fca1e49229.mp4" autoplay loop muted></video>     <img class="bird" alt="" src="https://pic.imgdb.cn/item/64a6bf971ddac507cc8e8bc1.gif" />     <img class="bird" alt="" src="https://pic.imgdb.cn/item/62479cbe27f86abb2adbb9bd.gif" />     <img class="player" alt="" src="https://pic.imgdb.cn/item/6598d139871b83018a7e2714.gif" title="播放/暂停" />     <img class="player" alt="" src="https://pic.imgdb.cn/item/658f974ac458853aef249938.gif" title="播放/暂停" />     <img class="player" alt="" src="https://pic.imgdb.cn/item/64d72ecd1ddac507cc41a985.gif" title="播放/暂停" /> </div>   <!-- 第三部分 :JS代码 -->   <script> //声明并获取待控制的元素集合变量 : vids 视频、players 小播、birds 图片飞鹰 var vids = mydiv.querySelectorAll('.vid'),     players = mydiv.querySelectorAll('.player'),     birds = mydiv.querySelectorAll('.bird');   //联动控制函数 var mState = () => {     mydiv.style.setProperty('--state', aud.paused ? 'paused' : 'running');     vids.forEach(vid => aud.paused ? vid.pause() : vid.play());     players.forEach(player => player.title = aud.paused ? '播放' : '暂停'); };   //audio空间三个监听事件 aud.oncanplay = aud.onplaying = aud.onpause = () => mState();   //小播点击事件 players.forEach(player => player.onclick = () => aud.paused ? aud.play() : aud.pause()); </script>
点评
回复

使用道具

 楼主| 发表于 2024-7-28 19:31 | 显示全部楼层
点评
回复

使用道具

 楼主| 发表于 2024-7-28 19:42 | 显示全部楼层
3333.jpg
点评
回复

使用道具

 楼主| 发表于 2024-7-29 17:26 | 显示全部楼层
点评
回复

使用道具

 楼主| 发表于 2024-7-29 17:26 | 显示全部楼层
点评
回复

使用道具

 楼主| 发表于 2024-7-29 17:27 | 显示全部楼层
点评
回复

使用道具

 楼主| 发表于 2024-7-29 17:27 | 显示全部楼层
点评
回复

使用道具

 楼主| 发表于 2024-7-29 17:27 | 显示全部楼层
点评
回复

使用道具

 楼主| 发表于 2024-7-29 17:27 | 显示全部楼层
点评
回复

使用道具

您需要登录后才可以回帖 登录 | 中文注册

本版积分规则

手机版|千山论坛 ( 冀ICP备2024055714号 )

GMT+8, 2025-9-18 01:48

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表