楼主: 花简静

花简静贴子代码及说明汇总(翻页有新贴)

[复制链接]
 楼主| 发表于 2025-6-4 12:06 | 显示全部楼层
本帖最后由 花简静 于 2025-6-4 22:18 编辑

点评
回复

使用道具

 楼主| 发表于 2025-6-4 12:06 | 显示全部楼层
本帖最后由 花简静 于 2025-8-15 10:40 编辑

<style> #mydiv { margin: 130px 0 0 calc(50% - 951px); width: 1700px; height: 900px; border: 4px solid rgba(0,0,0,.15); border-radius: 10px; background: gray url('https://642303.freep.cn/642303/tu/20250603mtzq.webp') no-repeat center/cover; box-shadow: 4px 4px 16px rgba(0,0,0,.25); position: relative; display: grid; place-items: center;overflow: hidden; } #mydiv::before { position: absolute; content: attr(data-title); right: 17%;top: 63%; font: bold 1.8em/2em sans-serif; color: GoldEnrod; text-shadow: 1px 1px #000;screen;opacity: .62; z-index: 4; } #rili { padding: 6px; left: 200px;top: 100px; max-width: 262px; display: flex; flex-direction: row; flex-wrap: wrap; color: #eee; box-sizing: border-box; position: absolute; } #rili::before { position: absolute; content: attr(data-bg); width: 100%; height: 100%; color: rgba(0,0,0,.25); display: grid; place-items: center; font: bold 2em sans-serif; } #iRed { position: absolute; color: red; transition: .5s; } #iRed:hover { font-size: 20px; font-weight: bold; } #myplayer { position: absolute; cursor: pointer;width: 120px; height: 120px;right: 600px;bottom: 320px; z-index: 12; mix-blend-mode: screen;animation: rotating 5s infinite linear var(--state);opacity: .82; } .tbox { width: 30px; height: 26px; text-align: center; font: normal 16px/26px sans-serif; cursor: pointer; z-index: 10; } .tbox:hover { color: pink; } .tbox:active { color: red; } #vid { position: absolute;width: 110%; height: 110%; top:-10px;object-fit: cover; mask: radial-gradient(transparent 20%, red); -webkit-mask: radial-gradient(transparent 20%, red); mix-blend-mode: screen;opacity: .42;transform: rotateY(180deg); } @keyframes rotating { to { transform: rotate(360deg); } }   </style>   <div id="mydiv"> <video id="vid" src="https://video.699pic.com/videos/19/58/81/b_gNb3yrP5v7161587195881.mp4" muted loop></video>     <audio id="aud" src="https://music.163.com/song/media/outer/url?id=22651392" autoplay loop></audio>     <div id="rili"></div>     <img id="myplayer" src="https://642303.freep.cn/642303/za/pngsucai_2614287_2df54e.png" alt="" /> </div>   <script> let songs = [ ["明天之前","2166532605"], ["望 - 周深","1814080666"], ["再 回 首","2112262812"], ["愿-周深","29737768"], ["爱若琉璃","1436150979"], ["起 风 了","1475596788"], ["岁月周深","2106791516"], ["雪花落下","1429392929"], ["身骑白马","2015499286"], ["是好孩子","297587"], ["喀 秋 莎","359457"], ["听 我 说","1415078941"], ["半 壶 纱","2122898481"], ["南屏晚钟","359402"], ["坠入星光","1959439181"], ["随风周深","1954382369"], ["浮光周深","2112196350"], ["千千阕歌","212233"], ["孤岛蓝鲸","1465313631"], ["花开忘忧","2016388224"], ["-如愿-","1937110718"], ["梨花又开放","34928665"], ["兰 亭 序","1974403336"], ["等你归来","1873136304"], ["人间烟火","1940210058"], ["锦 瑟 年","1837780432"], ["-活着-","29600712"], ["大鱼周深","1491495234"], ["飘洋过海","30903117"], ["路过人间","1495052210"], ["花开不惑","1498555234"] ]; /* 画日历并播放今天曲目 */ (function () {     let ar = '日一二三四五六'.split('').map(c => `<div class="tbox">${c}</div>`);     let output = ar.join('');     let y = new Date().getFullYear(), m = new Date().getMonth();     let days = new Date(y, m+1, 0).getDate();     let day1st = new Date(y, m).getDay();     let today = new Date().getDate();     Array.from({length: days + day1st}).forEach((item,key) => {         let idx = key < day1st ? '' : (key - day1st + 1);         if(idx) {             if(idx == today) idx = `<span id="iRed">${idx}</span>`;             let sUrl = songs[key - day1st][1], sName = songs[key - day1st][0];             output += `<div class="tbox" title="${sName}" onclick="playSong(${sUrl},'${sName}');this.style.color='navy';">${idx}</div>`;         }else{             output += '<div class="tbox"></div>';         }     });     rili.innerHTML = output;     rili.dataset.bg = `${y}年${m+1}月`;     let songName = songs[today - 1][0], songUrl = songs[today - 1][1];     playSong(songUrl,songName); })(); /* 播放音频函数 :相同的url前缀 + 不同的后缀id */ function playSong(id,song) {     let url = 'https://music.163.com/song/media/outer/url?id=' + id;     aud.src = url;     mydiv.dataset.title = song; }; /* 其他相关操作 */ let mState = () => aud.paused ? (mydiv.style.setProperty('--state', 'paused'), vid.pause()) : (mydiv.style.setProperty('--state','running'), vid.play()); aud.addEventListener('playing', mState, false); aud.addEventListener('pause', mState, false); myplayer.addEventListener('click', () => aud.paused ? aud.play() : aud.pause());   </script>
点评
回复

使用道具

 楼主| 发表于 2025-6-4 12:06 | 显示全部楼层
点评
回复

使用道具

 楼主| 发表于 2025-6-4 12:06 | 显示全部楼层
点评
回复

使用道具

 楼主| 发表于 2025-6-7 21:00 | 显示全部楼层
点评
回复

使用道具

 楼主| 发表于 2025-6-7 21:00 | 显示全部楼层
点评
回复

使用道具

 楼主| 发表于 2025-6-7 21:00 | 显示全部楼层
点评
回复

使用道具

 楼主| 发表于 2025-6-7 21:00 | 显示全部楼层
点评
回复

使用道具

 楼主| 发表于 2025-6-7 21:00 | 显示全部楼层
点评
回复

使用道具

 楼主| 发表于 2025-6-7 21:00 | 显示全部楼层
点评
回复

使用道具

您需要登录后才可以回帖 登录 | 中文注册

本版积分规则

手机版|千山论坛 ( 冀ICP备2024055714号 )

GMT+8, 2025-9-16 14:41

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表