醉美水芙蓉 发表于 2022-10-23 20:59

泛水荷塘

<style>
#papa { left:-214px; width: 1024px; height: 640px; background: url('https://s1.ax1x.com/2022/10/23/x2SpGD.jpg') no-repeat center/cover; box-shadow: 3px 3px 20px #000; position: relative; display: grid; place-items: center; user-select: none; z-index: 1; --opt: .25;}
#papa::before { position: absolute; content: ''; width: 100%; height: 100%; background: url('https://638183.freep.cn/638183/t22/webp/124.gif') repeat; opacity: var(--opt); }
#mplayer { position: absolute; bottom: 0; z-index: 9; }
#lrc { --motion: cover1; --tt: 5s; --state: paused; position: absolute; top: 30px; font: bold 2.4em sans-serif; color: hsl(0,10%,90%); -webkit-background-clip: text; filter: drop-shadow(1px 1px 2px hsla(0,0%,0%,.95)); }
#lrc::before { position: absolute; content: attr(data-lrc); width: 20%; height: 100%; color: transparent; overflow: hidden; white-space: nowrap; background: linear-gradient(180deg,hsla(280,100%,50%,.75),hsla(180,100%,50%,.75)); filter: inherit; -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards; animation-play-state: var(--state); }
#fish { offset-path: path('M210 195a93.5 62 0 1 0 187 0a93.5 62 0 1 0 -187 0z'); offset-distance: 100%; animation: swim 50s infinite; }
#fish1 { position: absolute; left: 855px; top: 355px; width: 70px;offset-distance: 0;offset-path: path('M-610 95a93.5 62 0 1 0 187 0a93.5 62 0 1 0 -187 0z'); offset-distance: 100%; animation: swim 25s infinite; }
@keyframes cover1 { from { width: 0; } to { width: 100%; } }
@keyframes cover2 { from { width: 0; } to { width: 100%; } }
@keyframes rot { to { transform: rotate(1turn); } }
@keyframes swim { to { offset-distance: 0%; } }
</style>
<div id="papa">
      <img id="fish" src="https://wj1.zp68.com:812/lxx/yunhua/2022/10/02/gnyu.jpg" alt="" />       
<img id="fish1" src="https://wj1.zp68.com:812/lxx/yunhua/2022/10/02/gnyu.jpg" alt="" />
<div id="lrc" data-lrc="花潮lrc在线">花潮lrc在线</div>
        <svg id="mplayer" width="360" height="60" style="user-select: none;">
                <rect x="50" y="25" rx="6" ry="6" width="200" height="12" stroke="hsla(280,90%,55%,.45)" fill="hsla(60,100%,92%,.35)" id="track" />
                <rect x="50" y="25" rx="6" ry="6" width="0" height="12" stroke="transparnet" fill="hsla(280,90%,55%,.45)" id="prog" />
                <text x="260" y="31" font-size="14" dominant-baseline="middle" stroke="none" fill="tan" id="audtime">00:00 | 00:00</text>
                <text x="10" y="35" font-size="40" dominant-baseline="middle" stroke="tan" fill="purple" id="btnplay" style="cursor: pointer;">☀
                        <animateTransform attributeName="transform" dur="4s" type="rotate" from="0 26.86 30" to="360 26.86 30" repeatCount="indefinite" />
                </text>
        </svg>
</div>

<script>
(function() {
        let mp = { len: track.getAttribute('width')*1, x: track.getAttribute('x')*1 }, aud = new Audio(), mKey = 0, mFlag = true;
                let lrcAr = [
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
       
];
        aud.src = 'https://www.qqmc.com/up/kwlink.php?id=141519521&.mp3';
        aud.loop = true;
        aud.autoplay = true;
        if(aud.paused) mplayer.pauseAnimations();
        btnplay.onclick = () => aud.paused ? aud.play() : aud.pause();
        prog.onclick = track.onclick = (e) => aud.currentTime = aud.duration * (e.offsetX - mp.x) / mp.len;
        aud.addEventListener('seeked', () => calcKey());
        aud.addEventListener('pause', () =>mState());
        aud.addEventListener('play', () =>mState());
        aud.addEventListener('timeupdate', () => {prog.style.setProperty('width', aud.currentTime * 200 / aud.duration + 'px');audtime.textContent = toMin(aud.currentTime) + ' | ' + toMin(aud.duration);for(j=0; j<lrcAr.length; j++) {if(aud.currentTime >= lrcAr) {cKey = j;if(mKey === j) showLrc(lrcAr);else continue;}}});
        let calcKey = () => {for(j = 0; j < lrcAr.length; j ++) {if(aud.currentTime <= lrcAr) {mKey = j - 1;break;}}if(mKey <0) mKey = 0;if(mKey > lrcAr.length - 1) mKey = lrcAr.length - 1;let time = lrcAr - (aud.currentTime - lrcAr);showLrc(time);};
        let showLrc = (time) => {let name = mFlag ? 'cover1' : 'cover2';lrc.innerHTML = lrc.dataset.lrc = lrcAr;lrc.style.setProperty('--motion', name);lrc.style.setProperty('--tt', time + 's');lrc.style.setProperty('--state', 'running');mKey += 1;mFlag = !mFlag;};
        let mState = () => aud.paused ? (mplayer.pauseAnimations(),lrc.style.setProperty('--state', 'paused'),papa.style.setProperty('--opt','0')) : (mplayer.unpauseAnimations(), lrc.style.setProperty('--state', 'running'),papa.style.setProperty('--opt','.25'));
        let toMin = (val)=> {if (!val) return '00:00';val = Math.floor(val);let min = parseInt(val / 60), sec = parseFloat(val % 60);if(min < 10) min = '0' + min;if(sec < 10) sec = '0' + sec;return min + ':' + sec;}
})();
</script>

起个网名好难 发表于 2022-10-24 11:46

本帖最后由 起个网名好难 于 2022-10-24 11:48 编辑 <br /><br />也来玩一下
<style>
#outblk { width: 1024px; height: 640px; background: url('https://s1.ax1x.com/2022/10/23/x2SpGD.jpg') no-repeat center/cover; box-shadow: 3px 3px 20px #000; position: relative; margin:100px 16px 32px -200px}
.fish        {offset-distance: 100%; animation: swim 45s infinite; }
.fish:nth-child(1){offset-path: path('M110 495 a 93.5 62 0 1 0 187 0 a 93.5 62 0 1 0 -187 0z');}
.fish:nth-child(2){offset-path: path('M700 505 a 93.5 62 0 1 0 187 0 a 93.5 62 0 1 0 -187 0z'); animation-delay: 30s;}
.fish:nth-child(3){offset-path: path('M330 500 a 93.5 62 0 1 0 187 0 a 93.5 62 0 1 0 -187 0z'); animation-delay: 15s;}

@keyframes swim { to { offset-distance: 0%; } }
</style>
<div id="outblk">
<img class="fish" src="https://wj1.zp68.com:812/lxx/yunhua/2022/10/02/gnyu.jpg" alt="" />       
<img class="fish" src="https://wj1.zp68.com:812/lxx/yunhua/2022/10/02/gnyu.jpg" alt="" />
<img class="fish" src="https://wj1.zp68.com:812/lxx/yunhua/2022/10/02/gnyu.jpg" alt="" />
</div>

起个网名好难 发表于 2022-10-23 21:19


<svg width="100%" height="100%" viewBox="0 0 1000 600"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
   <path id="MyPath"
         d="
      M 200 200
      m -100, 150
      a 300,200 0 1,0 600,0
      a 300,200 0 1,0 -600,0
"/>
</defs>

<use xlink:href="#MyPath" fill="none" stroke="transparent"/>

<text font-family="Verdana" font-size="50" stroke="red" fill="yellow">
    <textPath xlink:href="#MyPath">
      欣赏、点赞!
             <animate attributeName="startOffset" from="0" to ="1656" begin="0s" dur="10s" repeatCount="indefinite" />

    </textPath>
</text>
</svg>

闲言不语 发表于 2022-10-23 21:26

精彩的画面,动人的歌声!{:4_199:}

小辣椒 发表于 2022-10-23 21:30

今天的小鱼儿统统不见了{:4_189:}

小辣椒 发表于 2022-10-23 21:30

欣赏水芙蓉的精彩制作

马黑黑 发表于 2022-10-23 21:47

小辣椒 发表于 2022-10-23 21:30
今天的小鱼儿统统不见了

现在出来了

马黑黑 发表于 2022-10-23 21:47

做的精美。棒棒哒

醉美水芙蓉 发表于 2022-10-23 21:49

起个网名好难 发表于 2022-10-23 21:19
欣赏、点赞!

谢谢老师欣赏支持!

醉美水芙蓉 发表于 2022-10-23 21:49

闲言不语 发表于 2022-10-23 21:26
精彩的画面,动人的歌声!

谢谢不语老师欣赏支持!

醉美水芙蓉 发表于 2022-10-23 21:50

小辣椒 发表于 2022-10-23 21:30
欣赏水芙蓉的精彩制作

谢谢小辣椒美女支持!

醉美水芙蓉 发表于 2022-10-23 21:52

马黑黑 发表于 2022-10-23 21:47
做的精美。棒棒哒

有点云里雾里的,对这个播放器还是有点懵!好多地方不会修改!

马黑黑 发表于 2022-10-23 21:58

醉美水芙蓉 发表于 2022-10-23 21:52
有点云里雾里的,对这个播放器还是有点懵!好多地方不会修改!

你用的是svg播放器。

进度条:id="track" 是底轨,id="prog" 是进度,颜色方面,fill 是填充色,stroke是描边色,我用了 hsla 颜色体系,表示为 hlsa(...),你可以删掉,换上 #ffcc00 或者 black 之类的。

文本按钮,text 标签,id="btnplay"就是,也是改 fill="颜色" 这个地方。

千羽 发表于 2022-10-23 22:19

水芙蓉的同步做得漂亮,背景也选的好{:4_187:}

朵拉 发表于 2022-10-23 22:23

好听 好看,欣赏{:4_204:}

走过岁月 发表于 2022-10-23 22:42

这图漂亮我也存有,还没想到音乐来做

红影 发表于 2022-10-23 23:56

很漂亮。欣赏水芙蓉美女精彩制作{:4_187:}

醉美水芙蓉 发表于 2022-10-24 06:31

千羽 发表于 2022-10-23 22:19
水芙蓉的同步做得漂亮,背景也选的好

谢谢千羽光临!

醉美水芙蓉 发表于 2022-10-24 06:32

朵拉 发表于 2022-10-23 22:23
好听 好看,欣赏

谢谢朵拉美女光临!

醉美水芙蓉 发表于 2022-10-24 06:33

走过岁月 发表于 2022-10-23 22:42
这图漂亮我也存有,还没想到音乐来做

谢谢岁月老师光临!

醉美水芙蓉 发表于 2022-10-24 06:33

红影 发表于 2022-10-23 23:56
很漂亮。欣赏水芙蓉美女精彩制作

谢谢红影美女光临支持!
页: [1] 2
查看完整版本: 泛水荷塘