|
|
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
- <title>司令论坛 · 官方入口</title>
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" integrity="sha512-..." crossorigin="anonymous" referrerpolicy="no-referrer" />
- <style>
- /* ===== 主题变量 ===== */
- :root {
- --primary: #4361ee;
- --primary-light: #4895ef;
- --primary-dark: #3a56d4;
- --bg-body: #f9fbfd;
- --bg-card: #ffffff;
- --text-main: #2b2d42;
- --text-muted: #6c757d;
- --border-color: #eaeef5;
- --success: #4ade80;
- --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
- --shadow-md: 0 6px 16px rgba(0,0,0,0.08);
- --radius: 16px;
- --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
- }
- .dark-mode {
- --primary: #4cc9f0;
- --primary-light: #5abaff;
- --primary-dark: #3db9e8;
- --bg-body: #0f172a;
- --bg-card: #1e293b;
- --text-main: #f1f5f9;
- --text-muted: #94a3b8;
- --border-color: #334155;
- --success: #34d399;
- --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
- --shadow-md: 0 6px 16px rgba(0,0,0,0.25);
- }
- * {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
- body {
- min-height: 100vh;
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
- background-color: var(--bg-body);
- color: var(--text-main);
- padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
- display: flex;
- justify-content: center;
- align-items: center;
- line-height: 1.6;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- }
- .container {
- width: 100%;
- max-width: 540px;
- background: var(--bg-card);
- border-radius: var(--radius);
- box-shadow: var(--shadow-md);
- overflow: hidden;
- animation: fadeIn 0.4s ease-out;
- }
- @keyframes fadeIn {
- from { opacity: 0; transform: translateY(12px); }
- to { opacity: 1; transform: translateY(0); }
- }
- .header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 26px 26px 18px; /* 调整:减少 bottom padding,避免与 links-grid 重叠 */
- border-bottom: 1px solid var(--border-color);
- }
- h1 {
- font-size: 1.8rem;
- font-weight: 800;
- background: linear-gradient(90deg, var(--primary), var(--primary-light));
- -webkit-background-clip: text;
- background-clip: text;
- color: transparent;
- letter-spacing: -0.8px;
- }
- .actions {
- display: flex;
- gap: 12px;
- }
- .btn {
- border: none;
- border-radius: 12px;
- padding: 10px 16px;
- cursor: pointer;
- font-size: 14px;
- font-weight: 600;
- display: flex;
- align-items: center;
- gap: 6px;
- transition: var(--transition);
- outline: none;
- position: relative;
- min-width: 42px;
- justify-content: center;
- }
- .bookmark-btn {
- background: linear-gradient(135deg, var(--primary), var(--primary-dark));
- color: white;
- box-shadow: 0 3px 8px rgba(67, 97, 238, 0.35);
- }
- .bookmark-btn:hover {
- transform: translateY(-2px);
- box-shadow: 0 5px 12px rgba(67, 97, 238, 0.45);
- }
- .theme-btn {
- width: 44px;
- height: 44px;
- padding: 0;
- border-radius: 50%;
- background: var(--bg-card);
- color: var(--text-main);
- display: flex;
- align-items: center;
- justify-content: center;
- box-shadow: var(--shadow-sm);
- }
- .theme-btn:hover {
- transform: rotate(25deg) scale(1.1);
- background: var(--primary);
- color: white;
- }
- .links-grid {
- padding: 22px 26px; /* 上下 = 22px,等于 gap 值,实现首尾对称 */
- display: flex;
- flex-direction: column;
- gap: 22px; /* 所有卡片间距一致 */
- }
- .link-card {
- padding: 22px;
- border-radius: var(--radius);
- background: var(--bg-card);
- border: 1px solid var(--border-color);
- transition: var(--transition);
- position: relative;
- overflow: hidden;
- }
- .link-card::before {
- content: '';
- position: absolute;
- top: 0;
- left: 0;
- height: 100%;
- width: 4px;
- background: var(--primary);
- opacity: 0.7;
- }
- .link-card:hover {
- transform: translateY(-4px);
- box-shadow: var(--shadow-md);
- border-color: var(--primary);
- }
- .link-header {
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- margin-bottom: 10px;
- }
- .link-title {
- font-size: 1.18rem;
- font-weight: 700;
- display: flex;
- align-items: center;
- gap: 10px;
- flex: 1;
- }
- .link-title i {
- color: var(--primary);
- font-size: 1.15rem;
- }
- .copy-btn {
- background: none;
- border: none;
- color: var(--text-muted);
- cursor: pointer;
- width: 32px;
- height: 32px;
- border-radius: 8px;
- display: flex;
- align-items: center;
- justify-content: center;
- transition: var(--transition);
- flex-shrink: 0;
- }
- .copy-btn:hover {
- background: rgba(67, 97, 238, 0.1);
- color: var(--primary);
- }
- .copy-btn.copied {
- color: var(--success) !important;
- transform: scale(1.1);
- }
- .link-url {
- text-decoration: none;
- font-size: 0.96rem;
- color: var(--text-muted);
- word-break: break-all;
- display: block;
- padding: 4px 0;
- position: relative;
- transition: color 0.2s;
- }
- .link-url:hover {
- color: var(--primary);
- }
- .link-url::after {
- content: '';
- position: absolute;
- bottom: 0;
- left: 0;
- width: 0;
- height: 1.6px;
- background: var(--primary);
- transition: width 0.3s ease;
- }
- .link-url:hover::after {
- width: 100%;
- }
- .footer {
- padding: 18px 26px;
- text-align: center;
- font-size: 12px;
- color: var(--text-muted);
- border-top: 1px solid var(--border-color);
- font-weight: 500;
- }
- /* 响应式 */
- @media (max-width: 480px) {
- .container {
- margin: 0 12px;
- }
- .header,
- .links-grid {
- padding-left: 20px;
- padding-right: 20px;
- }
- h1 {
- font-size: 1.55rem;
- }
- .link-card {
- padding: 18px;
- }
- .btn {
- padding: 9px 14px;
- font-size: 13px;
- }
- .theme-btn {
- width: 42px;
- height: 42px;
- }
- }
- /* 可访问性:仅当键盘导航时显示焦点 */
- .btn:focus:not(:focus-visible) {
- outline: none;
- }
- .btn:focus-visible {
- outline: 2px solid var(--primary);
- outline-offset: 2px;
- border-radius: 12px;
- }
- .copy-btn:focus-visible {
- outline-offset: 1px;
- border-radius: 8px;
- }
- </style>
- </head>
- <body class="light-mode">
- <div class="container">
- <div class="header">
- <h1>司令论坛</h1>
- <div class="actions">
- <button class="btn bookmark-btn" onclick="bookmarkPage()" aria-label="收藏本页">
- <i class="fas fa-bookmark"></i> 收藏
- </button>
- <button class="btn theme-btn" onclick="toggleTheme()" title="切换明暗主题" aria-label="切换主题">
- <i class="fas fa-moon" id="themeIcon"></i>
- </button>
- </div>
- </div>
- <div class="links-grid" id="linksGrid">
- <!-- 链接将由 JS 渲染 -->
- </div>
- <div class="footer">
- Copyright © 2026 cmdrbbs.com All Rights Reserved
- </div>
- </div>
- <script>
- // 链接数据(便于维护)
- const links = [
- {
- title: "司令论坛",
- url: "https://www.cmdrbbs.com",
- icon: "fa-link"
- },
- {
- title: "三毛机场 · 5元1200G",
- url: "https://gw-1.xn--ehqx7tcnnope.com/#/register?code=MMWgjJKw",
- icon: "fa-link"
- }
- ];
- // 渲染链接卡片
- function renderLinks() {
- const grid = document.getElementById('linksGrid');
- grid.innerHTML = links.map((link, index) => `
- <div class="link-card">
- <div class="link-header">
- <span class="link-title">
- <i class="fas ${link.icon}"></i> ${link.title}
- </span>
- <button class="copy-btn"
- onclick="copyUrl(this, '${link.url}')"
- aria-label="复制链接"
- data-index="${index}">
- <i class="fas fa-copy"></i>
- </button>
- </div>
- <a href="${link.url}" target="_blank" class="link-url" rel="noopener noreferrer">
- ${link.url}
- </a>
- </div>
- `).join('');
- }
- // 复制链接功能
- async function copyUrl(btn, url) {
- try {
- await navigator.clipboard.writeText(url);
- const icon = btn.querySelector('i');
- icon.className = 'fas fa-check';
- btn.classList.add('copied');
-
- setTimeout(() => {
- icon.className = 'fas fa-copy';
- btn.classList.remove('copied');
- }, 2000);
- } catch (err) {
- console.warn('复制失败:', err);
- alert('无法复制链接,请手动复制');
- }
- }
- // 主题切换
- function toggleTheme() {
- const body = document.body;
- const isDark = body.classList.contains('dark-mode');
- const newMode = isDark ? 'light-mode' : 'dark-mode';
-
- body.classList.remove(isDark ? 'dark-mode' : 'light-mode');
- body.classList.add(newMode);
-
- const icon = document.getElementById('themeIcon');
- icon.className = newMode === 'dark-mode' ? 'fas fa-sun' : 'fas fa-moon';
-
- localStorage.setItem('siteTheme', newMode);
- }
- // 初始化
- document.addEventListener('DOMContentLoaded', () => {
- // 渲染链接
- renderLinks();
-
- // 应用主题
- const saved = localStorage.getItem('siteTheme') || 'light-mode';
- document.body.className = saved;
- document.getElementById('themeIcon').className =
- saved === 'dark-mode' ? 'fas fa-sun' : 'fas fa-moon';
- });
- // 收藏提示
- function bookmarkPage() {
- alert('📌 请使用快捷键收藏本页:\n\nWindows/Linux: Ctrl + D\nMac: ⌘ Command + D');
- }
- </script>
- <!-- 统计脚本(建议异步加载) -->
- <script async charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script>
- <script>
- window.addEventListener('load', () => {
- if (typeof LA !== 'undefined') {
- LA.init({id:"3OdH4Am1dhJUBXA2",ck:"3OdH4Am1dhJUBXA2"});
- }
- });
- </script>
- </body>
- </html>
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|