-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
89 lines (78 loc) · 2.78 KB
/
index.html
File metadata and controls
89 lines (78 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!DOCTYPE html>
<html>
<head>
<style>
body {
overflow: hidden;
background: #000;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
cursor: pointer;
}
.marquee {
white-space: nowrap;
position: relative;
animation: marquee 30s linear infinite; /* 延长动画时间 */
color: #ff69b4;
font-family: 'Microsoft YaHei', sans-serif;
font-size: 6vw;
text-shadow: 2px 2px 8px rgba(255,105,180,0.7);
font-weight: bold;
}
@keyframes marquee {
0% { transform: translateX(100%); }
100% { transform: translateX(-150%); } /* 调整为-150%确保完全滚动 */
}
#audioPlayer {
display: none;
}
.loader {
color: white;
position: fixed;
top: 20px;
display: none;
}
</style>
</head>
<body>
<div class="loader">加载中...</div>
<div class="marquee">🦊太太,新年快乐!🎉 不期待,不假设,不强求。🌹 2025 把每一天都活成自己喜欢的模样!🎊</div>
<audio id="audioPlayer" loop>
<!-- 修正音频文件地址 -->
<source src="https://raw.githubusercontent.com/james986/Iris2025/main/Nocturn%20(GT7%20Opening%20Version).mp3" type="audio/mpeg">
您的浏览器不支持音频播放
</audio>
<script>
document.addEventListener('DOMContentLoaded', function() {
const audio = document.getElementById('audioPlayer');
const loader = document.querySelector('.loader');
// 显示加载提示
loader.style.display = 'block';
// 预加载优化
audio.preload = 'auto';
// 音频加载完成处理
audio.onloadeddata = () => {
loader.style.display = 'none';
// 自动播放尝试
audio.play().catch(() => {
loader.textContent = '点击任意位置开始播放';
loader.style.display = 'block';
});
};
// 统一交互处理
const playAudio = () => {
audio.play();
loader.style.display = 'none';
document.body.removeEventListener('click', playAudio);
document.body.removeEventListener('touchstart', playAudio);
};
// 添加交互监听
document.body.addEventListener('click', playAudio);
document.body.addEventListener('touchstart', playAudio);
});
</script>
</body>
</html>