红影 发表于 2022-12-24 14:43

魔法城堡 TO 驻在平安夜前夕 恭喜4周岁

<style>
#papa { margin: 100px 0 0 calc(50% - 621px); display: grid; place-items: center; width: 1080px; height: 620px; background: gray url('https://pic.imgdb.cn/item/63a67a4e08b6830163db1543.jpg') no-repeat center/cover; box-shadow: 3px 3px 20px #000; user-select: none; perspective: 4000px; position: relative; z-index: 1; }
#pic { position: absolute; right: 60px; top: 180px; width: 428px; height: 120px; opacity: .28; transform:rotate(-20deg) scale(.7);}
#pic1 { position: absolute; left: 60px; top: 80px; width: 563px; height: 293px; }
#pic2 { position: absolute; left: 300px; bottom: 160px; width: 126px; height: 98px; }
</style>

<div id="papa">
<img id="pic" src="https://pic.imgdb.cn/item/633ef9da16f2c2beb18a4a00.gif" alt="" />
<img id="pic1" src="https://pic.imgdb.cn/item/62eb37d816f2c2beb1204db9.gif" alt="" />
<img id="pic2" src="https://pic.imgdb.cn/item/63a6784708b6830163d7da6c.gif" alt="" />
</div><br><br><br><br><br>
<audio id="aud" src="https://aimg8.dlssyht.cn/u/0/ueditor/file/0/0/1671862741474570.mp3" loop autoplay crossorigin="anonymous"></audio>

<script >
(function() {
        (function(mkPlayer) {let defaults = {lrcAr: [],lrc_css: 'top: 15px; left: 50%; transform: translate(-50%)',player_css: 'bottom: 5px; left: 50%; transform: translate(-50%)',playerCode: `<style>#mplayer { --ww: 300; --bg: linear-gradient(to top,lightgreen,green,lightgreen); --state: paused; position: absolute; width: var(--ww); height: 200px; transform-style: preserve-3d; animation: rot3d 120s infinite linear; animation-play-state: var(--state); cursor: pointer; }.mline { position: absolute; width: 8px; height: 10px; bottom: 0; left: calc(50% - 4px); border-radius: 10px; opacity: .95; }.mline::before { position: absolute; content: ''; width: 100%; height: 8px; background: var(--psecolor); border-radius: 50%; transform: scale(1.5); transition: all var(--ts); animation: up 1s infinite; animation-play-state: var(--state); }@keyframes rot3d { to { transform: rotateY(1turn); } }@keyframes up { to { top: -20px; } }#lrc { --motion: cover2; --tt: 1s; --state: running; --bg: linear-gradient(180deg,hsla(100,10%,50%,.75),hsla(100,100%,20%,.65)); position: absolute; 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)); z-index: 900; }#lrc::before { position: absolute; content: attr(data-lrc); width: 20%; height: 100%; color: transparent; overflow: hidden; white-space: pre; background: var(--bg); filter: inherit; -webkit-background-clip: text; animation: var(--motion) var(--tt) linear forwards; animation-play-state: var(--state); }@keyframes cover1 { from { width: 0; } to { width: 100%; } }@keyframes cover2 { from { width: 0; } to { width: 100%; } }@keyframes rot3d { to { transform: rotateY(1turn); } }@keyframes up { to { top: -20px; } }</style><div id="lrc" data-lrc="HCPlayer">HCPlayer</div><div id="mplayer" title="播放/暂停"></div>`,};let playCode = (user_config) => {let data = Object.assign({}, defaults, user_config);papa.innerHTML += data.playerCode;mplayer.style.cssText += data.player_css;lrc.style.cssText += data.lrc_css;let mKey = 0, mFlag = true, btfFlag = false;let total = Math.floor(mplayer.offsetWidth / 4), mRad = Math.floor(mplayer.offsetWidth / 2);for(j=0; j< total; j++) {let ele = document.createElement('span');ele.className = 'mline';ele.style.cssText += `background: linear-gradient(to bottom, #${Math.random().toString(16).substr(-6)}, #${Math.random().toString(16).substr(-6)});height: ${Math.floor(Math.random() * 80) + 20}px;transform: rotateY(${j*360/total}deg) translateZ(${mRad}px);--psecolor: linear-gradient(135deg, #${Math.random().toString(16).substr(-6)}, #${Math.random().toString(16).substr(-6)});--ts: ${Math.random()}s;`;mplayer.appendChild(ele);}let Ac = new AudioContext;let source = Ac.createMediaElementSource(aud);let analyser = Ac.createAnalyser();source.connect(analyser);analyser.connect(Ac.destination);let output = new Uint8Array(total);let ypAr = [];let lines = document.querySelectorAll('.mline');(function update() {analyser.getByteFrequencyData(output);let mid = total % 2 === 0 ? total / 2 - 1 : Math.floor(total / 2);lines.forEach( (item,key) => {item.style.height = output/2 + 'px';});window.requestAnimationFrame(update);})();aud.addEventListener('timeupdate', () => {for (j = 0; j < data.lrcAr.length; j++) {if (aud.currentTime >= data.lrcAr) {if (mKey === j) showLrc(data.lrcAr);else continue;}}});aud.addEventListener('pause', () => mState());aud.addEventListener('play', () => mState());aud.addEventListener('seeked', () => calcKey());let mState = () => aud.paused ? (lrc.style.setProperty('--state', 'paused'),mplayer.style.setProperty('--state', 'paused')) : (lrc.style.setProperty('--state', 'paused'), mplayer.style.setProperty('--state', 'running'));let showLrc = (time) => {let name = mFlag ? 'cover1' : 'cover2';lrc.innerHTML = data.lrcAr;lrc.dataset.lrc = data.lrcAr.replace(/<br>/, '\n');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 < data.lrcAr.length; j++) {if (aud.currentTime <= data.lrcAr) {mKey = j - 1;break;}}if (mKey < 0) mKey = 0;if (mKey > data.lrcAr.length - 1) mKey = data.lrcAr.length - 1;let time = data.lrcAr - (aud.currentTime - data.lrcAr);showLrc(time);};mplayer.onclick = () => aud.paused ? aud.play() : aud.pause();};mkPlayer.HCPlayer = playCode;})(this);
        let lrcAr = [
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
       
];
        HCPlayer({
                lrcAr: lrcAr,
                player_css: '--ww: 360px; bottom: 25px; left:300px;',
                lrc_css: '--bg: linear-gradient(180deg,hsla(0,100%,50%,.35),hsla(60,100%,50%,.65)); color: lightblue; top: 10px; left:60px;',
        });
})();
</script>

红影 发表于 2022-12-24 14:46

恭喜夕夕4周岁了,来到花潮童话城堡已经4周年了。让我们一起在这个梦幻城堡中继续开心@驻在平安夜前夕{:4_187:}

梦油 发表于 2022-12-24 15:15

借影子朋友的美帖,祝福四岁的平安夜朋友一生平安,永远快乐!
影子朋友辛苦了!

红影 发表于 2022-12-24 15:51

梦油 发表于 2022-12-24 15:15
借影子朋友的美帖,祝福四岁的平安夜朋友一生平安,永远快乐!
影子朋友辛苦了!

看到城堡上的花潮横幅么,我特地加的{:4_173:}

梦油 发表于 2022-12-24 16:34

红影 发表于 2022-12-24 15:51
看到城堡上的花潮横幅么,我特地加的

那随风飘动的横幅真漂亮,你真有两下子。{:4_199:}

驻在平安夜前夕 发表于 2022-12-24 16:37

谢谢
太隆重了

马黑黑 发表于 2022-12-24 16:58

四岁了,大元老了。恭喜恭喜{:4_187:}

樵歌 发表于 2022-12-24 20:08

恭喜夕夕永远驻在平安夜,开心快乐{:4_187:}

樵歌 发表于 2022-12-24 20:09

师妹做得真好。{:4_199:}

红影 发表于 2022-12-24 20:35

梦油 发表于 2022-12-24 16:34
那随风飘动的横幅真漂亮,你真有两下子。

夕夕入驻花潮4周年,必须有花潮的标志{:4_173:}

红影 发表于 2022-12-24 20:35

驻在平安夜前夕 发表于 2022-12-24 16:37
谢谢
太隆重了

不客气,恭喜夕夕4岁了{:4_187:}

红影 发表于 2022-12-24 20:36

马黑黑 发表于 2022-12-24 16:58
四岁了,大元老了。恭喜恭喜

谢谢黑黑的代码,跟黑黑一起恭喜{:4_204:}

红影 发表于 2022-12-24 20:36

樵歌 发表于 2022-12-24 20:09
师妹做得真好。

谢谢师兄,跟师兄一起恭喜{:4_204:}

马黑黑 发表于 2022-12-24 20:38

红影 发表于 2022-12-24 20:36
谢谢黑黑的代码,跟黑黑一起恭喜

代码得有人用

梦油 发表于 2022-12-24 20:58

红影 发表于 2022-12-24 20:35
夕夕入驻花潮4周年,必须有花潮的标志

制作起来一定挺费劲吧。

驻在平安夜前夕 发表于 2022-12-24 21:07

红影 发表于 2022-12-24 20:35
不客气,恭喜夕夕4岁了

算中人了吧{:5_106:}

红影 发表于 2022-12-24 21:13

马黑黑 发表于 2022-12-24 20:38
代码得有人用

我做帖子慢,还有好多的效果没做过呢{:4_173:}

红影 发表于 2022-12-24 21:14

梦油 发表于 2022-12-24 20:58
制作起来一定挺费劲吧。

还行,代码是黑黑的,我只是换点图片和音乐{:4_173:}

红影 发表于 2022-12-24 21:14

驻在平安夜前夕 发表于 2022-12-24 21:07
算中人了吧

已经算老人了呢{:4_187:}

驻在平安夜前夕 发表于 2022-12-24 21:41

红影 发表于 2022-12-24 21:14
已经算老人了呢

自豪了
页: [1] 2 3
查看完整版本: 魔法城堡 TO 驻在平安夜前夕 恭喜4周岁