红影 发表于 2022-10-9 12:08

落霜(学习黑黑竖向歌词)

<style>
#papa { left: -302px; width: 1200px; height: 660px; background: darkred url('https://pic1.imgdb.cn/item/63412eef16f2c2beb17c3797.jpg') no-repeat center/cover; display: grid; place-items: center; box-shadow: 3px 3px 20px #000; user-select: none; position: relative; z-index: 1; overflow: hidden;}
#mplayer { position: absolute; right: 55px; bottom: 65px; width: 120px; height: 120px; border-radius: 50%; overflow: hidden; z-index: 3; }
#track { stroke: url(#gradient); }
#tmsg { fill: hsl(240,100%,60%); font: normal 1em sans-serif; }
#btnwrap { display: block; fill: hsla(0,23%,60%,.7); cursor: pointer; }
#btnwrap:hover { fill: hsla(0,60%,60%,.8); }
#lrc { --motion: cover1; --tt: 5s; --state: running; position: absolute; left: 158px; top: 240px; font: bold 2.0em sans-serif; color: hsl(59,29%,75%); -webkit-background-clip: text; filter: drop-shadow(1px 1px 2px hsla(20,100%,0%,.95)); writing-mode: vertical-rl; }
#lrc::before { position: absolute; content: attr(data-lrc); width: 20%; height: 100%; color: transparent; overflow: hidden; white-space: nowrap; background: linear-gradient(180deg,hsla(0,60%,100%,.85),hsla(26,100%,35%,.85)); filter: inherit; -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards; animation-play-state: var(--state); writing-mode: vertical-rl; }
.mpic { position: absolute; right: 420px; top: 202px;transform-origin: bottom; animation: swing 1.2s infinite alternate; }
.tupian { position: absolute; right: 10px; bottom: 20px; width: 210px; height: 213px; animation: zhuan 12s linear infinite; opacity: .55; }
#wenzi { position: absolute; left: 80px; top: -15px; width: 200px; height: 200px;}
.text{ font-size: 64px; font-weight: bold; fill: none; stroke-width: 2px; stroke-dasharray: 90 310; animation: stroke 6s infinite linear; }
.text-1{ stroke: hsl(16,20%,50%); text-shadow: 0 0 5px hsl(16,20%,50%); animation-delay: -1.5s; }
.text-2{ stroke: hsl(16,30%,50%); text-shadow: 0 0 5px hsl(16,30%,50%); animation-delay: -3s; }
.text-3{ stroke: hsl(16,35%,50%); text-shadow: 0 0 5px hsl(16,35%,50%); animation-delay: -4.5s; }
.text-4{ stroke: hsl(16,60%,50%); text-shadow: 0 0 5px hsl(16,60%,50%); animation-delay: -6s; }
@keyframes cover1 { from { width: 100%; height: 0; } to { width: 100%; height: 100%; } }
@keyframes cover2 { from { width: 100%; height: 0; } to { width: 100%; height: 100%; } }
@keyframes swing { from { transform: rotate(4deg); } to { transform: rotate(-6deg); } }
@keyframes zhuan { 100% { transform: rotate(360deg); } }
@keyframes stroke { to { stroke-dashoffset: -400; } }
#bird { position: absolute; width: 650px; height: 180px; background: transparent url('https://pic1.imgdb.cn/item/624f9886239250f7c55c810d.gif') no-repeat; }
#bird::after { content:""; background-image: inherit; width: 100%; height:100%; position: absolute; bottom:-60%; filter: blur(2px); transform:scaleY(-1); }
</style>

<div id="papa">
                <img src="https://pic1.imgdb.cn/item/6341353d16f2c2beb186644b.png" alt="" class="mpic" />
                <img src="https://pic1.imgdb.cn/item/6342307c16f2c2beb1f2813d.png" alt="" class="tupian" />
                <div id="bird"></div>
        <div id="lrc" data-lrc="花潮论坛lrc在线">花潮论坛lrc在线</div>
        <svg id="mplayer" width="120" height="120" shape-rendering="geometricPrecision">
                <g id="mama" transform="rotate(-90, 60, 60)" style="cursor: pointer;">
                        <circle id="track" cx="60" cy="60" r="50" fill="none" stroke-width="12"/>
                        <circle id="prog" cx="60" cy="60" r="50" fill="none" stroke-width="3" stroke="hsla(0,0%,90%,0.55)" />
                </g>
                <path id="curPath" d="M 20 70 Q 60 0 100 70" fill="none" stroke="none"/>
                <path id="durPath" d="M 20 55 Q 60 110 100 55" fill="none" stroke="none"/>
                <g id="tmsg">
                        <text x="32" y="0"><textPath id="curMsg" xlink:href="#curPath" dominant-baseline="text-after-edge">00:00</textPath></text>
                        <text x="27" y="0"><textPath id="durMsg" xlink:href="#durPath" dominant-baseline="text-before-edge">00:00</textPath></text>
                </g>
                <g id="btnwrap">
                        <path id="btnplay" d="M 50 50,50 70,70 60 z"></path>
                        <path id="btnmid" d="M 55 50, 55 70, 60 70, 60 50, 55 50 z" fill="transparent"></path>
                        <path id="btnpause" d="M 52 50,52 70,57 70,57 50,52 50 z M 60 50,60 70,65 70,65 50,60 50 z"></path>
                </g>
                <defs>
                        <linearGradient id="gradient" x1="0" y1="0" x2="1" y2="1">
                                <stop offset="0%" stop-color="orange" stop-opacity="0.8" />
                                <stop offset="35%" stop-color="green" stop-opacity="0.8" />
                                <stop offset="65%" stop-color="teal" stop-opacity="0.8" />
                                <stop offset="100%" stop-color="darkblue" stop-opacity="0.8" />
                        </linearGradient>
                </defs>
        </svg>
<div id="wenzi">
<svg width="100%" height="100%" >
                <text text-anchor="middle" x="50%" y="50%" class="text text-1">落霜</text>
                <text text-anchor="middle" x="50%" y="50%" class="text text-2">落霜</text>
                <text text-anchor="middle" x="50%" y="50%" class="text text-3">落霜</text>
                <text text-anchor="middle" x="50%" y="50%" class="text text-4">落霜</text>
      </svg>
</div></div>

<script>
let mKey = 0, mFlag = true, aud = new Audio(), cc = { x: 1*track.getAttribute('cx'), y: 1*track.getAttribute('cy'), len: track.getTotalLength(), };
let lrcAr = [
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
       
];
aud.src = 'https://music.163.com/song/media/outer/url?id=1358035181.mp3';
aud.autoplay = true;
aud.loop = true;
prog.style.strokeDasharray = prog.style.strokeDashoffset = cc.len;
btnwrap.onclick = () => aud.paused ? aud.play() : aud.pause();
aud.addEventListener('seeked', () => calcKey());
mama.onclick = (e) => {let deg = Math.atan2(e.offsetY - cc.y, e.offsetX - cc.x) * 180 / Math.PI;deg += (e.offsetX < cc.x && e.offsetY < cc.y) ? 450 : 90;aud.currentTime = aud.duration * deg / 360;};
aud.addEventListener('pause', () => mState());
aud.addEventListener('play',() => mState());
aud.addEventListener('timeupdate', () => {prog.style.strokeDashoffset = cc.len - cc.len * aud.currentTime / aud.duration + 'px';curMsg.textContent = toMin(aud.currentTime);durMsg.textContent = toMin(aud.duration);for(j=0; j<lrcAr.length; j++) {if(aud.currentTime >= lrcAr) {if(mKey === j) showLrc(lrcAr);else continue;}}});
let mState = () => aud.paused ? (btnplay.style.display = 'block', btnpause.style.display = 'none', lrc.style.setProperty('--state', 'paused')) : (btnplay.style.display = 'none', btnpause.style.display = 'block', lrc.style.setProperty('--state', 'running'));
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 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 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;}
mState();
</script>

红影 发表于 2022-10-9 12:14

把那个摇摆放在彼岸花上了,发完帖子就要离开了,下午要外出{:4_193:}

加林森 发表于 2022-10-9 12:36

制作得挺漂亮的。{:4_199:}

梦油 发表于 2022-10-9 12:48

金秋是我景色太美了,特别是那水中的倒影很漂亮。

马黑黑 发表于 2022-10-9 12:49

播放器的装饰很特别,显得好雍容华贵的样纸{:4_170:}

马黑黑 发表于 2022-10-9 12:49

花粥的歌也算是很特别

相约爱晚亭 发表于 2022-10-9 13:29

特效文字、动画加到图片上,制作很棒!制图与HTML5代码的结合,让音画有了新的活力!

小辣椒 发表于 2022-10-9 14:02

亲爱的,特棒,把黑黑的倒影效果加进去来了,还加了好几个特效{:4_178:}

千羽 发表于 2022-10-9 18:12

几个效果的叠加,画面看起来生动且趣味十足,影儿棒棒哒,手儿好巧{:4_187:}啊

千羽 发表于 2022-10-9 18:15

很想走进美景中……{:4_205:}

马黑黑 发表于 2022-10-9 19:16

千羽 发表于 2022-10-9 18:15
很想走进美景中……

这个需要家长陪同

梦缘 发表于 2022-10-9 19:23

精彩的特效,欣赏问好!

千羽 发表于 2022-10-9 19:39

马黑黑 发表于 2022-10-9 19:16
这个需要家长陪同

每次黑黑老师出去玩都要家长陪同,俺就不需要了{:4_181:}

马黑黑 发表于 2022-10-9 19:48

千羽 发表于 2022-10-9 19:39
每次黑黑老师出去玩都要家长陪同,俺就不需要了

你什么时候自立的?

红影 发表于 2022-10-9 20:41

加林森 发表于 2022-10-9 12:36
制作得挺漂亮的。

谢谢队长,把黑黑的很多效果弄进帖子了{:4_173:}

红影 发表于 2022-10-9 20:43

梦油 发表于 2022-10-9 12:48
金秋是我景色太美了,特别是那水中的倒影很漂亮。

那个倒影是学的黑黑的代码弄的,原本是没倒影的{:4_173:}

红影 发表于 2022-10-9 20:44

马黑黑 发表于 2022-10-9 12:49
播放器的装饰很特别,显得好雍容华贵的样纸

跟着黑黑学,也在播放器的环上加东西{:4_173:}

马黑黑 发表于 2022-10-9 20:46

红影 发表于 2022-10-9 20:44
跟着黑黑学,也在播放器的环上加东西

很不错的

红影 发表于 2022-10-9 20:47

马黑黑 发表于 2022-10-9 12:49
花粥的歌也算是很特别

是搜别的歌,遇到这首的{:4_173:}

马黑黑 发表于 2022-10-9 20:48

红影 发表于 2022-10-9 20:47
是搜别的歌,遇到这首的

玩网易的人,像樵歌,按理应该知道花粥
页: [1] 2 3 4 5 6
查看完整版本: 落霜(学习黑黑竖向歌词)