|
|
第2,463行: |
第2,463行: |
| <div class="sprite-name">405提姆提姆</div> | | <div class="sprite-name">405提姆提姆</div> |
| </div> | | </div> |
|
| |
| <style>
| |
| #floating-player {
| |
| position: fixed;
| |
| bottom: 0;
| |
| right: 0;
| |
| margin: 8px;
| |
| background: #111;
| |
| color: white;
| |
| padding: 10px 15px;
| |
| font-family: sans-serif;
| |
| font-size: 14px;
| |
| display: flex;
| |
| align-items: center;
| |
| gap: 10px;
| |
| border-radius: 10px;
| |
| box-shadow: 0 0 10px #000;
| |
| z-index: 9999;
| |
| }
| |
|
| |
|
| |
| #floating-player button {
| |
| background: #333;
| |
| border: none;
| |
| padding: 6px 12px;
| |
| color: white;
| |
| border-radius: 6px;
| |
| cursor: pointer;
| |
| }
| |
|
| |
| #floating-player button:hover {
| |
| background: #555;
| |
| }
| |
|
| |
| #progress {
| |
| background: #333;
| |
| height: 6px;
| |
| border-radius: 3px;
| |
| flex: 1;
| |
| width: 100px;
| |
| overflow: hidden;
| |
| }
| |
|
| |
| #bar {
| |
| height: 100%;
| |
| width: 0%;
| |
| background: #66f;
| |
| transition: width 0.2s linear;
| |
| }
| |
| </style>
| |
|
| |
| <audio id="bgm" src="https://d1rtq9slcl72gh.cloudfront.net/audio/home.mp3" loop></audio>
| |
| <div id="floating-player"
| |
| onclick="(function(){
| |
| var bgm = document.getElementById('bgm');
| |
| if (!window.bgm_initialized) {
| |
| document.body.addEventListener('click', function(){
| |
| bgm.play().catch(()=>{});
| |
| }, { once: true });
| |
|
| |
| setInterval(function(){
| |
| if (!bgm.duration) return;
| |
| var percent = (bgm.currentTime / bgm.duration) * 100;
| |
| document.getElementById('bar').style.width = percent + '%';
| |
| }, 300);
| |
|
| |
| window.bgm_initialized = true;
| |
| }
| |
| })()"
| |
| >
| |
| <button onclick="document.getElementById('bgm').play()">▶ 播放</button>
| |
| <button onclick="document.getElementById('bgm').pause()">⏸ 暂停</button>
| |
| <div id="progress"><div id="bar"></div></div>
| |
| </div> | | </div> |
|
| |
| </div>
| |
|
| |
| </html> | | </html> |