楼主: 花简静

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

[复制链接]
一叶知秋 版主勋章 山高为峰 山外有山 樱果相依 24 46 47 48 闲花落
 楼主| 发表于 2024-5-31 20:11 | 显示全部楼层
本帖最后由 花简静 于 2024-5-31 20:12 编辑








点评
回复

使用道具

一叶知秋 版主勋章 山高为峰 山外有山 樱果相依 24 46 47 48 闲花落
 楼主| 发表于 2024-5-31 20:11 | 显示全部楼层
本帖最后由 花简静 于 2024-5-31 20:23 编辑

<style> #papa { margin: 130px 0 20px calc(50% - 931px) ; width: 1700px; height: 900px; background: url('https://642303.freep.cn/642303/tu/20240531NS01.webp') no-repeat center/cover; box-shadow: 2px 2px 5px #333; overflow: hidden; z-index: 1; position: relative; } .mama { position: absolute; left: 300px; bottom: 120px; width:80px; height: 80px; cursor: pointer; animation: rot 8s linear infinite var(--state); } .mama:nth-of-type(2) { right: 100px; bottom: 220px;} e-son { position: absolute; left: calc(50% - 2.5px); top:6px; width: 5px; height: 30px; border-radius: 100% 0; border: 1px solid gray; transform-origin: 50% 100%; transform: rotate(var(--deg)) translateY(-10px); background: hsla(var(--bg), 100%, 50%, .8); } #vid { position: absolute; bottom: 0; width: 100%; height: calc(100% + 80px); object-fit: cover; mix-blend-mode: screen; opacity: .23;} @keyframes rot { to { transform: rotate(360deg); } } </style> <div id="papa"> <audio id="aud" src="https://music.163.com/song/media/outer/url?id=1810268291" autoplay loop></audio> <video id="vid" src="https://img.tukuppt.com/video_show/7165162/00/20/67/5f33b039ec172.mp4" loop muted></video> <div class="mama" id="ma"></div> </div> <script> (function() { Array.from({length: 6}).forEach((e,k) => { e = document.createElement('e-son'); e.style.cssText += `--deg: ${60 * k}deg; --bg: ${Math.round(Math.random() * 360)};`; ma.appendChild(e); }); Array.from({length: 5}).forEach((item,key) => { //定位+色相转换数据数组 var pos = [[1130, 520, 60], [800, 741, 125], [1500, 300, 180],[1400, 600, 200],[500, 600, 290]]; item = document.getElementById('ma'); var clone = item.cloneNode(true); clone.id = 'ma' + key; clone.onclick = () => ma.click(); clone.style.cssText += ` left: ${pos[key][0]}px; top: ${pos[key][1]}px; filter: hue-rotate(${pos[key][2]}deg); `; papa.appendChild(clone); });   aud.onplaying = aud.onpause = () => { papa.style.setProperty('--state', aud.paused ? 'paused' : 'running'); aud.paused ? vid.pause() : vid.play(); }; ma.onclick = () => aud.paused ? aud.play() : aud.pause(); })(); </script> <Br><Br><Br><Br><Br><Br><Br>
点评
回复

使用道具

一叶知秋 版主勋章 山高为峰 山外有山 樱果相依 24 46 47 48 闲花落
 楼主| 发表于 2024-5-31 20:11 | 显示全部楼层
点评
回复

使用道具

一叶知秋 版主勋章 山高为峰 山外有山 樱果相依 24 46 47 48 闲花落
 楼主| 发表于 2024-5-31 20:11 | 显示全部楼层
点评
回复

使用道具

一叶知秋 版主勋章 山高为峰 山外有山 樱果相依 24 46 47 48 闲花落
 楼主| 发表于 2024-5-31 20:11 | 显示全部楼层
点评
回复

使用道具

一叶知秋 版主勋章 山高为峰 山外有山 樱果相依 24 46 47 48 闲花落
 楼主| 发表于 2024-6-1 23:04 | 显示全部楼层
点评
回复

使用道具

一叶知秋 版主勋章 山高为峰 山外有山 樱果相依 24 46 47 48 闲花落
 楼主| 发表于 2024-6-1 23:04 | 显示全部楼层
点评
回复

使用道具

一叶知秋 版主勋章 山高为峰 山外有山 樱果相依 24 46 47 48 闲花落
 楼主| 发表于 2024-6-1 23:04 | 显示全部楼层
点评
回复

使用道具

一叶知秋 版主勋章 山高为峰 山外有山 樱果相依 24 46 47 48 闲花落
 楼主| 发表于 2024-6-1 23:04 | 显示全部楼层
点评
回复

使用道具

一叶知秋 版主勋章 山高为峰 山外有山 樱果相依 24 46 47 48 闲花落
 楼主| 发表于 2024-6-1 23:04 | 显示全部楼层
点评
回复

使用道具

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|千山论坛

GMT+8, 2024-9-21 00:50

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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