Spaces:
Running
Running
File size: 11,559 Bytes
6b5ca20 |
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 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>消息推送</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}
body {
background: linear-gradient(135deg, #0c0c2e 0%, #1a1a3e 100%);
color: #e0f7fa;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
overflow-x: hidden;
position: relative;
}
/* 动态背景效果 */
body::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background:
radial-gradient(circle at 20% 30%, rgba(0, 150, 136, 0.15) 0%, transparent 50%),
radial-gradient(circle at 80% 70%, rgba(0, 188, 212, 0.15) 0%, transparent 50%);
z-index: -1;
}
.container {
max-width: 800px;
width: 100%;
background: rgba(18, 18, 40, 0.85);
backdrop-filter: blur(10px);
border-radius: 16px;
padding: 40px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5),
0 0 0 1px rgba(0, 150, 136, 0.2),
0 0 20px rgba(0, 188, 212, 0.3);
position: relative;
overflow: hidden;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.container:hover {
transform: translateY(-5px);
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6),
0 0 0 1px rgba(0, 150, 136, 0.4),
0 0 30px rgba(0, 188, 212, 0.5);
}
.container::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 4px;
background: linear-gradient(90deg, #00bcd4, #009688);
}
.title {
text-align: center;
margin-bottom: 40px;
font-size: 2.2rem;
font-weight: 300;
letter-spacing: 2px;
color: #00bcd4;
position: relative;
padding-bottom: 15px;
}
.title::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 100px;
height: 2px;
background: linear-gradient(90deg, transparent, #00bcd4, transparent);
}
.info-card {
background: rgba(30, 30, 60, 0.7);
border-radius: 12px;
padding: 25px;
margin-bottom: 25px;
border-left: 4px solid #00bcd4;
transition: all 0.3s ease;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.info-card:hover {
transform: translateX(5px);
background: rgba(40, 40, 70, 0.8);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.info-label {
font-size: 1.3rem;
color: #80deea;
margin-bottom: 10px;
display: flex;
align-items: center;
}
.info-label::before {
content: '';
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
background: #00bcd4;
margin-right: 10px;
}
.info-content {
font-size: 1.2rem;
color: #e0f7fa;
font-weight: 500;
word-break: break-word;
line-height: 1.6;
white-space: pre-line;
}
.pulse {
animation: pulse 2s infinite;
}
@keyframes pulse {
0% {
box-shadow: 0 0 0 0 rgba(0, 188, 212, 0.4);
}
70% {
box-shadow: 0 0 0 10px rgba(0, 188, 212, 0);
}
100% {
box-shadow: 0 0 0 0 rgba(0, 188, 212, 0);
}
}
/* Markdown 样式覆盖 */
.info-content h1, .info-content h2, .info-content h3, .info-content h4, .info-content h5, .info-content h6 {
color: #00bcd4;
margin-top: 1em;
margin-bottom: 0.5em;
font-weight: 400;
}
.info-content p {
margin-bottom: 1em;
line-height: 1.6;
}
.info-content strong {
color: #e0f7fa;
font-weight: 600;
}
.info-content em {
color: #80deea;
font-style: italic;
}
.info-content code {
background: rgba(0, 0, 0, 0.3);
color: #00bcd4;
padding: 2px 4px;
border-radius: 4px;
font-family: 'Courier New', monospace;
}
.info-content pre {
background: rgba(0, 0, 0, 0.4);
color: #e0f7fa;
padding: 1em;
border-radius: 8px;
overflow-x: auto;
margin-bottom: 1em;
}
.info-content blockquote {
border-left: 4px solid #009688;
margin: 1em 0;
padding-left: 1em;
color: #80deea;
font-style: italic;
}
.info-content ul, .info-content ol {
margin-bottom: 1em;
padding-left: 2em;
}
.info-content li {
margin-bottom: 0.5em;
}
.info-content a {
color: #00bcd4;
text-decoration: none;
}
.info-content a:hover {
text-decoration: underline;
}
.info-content table {
width: 100%;
border-collapse: collapse;
margin-bottom: 1em;
background: rgba(0, 0, 0, 0.2);
border-radius: 8px;
overflow: hidden;
}
.info-content th, .info-content td {
padding: 0.75em;
text-align: left;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.info-content th {
background: rgba(0, 188, 212, 0.2);
color: #00bcd4;
}
/* 响应式设计 */
@media (max-width: 768px) {
.container {
padding: 25px;
}
.title {
font-size: 1.9rem;
}
.info-content {
font-size: 1.1rem;
}
.info-label {
font-size: 1.2rem;
}
}
@media (max-width: 480px) {
.container {
padding: 20px;
}
.title {
font-size: 1.6rem;
}
.info-content {
font-size: 1rem;
}
.info-card {
padding: 20px;
}
.info-label {
font-size: 1.1rem;
}
}
/* 动态粒子背景 */
.particles {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
overflow: hidden;
}
.particle {
position: absolute;
background: rgba(0, 188, 212, 0.3);
border-radius: 50%;
animation: float 15s infinite linear;
}
@keyframes float {
0% {
transform: translateY(0) translateX(0);
opacity: 0;
}
10% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
transform: translateY(-100vh) translateX(100px);
opacity: 0;
}
}
</style>
</head>
<body>
<div class="particles" id="particles"></div>
<div class="container pulse">
<div class="title" id="title">消息推送</div>
<div class="info-card">
<div class="info-label">通知内容</div>
<div class="info-content" id="message">无告警信息</div>
</div>
<div class="info-card">
<div class="info-label">时间</div>
<div class="info-content" id="date">无时间信息</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/marked/lib/marked.umd.js"></script>
<script>
// 从 URL 参数读取数据
function getUrlParams() {
const urlParams = new URLSearchParams(window.location.search);
return {
title: urlParams.get('title') || '消息推送',
message: urlParams.get('message') || '无告警信息',
date: urlParams.get('date') || '无时间信息'
};
}
// 创建动态粒子背景
function createParticles() {
const particlesContainer = document.getElementById('particles');
const particleCount = 25;
const colors = [
'rgba(0, 188, 212, 0.2)',
'rgba(0, 150, 136, 0.2)',
'rgba(77, 182, 172, 0.15)'
];
for (let i = 0; i < particleCount; i++) {
const particle = document.createElement('div');
particle.classList.add('particle');
const size = Math.random() * 3 + 1;
particle.style.width = `${size}px`;
particle.style.height = `${size}px`;
const randomColor = colors[Math.floor(Math.random() * colors.length)];
particle.style.background = randomColor;
particle.style.left = `${Math.random() * 100}%`;
particle.style.top = `${Math.random() * 100}%`;
particle.style.animationDelay = `${Math.random() * 20}s`;
particle.style.animationDuration = `${20 + Math.random() * 15}s`;
particlesContainer.appendChild(particle);
}
}
// 处理 Markdown 渲染
function renderMarkdown() {
const messageEl = document.getElementById('message');
if (messageEl && typeof marked !== 'undefined') {
const markdownText = messageEl.textContent || messageEl.innerText;
messageEl.innerHTML = marked.parse(markdownText);
}
}
// 填充页面内容
function fillContent() {
const params = getUrlParams();
document.getElementById('title').textContent = params.title;
document.getElementById('message').textContent = params.message;
document.getElementById('date').textContent = params.date;
renderMarkdown(); // 渲染 Markdown
}
// 页面加载时调用
window.onload = function() {
createParticles();
fillContent();
};
</script>
</body>
</html> |