宁静 发表于 2023-2-1 14:35

午夜迷迭香

本帖最后由 宁静 于 2023-2-22 13:55 编辑 <br /><br /><style>
#papa { margin: 120px 0 0 calc(50% - 720px); display: grid; place-items: center; width: 1280px; height: 606px; background: gray url('https://wj.zp68.com/lxx/yunhua/2023/02/01/1.gif') no-repeat center/cover; overflow: hidden; user-select: none; box-shadow: 6px 3px 20px #000; position: relative; perspective: 3000px; z-index: 1; }
</style>

<div id="papa"></div>
<audio id="aud" src="https://wj.zp68.com/lxx/yunhua/2023/02/01/wymdx.mp3" loop autoplay></audio>

<script >
(function() {
        (function(mkPlayer) {let defaults = {lrcAr: [,],ttAr: ['分享','论坛','LRC','在线'],lrc_css: 'top: 20px; left: 50%; transform: translateX(-50%);',player_css: 'bottom: 20px; left: calc(50% - 50px);', playerCode: `<style>#mplayer {--bg: linear-gradient(to right bottom,olive,black);position: absolute;width: 100px;height: 100px;display: grid;place-items: center;animation: rot 10s infinite linear;cursor: pointer;color: snow;transform-style: preserve-3d;}.pedal {position: absolute;width: 120px;height: 60px;background: var(--bg);font: bold 1.2em sans-serif;display: grid;place-items: center;opacity: .95;}.pedal:nth-of-type(1) { transform: rotateY(45deg) translateZ(50px); }.pedal:nth-of-type(2) { transform: rotateY(135deg) translateZ(50px); }.pedal:nth-of-type(3) { transform: rotateY(-135deg) translateZ(50px); }.pedal:nth-of-type(4) { transform: rotateY(-45deg) translateZ(50px); }#btnMsg { position: absolute; color: snow; background: #274a64; opacity: 0; border: 2px solid snow; border-radius: 8px; padding: 4px; transition: all .75s; cursor: pointer; z-index: 901; }#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 rot { to { transform: rotateY(-1turn); } }@keyframes cover1 { from { width: 0; }to { width: 100%; } }@keyframes cover2 { from { width: 0; } to { width: 100%; } }</style><div id="lrc" data-lrc="HCPlayer">HCPlayer</div><div id="mplayer"><span class="pedal"></span><span class="pedal"></span><span class="pedal"></span><span class="pedal"></span></div><span id="btnMsg">全屏观赏</span>`,};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, fs = false, tnow = Date.now(), timerId;;data.ttAr.forEach( (item,key) => {let spans = mplayer.children;spans.innerText =item;});mplayer.onclick = () => aud.paused ? aud.play() : aud.pause();btnMsg.onclick = () => fs ? document.exitFullscreen() : papa.requestFullscreen();papa.onmousemove = (e) => {clearTimeout(timerId);btnMsg.style.opacity = '.95';timerId = setTimeout('btnMsg.style.opacity = "0"', 3000);};document.addEventListener("fullscreenchange", () => {if (document.fullscreenElement !== null) {fs = true;btnMsg.innerText = '退出全屏';} else {fs = false;btnMsg.innerText = '全屏观赏';}});aud.addEventListener('pause', () => mState());aud.addEventListener('play', () => mState());aud.addEventListener('seeked', () => calcKey());let mState = () => aud.paused ? (lrc.style.setProperty('--state','paused'), mplayer.style.animationPlayState='paused') : (lrc.style.setProperty('--state','running'), mplayer.style.animationPlayState='running');aud.addEventListener('timeupdate', () => {for (j = 0; j < data.lrcAr.length; j++) {if (aud.currentTime >= data.lrcAr) {if (mKey === j) showLrc(data.lrcAr);else continue;}}});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);};};mkPlayer.HCPlayer = playCode;})(this);
        let lrcAr = [
                ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
        ,
       
];

        HCPlayer({
                lrcAr: lrcAr,
                lrc_css: '--bg: linear-gradient(hsla(180,80%,60%,.7),hsla(220,70%,40%,.5)); top: 150px;',
                ttAr: ['停止','播放','停止','播放'],
                player_css: '--bg: repeating-linear-gradient(90deg, transparent, black 8px, silver 16px);bottom: 120px; left: 47%; color: Azure;',
        });
})();
</script>
<br><br><br>

宁静 发表于 2023-2-1 14:38

可以全屏欣赏,电脑效果比较好,鼠标滑过界面【全屏观赏】字样出来

宁静 发表于 2023-2-1 14:39

手机可以点击播放器音乐出来,但看不全整个图图效果,手机屏幕太小了

沉默 发表于 2023-2-1 14:40

第一个冲进来{:9001:}

宁静 发表于 2023-2-1 14:42

沉默 发表于 2023-2-1 14:40
第一个冲进来

速度的,进来摇一摇的?

沉默 发表于 2023-2-1 14:43

宁静 发表于 2023-2-1 14:42
速度的,进来摇一摇的?

就5分钟,完了就下

宁静 发表于 2023-2-1 14:46

本帖最后由 宁静 于 2023-2-1 14:53 编辑



{:9022:}

宁静 发表于 2023-2-1 14:47

沉默 发表于 2023-2-1 14:40
第一个冲进来

你今天速度快

沉默 发表于 2023-2-1 14:49

宁静 发表于 2023-2-1 14:47
你今天速度快

今天捡了个大红包,有点多的,平时要一个月的工资

宁静 发表于 2023-2-1 14:50

沉默 发表于 2023-2-1 14:49
今天捡了个大红包,有点多的,平时要一个月的工资

老板发的啊,那你赶快去做事。。。。
页: [1] 2
查看完整版本: 午夜迷迭香