楼主: 凡哥

[碎语] 源码小屋

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

2024年7月2日 星期二

西亚风光

<style>     #papa { --width: 1024px; margin: 30px 0 30px calc(50% - (var(--width) / 2 + 90px)); width: var(--width); height: 683px; background: url('https://638183.freep.cn/638183/t24/3/xyfg.jpg') no-repeat center/cover; z-index: 1; overflow: hidden; box-shadow: 3px 3px 8px #666; position: relative; }     #player { position: absolute; left: calc(50% - 50px); bottom: 100px; width: 100px; height: 100px; background: linear-gradient(green,lightgreen) repeat-y center/5% 5%, linear-gradient(to right,green,lightgreen) repeat-x center/5% 5%; border: thick double; border-color: green lightgreen; border-radius: 50%; cursor: pointer; animation: rot 6s linear infinite var(--state); }     #player:hover { transform: scale(1.2); filter: drop-shadow(0 50px 0 green); } #player::before, #player::after { position: absolute; content: ''; } #player::before { inset: 0; background: inherit; transform: rotate(45deg); } #player::after { inset: 40px; background: green; border-radius: 50%; }     .vid { position: absolute; width: 100%; height: 50%; object-fit: cover; pointer-events: none; }     .vid:nth-of-type(1) { bottom: 0; mix-blend-mode: screen; }     .vid:nth-of-type(2) { height: 25%; top: 0; mix-blend-mode: multiply; }     #papa:fullscreen .vid:nth-of-type(1) { height: 38%; }     @keyframes rot { to { transform: rotate(360deg); } } </style>   <div id="papa">     <audio id="aud" src="https://music.163.com/song/media/outer/url?id=29378862" autoplay loop></audio>     <video class="vid" src="https://img.tukuppt.com/video_show/7165162/00/19/89/5f17a860d9235.mp4" autoplay loop muted></video>     <video class="vid" src="https://img.tukuppt.com/video_show/2269348/00/17/44/5ec49820da8aa.mp4" autoplay loop muted></video>     <div id="player" titel="播放/暂停"></div> </div>   <script> var vids = papa.querySelectorAll('.vid'); 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: '#papa',     css: 'bottom: 20px; left: 50%; transform: translate(-50%); --color: lightblue; --fsBg: green;', }); var mState = () => {     player.style.setProperty('--state',['running','paused'][+aud.paused]);     player.title = ['暂停','播放'][+aud.paused];     vids.forEach(vid => aud.paused ? vid.pause() : vid.play()); }; aud.oncanplay = aud.onplaying = aud.onpause = () => mState(); player.onclick = () => aud.paused ? aud.play() : aud.pause(); </script>
点评
回复

使用道具

一生安柠 青恬时光 幸福莓满 心想事橙 桃气满满 梅开颜笑 心若葡提 大吉大荔 樱果相依 喜上莓梢 一坛酒
 楼主| 发表于 2024-7-2 12:20 | 显示全部楼层
花简静 发表于 2024-6-30 10:16
胃开心,人就开心

有道理
点评
回复

使用道具

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

2024年7月4日

故梦

<style> #mydiv { --width: 1280px; margin: 220px 0 30px calc(50% - (var(--width) / 2 + 90px)); width: var(--width); height: 720px; background: radial-gradient(circle at 29% 55%, hsla(329,0%,99%,0.05) 0%, hsla(329,0%,99%,0.05) 4%,transparent 4%, transparent 44%,transparent 44%, transparent 100%),radial-gradient(circle at 85% 89%, hsla(329,0%,99%,0.05) 0%, hsla(329,0%,99%,0.05) 51%,transparent 51%, transparent 52%,transparent 52%, transparent 100%),radial-gradient(circle at 6% 90%, hsla(329,0%,99%,0.05) 0%, hsla(329,0%,99%,0.05) 53%,transparent 53%, transparent 64%,transparent 64%, transparent 100%),radial-gradient(circle at 35% 75%, hsla(329,0%,99%,0.05) 0%, hsla(329,0%,99%,0.05) 6%,transparent 6%, transparent 98%,transparent 98%, transparent 100%),radial-gradient(circle at 56% 75%, hsla(329,0%,99%,0.05) 0%, hsla(329,0%,99%,0.05) 16%,transparent 16%, transparent 23%,transparent 23%, transparent 100%),radial-gradient(circle at 42% 0%, hsla(329,0%,99%,0.05) 0%, hsla(329,0%,99%,0.05) 3%,transparent 3%, transparent 26%,transparent 26%, transparent 100%),radial-gradient(circle at 29% 28%, hsla(329,0%,99%,0.05) 0%, hsla(329,0%,99%,0.05) 51%,transparent 51%, transparent 75%,transparent 75%, transparent 100%),radial-gradient(circle at 77% 21%, hsla(329,0%,99%,0.05) 0%, hsla(329,0%,99%,0.05) 35%,transparent 35%, transparent 55%,transparent 55%, transparent 100%),radial-gradient(circle at 65% 91%, hsla(329,0%,99%,0.05) 0%, hsla(329,0%,99%,0.05) 46%,transparent 46%, transparent 76%,transparent 76%, transparent 100%),linear-gradient(45deg, rgb(83, 91, 235), rgb(76, 11, 174)); box-shadow: 2px 3px 6px #666; overflow: hidden; z-index: 1; position: relative; } #player { position: absolute; left: calc(50% - 70px); top: 50px; width: 140px; filter: drop-shadow(0 0 20px white) hue-rotate(0deg); transition: width .75s; cursor: pointer; animation: rot 8s linear infinite var(--state), hue 30s linear infinite alternate var(--state); } #player:hover { width: 150px; } #vid { position: absolute; bottom: 0; width: 100%; height: calc(100% + 70px); object-fit: cover; mix-blend-mode: screen; pointer-events: none; } #mydiv:fullscreen #vid { height: calc(100% + 100px); } @keyframes rot { to { transform: rotate(360deg); } } @keyframes hue { to { filter: drop-shadow(0 0 20px white) hue-rotate(360deg); } } </style>   <div id="mydiv">     <audio id="aud" src="https://music.163.com/song/media/outer/url?id=29401808" autoplay loop></audio>     <video id="vid" src="https://img.tukuppt.com/video_show/15653652/01/04/18/6141bee77d77a.mp4" muted autoplay loop></video>     <img id="player" alt="" src="https://638183.freep.cn/638183/t23/btn/snow.webp" titel="播放/暂停" /> </div>   <script> 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: '#mydiv',     css: 'bottom: 20px; left: 50%; transform: translate(-50%); --color: lightblue; --fsBg: transparent;', }); var mState = () => {     player.style.setProperty('--state',['running','paused'][+aud.paused]);     player.title = ['暂停','播放'][+aud.paused];     aud.paused ? vid.pause() : vid.play(); }; aud.oncanplay = aud.onplaying = aud.onpause = () => mState(); player.onclick = () => aud.paused ? aud.play() : aud.pause(); </script>

评分

1

查看全部评分

点评
回复

使用道具

一叶知秋 版主勋章 山高为峰 山外有山 樱果相依 24 46 47 48 闲花落
发表于 2024-7-4 19:07 | 显示全部楼层
凡哥 发表于 2024-7-4 13:04
2024年7月4日
故梦

这个代码空前绝后,纯代码画的背景,真是震撼。。
点评
回复

使用道具

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

使用道具

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

我也有,哈哈。。
点评
回复

使用道具

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

Windows 10 企业版 G
好不容易升出来的。
点评
回复

使用道具

一生安柠 青恬时光 幸福莓满 心想事橙 桃气满满 梅开颜笑 心若葡提 大吉大荔 樱果相依 喜上莓梢 一坛酒
 楼主| 发表于 2024-7-5 20:04 | 显示全部楼层
花简静 发表于 2024-7-4 19:21
Windows 10 企业版 G
好不容易升出来的。

系统不是个问题。但是讲真,win11顶呱呱。
点评
回复

使用道具

一生安柠 青恬时光 幸福莓满 心想事橙 桃气满满 梅开颜笑 心若葡提 大吉大荔 樱果相依 喜上莓梢 一坛酒
 楼主| 发表于 2024-7-5 20:05 | 显示全部楼层
花简静 发表于 2024-7-4 19:07
这个代码空前绝后,纯代码画的背景,真是震撼。。

果酱果酱
点评
回复

使用道具

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

2024年7月5日 星期五

律动

<style> #mydiv { --width: 1280px; margin: 230px 0 30px calc(50% - (var(--width) / 2 + 90px)); width: var(--width); height: 720px; background-image: radial-gradient(circle at center center, rgb(143, 39, 176) 0%, rgb(143, 39, 176) 11%,rgb(128, 38, 169) 11%, rgb(128, 38, 169) 13%,rgb(113, 38, 163) 13%, rgb(113, 38, 163) 17%,rgb(98, 37, 156) 17%, rgb(98, 37, 156) 28%,rgb(83, 37, 150) 28%, rgb(83, 37, 150) 40%,rgb(68, 36, 143) 40%, rgb(68, 36, 143) 72%,rgb(53, 36, 137) 72%, rgb(53, 36, 137) 81%,rgb(38, 35, 130) 81%, rgb(38, 35, 130) 100%); box-shadow: 4px 3px 8px #666; overflow: hidden; z-index: 1; position: relative; display: grid; place-items: center; --bgsize: 25%; } #mydiv::before, #mydiv::after { position: absolute; content: ''; width: 100%; height: 100%; background-image: inherit; background-size: var(--bgsize); opacity: .4; transform: rotate(-45deg); pointer-events: none; animation: chg .25s linear infinite alternate var(--state); } #mydiv::after { transform: rotate(45deg); animation-delay: -0.125; } #player { position: absolute; width: 102px; filter: hue-rotate(0deg); transition: width .5s; cursor: pointer; animation: rot 8s linear infinite var(--state), hue 30s linear infinite alternate var(--state); } #player:hover { width: 120px; } @keyframes chg { to { --bgsize: 100%; } } @keyframes rot { to { transform: rotate(360deg); } } @keyframes hue { to { filter: hue-rotate(360deg); } } </style>   <div id="mydiv"> <audio id="aud" src="https://music.163.com/song/media/outer/url?id=1841432385" autoplay loop></audio> <img id="player" alt="" src="https://638183.freep.cn/638183/t23/btn/f5.png" titel="播放/暂停" /> </div>   <script> 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: '#mydiv',     css: 'bottom: 20px; left: 50%; transform: translate(-50%); --color: lightblue; --fsBg: transparent;', }); var mState = () => {     mydiv.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(); </script>
点评
回复

使用道具

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

本版积分规则

手机版|千山论坛

GMT+8, 2024-9-20 06:13

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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