楼主: 凡哥

[碎语] 源码小屋

[复制链接]
一生安柠 青恬时光 幸福莓满 心想事橙 桃气满满 梅开颜笑 心若葡提 大吉大荔 樱果相依 喜上莓梢 一坛酒
 楼主| 发表于 2024-6-26 08:03 | 显示全部楼层

2024年6月26日 星期三

永远的长安

<style> #tz { margin: 30px 0; left: 50%; transform: translateX(calc(-50% - 90px)); width: 1280px; height: 624px; overflow: hidden; background: lightblue url('https://638183.freep.cn/638183/t24/3/ihan.jpg') no-repeat center/cover; border: 10px inset tan; z-index: 1; position: relative; --distance: 1280px; } li-zi { position: absolute; top: -100px; border-radius: 50%; animation: fly 20s cubic-bezier(0.09, -0.12, 0.92, 0.47) infinite var(--state); } #player { position: absolute; left: calc(50% - 60px); top: 30px; width: 120px; height: 120px; cursor: pointer; filter: hue-rotate(60deg); transition: .5s; animation: rot 8s linear infinite var(--state); } #player:hover { filter: hue-rotate(0); } @keyframes fly { to { transform: rotate(-90deg) translateY(var(--distance)); } } @keyframes rot { to { transform: rotate(-1turn); } } </style>   <div id="tz">     <audio id="aud" src="https://music.163.com/song/media/outer/url?id=75388" autoplay loop></audio>     <img id="player" alt="" title="播放" src="https://638183.freep.cn/638183/small/hxxb.webp" /> </div>   <script> new Array(total = 80).fill(0).map((i,k) => {     i = document.createElement('li-zi');     i.innerText = ['🌸','💮','🌺'][k % 3];     i.style.cssText += `         left: ${Math.floor(20 * Math.random()) - 10}%;         animation-delay: -${Math.random() * 20}s;     `;     tz.prepend(i); }); var mState = () => {     tz.style.setProperty('--state', ['running','paused'][+aud.paused]);     player.title = ['暂停','播放'][+aud.paused]; }; aud.oncanplay = aud.onplaying = aud.onpause = () => mState(); player.onclick = () => aud.paused ? aud.play() : aud.pause(); var sF = document.createElement('script'); sF.src = 'https://638183.freep.cn/638183/web/api/fullscreen.js'; sF.charset = 'utf-8'; document.querySelector('body').appendChild(sF); sF.onload = () => FS({     papa: '#tz',     css: 'top: 160px; left: 50%; transform: translate(-50%); --color: snow; --fsBg: rgba(224,144,113,.7);', }); window.onresize = () => tz.style.setProperty('--distance', tz.offsetWidth + 'px'); </script>

评分

1

查看全部评分

点评
回复

使用道具

一生安柠 青恬时光 幸福莓满 心想事橙 桃气满满 梅开颜笑 心若葡提 大吉大荔 樱果相依 喜上莓梢 一坛酒
 楼主| 发表于 2024-6-26 08:07 | 显示全部楼层
花简静 发表于 2024-6-24 22:03
老师把这个说得好详细。。
经常会有这些小符号出 点问题的。。
现在可算是能找准了。。 ...

点评
回复

使用道具

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

刚磨好,新鲜出炉的香着呢
点评
回复

使用道具

一叶知秋 版主勋章 山高为峰 山外有山 樱果相依 24 46 47 48 闲花落
发表于 2024-6-26 21:13 | 显示全部楼层
凡哥 发表于 2024-6-26 08:03
2024年6月26日 星期三
永远的长安

符号粒子飞舞
点评
回复

使用道具

一生安柠 青恬时光 幸福莓满 心想事橙 桃气满满 梅开颜笑 心若葡提 大吉大荔 樱果相依 喜上莓梢 一坛酒
 楼主| 发表于 2024-6-27 12:47 | 显示全部楼层

挺漂酿的吧
点评
回复

使用道具

一生安柠 青恬时光 幸福莓满 心想事橙 桃气满满 梅开颜笑 心若葡提 大吉大荔 樱果相依 喜上莓梢 一坛酒
 楼主| 发表于 2024-6-27 12:47 | 显示全部楼层
花简静 发表于 2024-6-26 21:12
刚磨好,新鲜出炉的香着呢

蟹蟹
点评
回复

使用道具

一生安柠 青恬时光 幸福莓满 心想事橙 桃气满满 梅开颜笑 心若葡提 大吉大荔 樱果相依 喜上莓梢 一坛酒
 楼主| 发表于 2024-6-27 12:52 | 显示全部楼层

2024年6月27日 星期四

程池 - 敦煌生命

<style> #tz {     --width: 1024px;     margin: 30px 0 30px calc(50% - (var(--width) / 2 + 1px));     width: var(--width);     height: 640px;     background: url('https://638183.freep.cn/638183/t24/3/dyhl.jpg') no-repeat center/cover;     box-shadow: 3px 3px 8px rgba(0, 0, 0, .6);     overflow: hidden;     position: relative; } #player {     position: absolute;     display: grid;     place-items: center;     left: 75%;     top: 52%;     width: var(--ww);     height: var(--ww);     background: url('https://638183.freep.cn/638183/t23/btn/f5.png') no-repeat 50%/60%;     border-radius: 50%;     cursor: pointer;     transition: .7s;     animation: rot 6s linear infinite var(--state);     --ww: 120px;     --size: 20px; } #player:hover { filter: hue-rotate(30deg); } c-c {     position: absolute;     width: var(--size);     height: var(--size);     border-radius: 50%;     background: linear-gradient(green, cyan);     box-shadow: 0 0 6px rgba(0, 0, 0, .1);     animation: flyout 2s forwards; } #vid {     position: absolute;     bottom: 0;     width: 100%;     height: calc(100% + 60px);     object-fit: cover;     mix-blend-mode: overlay;     pointer-events: none; } #tz:fullscreen #vid { height: calc(100% + 100px); } @keyframes flyout {     to { transform: rotate(var(--deg)) translateY(calc(var(--ww) / 2)); } } @keyframes flyin {     from { transform: rotate(var(--deg)) translateY(calc(var(--ww) / 2)); }     to { transform: rotate(calc(var(--deg) * 2)) translateY(0); } } @keyframes rot {     to { transform: rotate(360deg); } } </style>   <div id="tz">     <audio id="aud" src="https://music.163.com/song/media/outer/url?id=75392" autoplay loop></audio>     <video id="vid" src="https://img.tukuppt.com/video_show/15653652/00/29/96/5fa09f4e88257.mp4" muted autoplay loop></video>     <div id="player" title="暂停"></div> </div>   <script> var ccs = []; new Array(total = 12).fill(0).map((c,k) => {     c = document.createElement('c-c');     c.style.cssText += `--deg: ${360 / total * k}deg`;     player.appendChild(c);     ccs.push(c); });   var mState = () => {     player.style.setProperty('--state', aud.paused ? 'paused' : 'running');     player.title = ['暂停','播放'][+aud.paused];     ccs.forEach(cc => cc.style.animationName = aud.paused ? 'flyin' : 'flyout');     aud.paused ? vid.pause() : vid.play(); };   aud.oncanplay = aud.onplaying = aud.onpause = () => mState();   player.onclick = () => aud.paused ? aud.play() : aud.pause();   var sF = document.createElement('script'); sF.src = 'https://638183.freep.cn/638183/web/api/fullscreen.js'; sF.charset = 'utf-8'; document.querySelector('body').appendChild(sF); sF.onload = () => FS({     papa: '#tz',     css: 'bottom: 20px; left: 50%; transform: translate(-50%); --color: lightblue; --fsBg: rgba(0,128,0,.5);', }); </script>

评分

1

查看全部评分

点评
回复

使用道具

一叶知秋 版主勋章 山高为峰 山外有山 樱果相依 24 46 47 48 闲花落
发表于 2024-6-27 20:32 | 显示全部楼层

好哒,给老师来个水煮三鲜。。
点评
回复

使用道具

一叶知秋 版主勋章 山高为峰 山外有山 樱果相依 24 46 47 48 闲花落
发表于 2024-6-27 20:33 | 显示全部楼层
凡哥 发表于 2024-6-27 12:52
2024年6月27日 星期四
程池 - 敦煌生命

这贴子效果真是太绝了。
变幻的光影有电影大片的效果
点评
回复

使用道具

一叶知秋 版主勋章 山高为峰 山外有山 樱果相依 24 46 47 48 闲花落
发表于 2024-6-27 20:34 | 显示全部楼层

非常漂亮。。养眼之极
点评
回复

使用道具

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

本版积分规则

手机版|千山论坛

GMT+8, 2024-9-20 07:59

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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