楼主: 花简静

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

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







点评
回复

使用道具

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

<style> #mydiv { margin: 130px 0 20px calc(50% - 931px); width: 1700px; height: 900px; background: lightgreen url('https://642303.freep.cn/642303/tu/toyu.webp') no-repeat center/cover; box-shadow: 4px 4px 8px gray; box-sizing: border-box; overflow: hidden; z-index: 1; position: relative;}   #play { position: absolute; width: 100px; right: calc(26% - 100px); bottom: 180px; opacity: .7; cursor: pointer; animation: rotating 5s linear infinite var(--state);z-index: 100; } #vid {     position: absolute;     right: 0;     width: 100%;     height: 110%;     bottom:-180px;     object-fit: cover;     mix-blend-mode: screen;     opacity: .80;     pointer-events: none;     transform: rotateX(180deg);     } canvas { z-index: 99; pointer-events: none; } @keyframes rotating { to { transform: rotate(360deg); } } </style> <div id="mydiv"> <audio id="aud" src="https://music.163.com/song/media/outer/url?id=495562302" autoplay></audio> <video id="vid" src="https://img.tukuppt.com/video_show/2405811/00/70/22/607f0a9c8e2cf.mp4" muted loop></video> <img id="play" src="https://638183.freep.cn/638183/small/ujye.webp" alt="" /> </div> <script> let sF = document.createElement('script'); sF.charset = 'utf-8'; sF.src = 'https://638183.freep.cn/638183/web/js/ball-lz.js'; document.body.appendChild(sF); let lz = {papa: 'body', total: 100, maxsize: 20, speed: 1, move: false};   var ww = mydiv.offsetWidth; var step = 0.5, begin1 = 0, begin2 = ww, raf; aud.loop = false; aud.onpause = aud.onplaying = () => moving(); aud.onseeked = () => cancelAnimationFrame(raf); aud.onended = () => { cancelAnimationFrame(raf); aud.play(); }; play.onclick = () => { aud.paused ? aud.play() : aud.pause(); }; var moving = () => { begin1 -= step; begin2 -= step; if(begin1 <= -ww) begin1 = ww; if(begin2 <= -ww) begin2 = ww;   let b2 = begin2 + (begin1 >= 0 ? 1 : -1); mydiv.style.setProperty('--begin1', begin1 + 'px'); mydiv.style.setProperty('--begin2', b2 + 'px'); aud.paused ? (cancelAnimationFrame(raf), mydiv.style.setProperty('--state', 'paused'), vid.pause()) : (raf = requestAnimationFrame(moving), mydiv.style.setProperty('--state', 'running'),vid.play()); lz.move = !aud.paused; };   </script> <br><br><br><br><br><br>
点评
回复

使用道具

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

使用道具

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

使用道具

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

使用道具

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

使用道具

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

使用道具

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

使用道具

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

使用道具

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

使用道具

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

本版积分规则

手机版|千山论坛

GMT+8, 2024-9-21 10:38

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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