非常开心 发表于 2023-3-8 21:34

美丽的岛屿

本帖最后由 非常开心 于 2023-10-4 20:06 编辑



非常开心 发表于 2023-3-8 21:35

本帖最后由 非常开心 于 2023-10-4 22:09 编辑 <br /><br /><br>
<div class="t_fsz">
<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_1843995">
<style>
#papa {
        margin: 20px 0 0 calc(50% - 593px);
        display: grid;
        place-items: center;
        width: 1200px;
        height: 774px;
        background: gray url('https://img2.baidu.com/it/u=2992277452,2852960824&fm=253&fmt=auto&app=138&f=JPEG?w=750&h=500') no-repeat center/cover;
        box-shadow: 8px 4px 20px hsla(0,0%,0%,.65);
        user-select: none;
        position: relative;
        z-index: 1;
        animation: flash 10s infinite alternate;
}
@keyframes flash { from {filter: brightness(70%); } to {filter: brightness(140%); } }
</style>

<div id="papa"></div>
<audio id="aud" src="https://music.163.com/song/media/outer/url?id=1893307263.mp3" loop autoplay></audio>

<script >
(function() {
        (function(mkPlayer) {let defaults = {lrcAr: [],lrc_css: 'top: 10px; left: 50%; transform: translateX(-50%);',player_css: 'bottom: 20px; left: 50%; transform: translateX(-50%);',btn_txt: '\u2638',playerCode: `<style>#mplayer {position: absolute;grid-template-columns: auto auto auto;gap: 8px;display: grid;place-items: center;color: var(--color);font: normal 16px sans-serif;z-index: 999;--ww: 260px;--color: hsl(0, 100%, 100%);--btn_size: 35px;--track: hsla(90,100%,95%,.65);--prog: linear-gradient(90deg,hsla(90,30%,50%,.55),hsla(0,70%,50%,.65),hsla(90,30%,50%,.75));}#btnplay {--state: paused;margin-right: -4px;font: bold var(--btn_size) / var(--btn_size) serif;text-align: center;cursor: pointer;animation: rot 4s infinite linear;animation-play-state: var(--state);}#prog {--xx: 0px;width: var(--ww);height: 10px;border-radius: 8px;background: var(--track);position: relative;cursor: pointer;}#prog::before {position: absolute;content: '';width: var(--xx);height: 100%;border-radius: 8px;background: var(--prog);}#lrc {--motion: cover2;--tt: 2s;--state: paused;--bg: linear-gradient(180deg, hsla(60, 50%, 50%, .45), hsla(80, 70%, 50%, .6), hsla(0, 100%, 50%, .75));position: absolute;font: bold 2.4em sans-serif;color: hsl(0, 10%, 90%);white-space: pre;-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: 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 rot { to { transform: rotate(1turn); } }</style><div id="lrc" data-lrc="HCPlayer">HCPlayer</div><div id="mplayer"><span id="btnplay"></span><span id="prog"></span><span id="tmsg">00:00 | 00:00</span></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;btnplay.innerHTML = data.btn_txt;let mKey = 0, mFlag = true;btnplay.onclick = () => aud.paused ? aud.play() : aud.pause();prog.onclick = (e) => aud.currentTime = aud.duration * e.offsetX / prog.offsetWidth;aud.addEventListener('timeupdate', () => {let prg = aud.currentTime * prog.offsetWidth / aud.duration < 6 ? 6 : aud.currentTime * prog.offsetWidth / aud.duration;tmsg.innerText = `${toMin(aud.currentTime)} | ${toMin(aud.duration)}`;prog.style.setProperty('--xx', prg + 'px');for (j = 0; j < data.lrcAr.length; j++) {if (aud.currentTime >= data.lrcAr) {cKey = j;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'),btnplay.style.setProperty('--state', 'paused')) : (lrc.style.setProperty('--state','running'),btnplay.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);};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;}};mkPlayer.HCPlayer = playCode;})(this);
        (function(mkFS) {let setFullScreen = (user_set) => {let pa = user_set.pa;if(typeof(pa) !== 'object') return false;if(!user_set.set) user_set.set = 'color: snow; background: black; border: 2px solid snow; left: 40px; bottom: 40px;';btnMsg = document.createElement('span');btnMsg.style.cssText = `position: absolute; border-radius: 8px; padding: 4px; cursor: pointer; z-index:998; ${user_set.set}`;btnMsg.innerText = '全屏观赏';btnMsg.style.display = 'none';pa.appendChild(btnMsg);let timerId, fs = false;btnMsg.onclick = () => fs ? document.exitFullscreen() : pa.requestFullscreen();pa.addEventListener('mousemove', (e) => {clearTimeout(timerId);btnMsg.style.display = 'block';timerId = setTimeout('btnMsg.style.display = "none"', 3000);});document.addEventListener('fullscreenchange', () => {if (document.fullscreenElement !== null) {fs = true;btnMsg.innerText = '退出全屏';} else {fs = false;btnMsg.innerText = '全屏观赏';}});};mkFS.FS = setFullScreen;})(this);
        let averAdd = 0, offset = 0;
        let geci = `《又见山里红》韩非/徐丽平\n
词/曲:刘海东\n
祝大家开心快乐\n
那是你秋天依恋的风\n
那是你漫山醉人的红\n
那是你含情脉脉的心\n
酸酸甜甜招人疼\n
你是我一片思乡的情\n
你是我童年最真的梦\n
你是我藏在心中的歌\n
今天唱给你来听\n
又见山里红\n
久别的山里红\n
你把太阳的色彩\n
浓缩成故乡情\n
又见山里红\n
故乡的山里红\n
你把燃烧的岁月\n
融化在我心中\n
那是你秋天依恋的风\n
那是你漫山醉人的红\n
那是你含情脉脉的心\n
酸酸甜甜招人疼\n
你是我一片思乡的情\n
你是我童年最真的梦\n
你是我藏在心中的歌\n
今天唱给你来听\n
又见山里红\n
久别的山里红\n
你把太阳的色彩\n
浓缩成故乡情\n
又见山里红\n
故乡的山里红\n
你把燃烧的岁月\n
融化在我心中\n
那是你秋天依恋的风\n
那是你漫山醉人的红\n
那是你含情脉脉的心\n
酸酸甜甜招人疼\n
你是我一片思乡的情\n
你是我童年最真的梦\n
你是我藏在心中的歌\n
今天唱给你来听\n
又见山里红\n
久别的山里红\n
你把太阳的色彩\n
浓缩成故乡情\n
又见山里红\n
故乡的山里红\n
你把燃烧的岁月\n
融化在我心中\n
你把燃烧的岁月\n
融化在我心中`;

        let lrcTime = (ar) => {let tmpAr = [];for(j = 0; j <ar.length - 1; j ++) {if(j !== ar.length - 1) tmpAr = parseFloat((ar - ar).toFixed(1));}let aver = parseInt(tmpAr.reduce((a,b) => a + b) / (tmpAr.length - 1)) + averAdd;tmpAr.push(aver);tmpAr.forEach((item,key) => {ar = item > aver ? aver : item;});return ar;};
        let getLrcAr = (text) => {let lrcAr = [];let calcRule = ;for(x of text.split('\n')) {let ar = [];let re = /\d+[\.:]\d+([\.:]\d+)?/g;let geci = x.replace(re,'');if(geci) {geci = geci.replace(/[\[\]\'\"\t,]s?/g,'');let time = x.match(re);if(time != null) {for(y of time) {let tmp = y.match(/\d+/g);let sec = 0;for(z in tmp) sec += tmp * calcRule;ar = ;lrcAr.push(ar); }}}}lrcAr.sort((a,b)=> a - b);return(lrcTime(lrcAr));}

        HCPlayer({
                lrcAr: getLrcAr(geci),
                lrc_css: '--bg: linear-gradient(hsla(90,80%,50%,.35),hsla(100,70%,45%,.6)); top: 20px;',
                player_css: '--ww: 280px; bottom: 650px;',
                btn_txt: '\u2623',
        });

        FS({
                pa: papa,
                set: 'backgroun: transparent; color: snow; border: 4px dotted snow; left: 20px; top: 20px;',
        });

        aud.onerror = () => {
                if(aud.error.code === 4) aud.src = 'https://music.163.com/song/media/outer/url?id=1893307263.mp3';
        }
})();
</script>
</td></tr></table>

非常开心 发表于 2023-3-8 21:35

本帖最后由 非常开心 于 2023-10-4 20:05 编辑


非常开心 发表于 2023-3-8 21:35


非常开心 发表于 2023-3-8 21:39

细软的沙滩,清澈的海水,透明的阳光,美丽的花环,甜蜜的笑-……即使有如此多的相同之处,但苍茫大海上的千万岛屿,却依旧各有性格,各有动人的故事。

墨羽 发表于 2023-3-8 21:51

迷人的大海,漂亮的岛屿,休闲度假好去处!

小沫 发表于 2023-3-8 22:45

很喜欢海,喜欢脚踩在软软的沙滩上的感觉,很舒服

非常开心 发表于 2023-3-9 06:33

墨羽 发表于 2023-3-8 21:51
迷人的大海,漂亮的岛屿,休闲度假好去处!

谢谢老师鼓励{:9_399:}

非常开心 发表于 2023-3-9 06:34

小沫 发表于 2023-3-8 22:45
很喜欢海,喜欢脚踩在软软的沙滩上的感觉,很舒服

谢谢小沫老师奖励

楚心兰 发表于 2023-3-9 06:45

令人向往的地方!
页: [1] 2
查看完整版本: 美丽的岛屿