查看: 2304|回复: 74

[特效] 【黑师代码】遨游(来个好玩的贴子)

[复制链接]
随遇而安

闲花落

版主勋章 山高为峰 山外有山 巳巳如意 两周年庆 守望千山 少年歌行 一叶知秋 樱果相依
发表于 2024-3-24 20:15 | 显示全部楼层 |阅读模式
本帖最后由 花简静 于 2024-3-24 20:24 编辑

遨游

评分

10

查看全部评分

点评
回复

使用道具

随遇而安

闲花落

版主勋章 山高为峰 山外有山 巳巳如意 两周年庆 守望千山 少年歌行 一叶知秋 樱果相依
 楼主| 发表于 2024-3-24 20:16 | 显示全部楼层
本帖最后由 花简静 于 2024-3-24 20:18 编辑

<style>     #papa { margin: 120px 0 0 calc(50% - 931px); width: 1700px; height: 600px; box-shadow: 3px 3px 20px #000; position: relative; overflow: hidden; z-index: 1; }     #canv { position: absolute;}     .pic { position: absolute; width: 240px; mix-blend-mode: screen; offset-path: path('M1924,280 Q750,180 -500,70'); transform: rotateX(180deg);offset-distance: 100%; animation: fly 60s var(--delay) infinite var(--state); --delay: 0s;z-index: 2;}     .pic:nth-of-type(2) { width: 60px;--delay: -20s; }     .pic:nth-of-type(3) { width: 90px;--delay: -40s; } @keyframes fly { to { offset-distance: 0; } }     #mypic { position: absolute; left: 26%; top: 60px; width: 80px; cursor: pointer; mix-blend-mode: multiply; transform: scale(0.8) rotate(-10deg); animation: scale 10s infinite alternate var(--state); }     #lrc { --motion: cover2; --tt: 1s; --bg: repeating-linear-gradient(135deg, orange 1px, yellow 6px); position: absolute;left: 50%; transform: translate(-50%); bottom: 20px; font: bold 2.4em sans-serif; color: hsl(100, 100%, 90%); white-space: pre; -webkit-background-clip: text; filter: drop-shadow(1px 1px 2px hsla(0, 100%, 0%, .85)); pointer-events: none; z-index: 900; }     #lrc::before { position: absolute; content: attr(data-lrc); width: 0%; height: 100%; color: transparent; border-bottom: 6px dotted orange; overflow: hidden; white-space: pre; background: var(--bg); filter: inherit; background-clip: text; -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards var(--state); }     @keyframes scale { to { transform: scale(1.2) rotate(360deg); } }     @keyframes cover1 { from { width: 0%; } to { width: 100%; } }     @keyframes cover2 { from { width: 0%; } to { width: 100%; } } </style>   <div id="papa">     <audio id="aud" src="https://music.163.com/song/media/outer/url?id=2051361761" loop autoplay></audio>     <img class="pic" src="https://pic.imgdb.cn/item/65ffbe039f345e8d036fc70e.png" alt="" />     <img class="pic" src="https://pic.imgdb.cn/item/65ffbed69f345e8d0375e3ec.png" alt="" />     <img class="pic" src="https://pic.imgdb.cn/item/65ffbee79f345e8d037664e0.png" alt="" />     <canvas id="canv"></canvas>     <img id="mypic" src="https://pic.imgdb.cn/item/65ffc0b29f345e8d0384c33c.png" alt="" title="播放/暂停" />     <div id="lrc" data-lrc="遨游">遨游</div> </div>   <script> var geci = [ [2,"",6] ];     var sf = document.createElement('script'); (function() {     let w = canv.width = papa.offsetWidth;     let h = canv.height = papa.offsetHeight;     let x = 0, step = 0.5, raf = null;     let ctx = canv.getContext('2d');     let img = document.createElement('img');     img.src = 'https://pic.imgdb.cn/item/65ffbcb79f345e8d036628f7.webp';       let mState = () => {         aud.paused ?             (papa.style.setProperty('--state', 'paused'),mypic.title = '点击播放') :             (papa.style.setProperty('--state', 'running'), mypic.title = '点击暂停');         move();     }       let move = () => {         ctx.clearRect(0,0,w,h);         x -= step;         if(x <= -w) x = 0;         ctx.drawImage(img, x, 0, w, h);         ctx.drawImage(img, w + x - 1, 0, w, h);         raf = aud.paused ? cancelAnimationFrame(raf) : requestAnimationFrame(move);     };       img.onload = () => move();     aud.onpause = aud.onplaying = () => mState();     aud.onseeking = () => raf = cancelAnimationFrame(raf);     mypic.onclick = () => aud.paused ? aud.play() : aud.pause(); })(); </script>        

评分

5

查看全部评分

点评
回复

使用道具

随遇而安

闲花落

版主勋章 山高为峰 山外有山 巳巳如意 两周年庆 守望千山 少年歌行 一叶知秋 樱果相依
 楼主| 发表于 2024-3-24 20:16 | 显示全部楼层
本帖最后由 花简静 于 2024-3-24 20:24 编辑

<style>
    #papa { margin: 120px 0 0 calc(50% - 931px); width: 1700px; height: 600px; box-shadow: 3px 3px 20px #000; position: relative; overflow: hidden; z-index: 1; }
    #canv { position: absolute;}
     .pic { position: absolute; width: 240px; mix-blend-mode: screen; offset-path: path('M1924,280 Q750,180 -500,70'); transform: rotateX(180deg);offset-distance: 100%; animation: fly 60s var(--delay) infinite var(--state); --delay: 0s;z-index: 2;}
    .pic:nth-of-type(2) { width: 60px;--delay: -20s; }
    .pic:nth-of-type(3) { width: 90px;--delay: -40s; }
    @keyframes fly { to { offset-distance: 0; } }

    #mypic { position: absolute; left: 26%; top: 60px; width: 80px; cursor: pointer; mix-blend-mode: multiply; transform: scale(0.8) rotate(-10deg); animation: scale 10s infinite alternate var(--state); z-index: 10;}
    #lrc { --motion: cover2; --tt: 1s; --bg: repeating-linear-gradient(135deg, orange 1px, yellow 6px); position: absolute;left: 50%; transform: translate(-50%); bottom: 20px; font: bold 2.4em sans-serif; color: hsl(100, 100%, 90%); white-space: pre; -webkit-background-clip: text; filter: drop-shadow(1px 1px 2px hsla(0, 100%, 0%, .85)); pointer-events: none; z-index: 900; }
    #lrc::before { position: absolute; content: attr(data-lrc); width: 0%; height: 100%; color: transparent; border-bottom: 6px dotted orange; overflow: hidden; white-space: pre; background: var(--bg); filter: inherit; background-clip: text; -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards var(--state); }

    @keyframes scale { to { transform: scale(1.2) rotate(360deg); } }
    @keyframes cover1 { from { width: 0%; }  to { width: 100%; } }
    @keyframes cover2 { from { width: 0%; }  to { width: 100%; } }

</style>

<div id="papa">
    <audio id="aud" src="https://music.163.com/song/media/outer/url?id=2051361761" loop autoplay></audio>
    <img class="pic" src="https://pic.imgdb.cn/item/65ffbe039f345e8d036fc70e.png" alt="" />
    <img class="pic" src="https://pic.imgdb.cn/item/65ffbed69f345e8d0375e3ec.png" alt="" />
    <img class="pic" src="https://pic.imgdb.cn/item/65ffbee79f345e8d037664e0.png" alt="" />

    <canvas id="canv"></canvas>
    <img id="mypic" src="https://pic.imgdb.cn/item/65ffc0b29f345e8d0384c33c.png" alt="" title="播放/暂停" />
   <div id="lrc" data-lrc="遨游">遨游</div>
</div>

<script>
var geci = [ [2,"",6] ];
    var sf = document.createElement('script');

(function() {
    let w = canv.width = papa.offsetWidth;
    let h = canv.height = papa.offsetHeight;
    let x = 0, step = 0.5, raf = null;
    let ctx = canv.getContext('2d');
    let img = document.createElement('img');
    img.src = 'https://pic.imgdb.cn/item/65ffbcb79f345e8d036628f7.webp';

    let mState = () => {
        aud.paused ?
            (papa.style.setProperty('--state', 'paused'),mypic.title = '点击播放') :
            (papa.style.setProperty('--state', 'running'), mypic.title = '点击暂停');
        move();
    }

    let move = () => {
        ctx.clearRect(0,0,w,h);
        x -= step;
        if(x <= -w) x = 0;
        ctx.drawImage(img, x, 0, w, h);
        ctx.drawImage(img, w + x - 1, 0, w, h);
        raf = aud.paused ? cancelAnimationFrame(raf) : requestAnimationFrame(move);
    };

    img.onload = () => move();
    aud.onpause = aud.onplaying = () => mState();
    aud.onseeking = () => raf = cancelAnimationFrame(raf);
    mypic.onclick = () => aud.paused ? aud.play() : aud.pause();
})();
</script>

红的代码是一套,管三个气球飞的。
蓝的代码是一套,原来是歌词,这里是下面的标题。
黑色的就背景移动的。。


评分

5

查看全部评分

点评
回复

使用道具

🍀小十一🍀

桃花落

管理勋章 版主勋章 江湖之上 桃花朵朵 山高为峰 山外有山 巳巳如意 两周年庆 守望千山 少年歌行 海洋之心 蝴蝶精灵 山间红叶 花漫千山 中秋月圆 欢度国庆 映像2024 雪花精灵 我书我心 甜心百灵 星河有你 七夕之桥 一生安柠 青恬时光 幸福莓满 心想事橙 桃气满满 梅开颜笑 心若葡提 大吉大荔 樱果相依 喜上莓梢 菜源滚滚 猪事顺利 一生一世 前兔似锦 心心相印 两心如一 一心一意
发表于 2024-3-24 20:17 | 显示全部楼层
我先来占个沙发,哈哈
点评
回复

使用道具

随遇而安

闲花落

版主勋章 山高为峰 山外有山 巳巳如意 两周年庆 守望千山 少年歌行 一叶知秋 樱果相依
 楼主| 发表于 2024-3-24 20:17 | 显示全部楼层
发个横幅移动的贴子,听音乐开心乐一下
点评
回复

使用道具

🍀小十一🍀

桃花落

管理勋章 版主勋章 江湖之上 桃花朵朵 山高为峰 山外有山 巳巳如意 两周年庆 守望千山 少年歌行 海洋之心 蝴蝶精灵 山间红叶 花漫千山 中秋月圆 欢度国庆 映像2024 雪花精灵 我书我心 甜心百灵 星河有你 七夕之桥 一生安柠 青恬时光 幸福莓满 心想事橙 桃气满满 梅开颜笑 心若葡提 大吉大荔 樱果相依 喜上莓梢 菜源滚滚 猪事顺利 一生一世 前兔似锦 心心相印 两心如一 一心一意
发表于 2024-3-24 20:17 | 显示全部楼层
那个是播放器嘛。点一点居然停了,哈哈,好玩的。
点评
回复

使用道具

有求必应。

得道龙虾

管理勋章 版主勋章 江湖之上 桃花朵朵 山高为峰 山外有山 巳巳如意 两周年庆 少年歌行 海洋之心 蝴蝶精灵 花漫千山 音画同行 映像2024 雪花精灵 开卷有益 我书我心 七夕之桥 一生安柠
发表于 2024-3-24 20:19 | 显示全部楼层
哎哟,这个厉害呀。有点恢宏。也点了下,果然好玩。
点评
回复

使用道具

随遇而安

闲花落

版主勋章 山高为峰 山外有山 巳巳如意 两周年庆 守望千山 少年歌行 一叶知秋 樱果相依
 楼主| 发表于 2024-3-24 20:25 | 显示全部楼层
若依 发表于 2024-3-24 20:17
我先来占个沙发,哈哈

若依来啦。。。抱个哈。。
点评
回复

使用道具

🍀小十一🍀

桃花落

管理勋章 版主勋章 江湖之上 桃花朵朵 山高为峰 山外有山 巳巳如意 两周年庆 守望千山 少年歌行 海洋之心 蝴蝶精灵 山间红叶 花漫千山 中秋月圆 欢度国庆 映像2024 雪花精灵 我书我心 甜心百灵 星河有你 七夕之桥 一生安柠 青恬时光 幸福莓满 心想事橙 桃气满满 梅开颜笑 心若葡提 大吉大荔 樱果相依 喜上莓梢 菜源滚滚 猪事顺利 一生一世 前兔似锦 心心相印 两心如一 一心一意
发表于 2024-3-24 20:25 | 显示全部楼层
花简静 发表于 2024-3-24 20:25
若依来啦。。。抱个哈。。

静静我来陪你玩儿啦
点评
回复

使用道具

随遇而安

闲花落

版主勋章 山高为峰 山外有山 巳巳如意 两周年庆 守望千山 少年歌行 一叶知秋 樱果相依
 楼主| 发表于 2024-3-24 20:25 | 显示全部楼层
若依 发表于 2024-3-24 20:17
那个是播放器嘛。点一点居然停了,哈哈,好玩的。

是的。那个飞行器可以控制动态的
点评
回复

使用道具

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

本版积分规则

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

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