✏️
编辑
ID:
A9wbTSh7
☀️
修改下面的 (
A9wbTSh7
) 代码,点击“保存”即可立即生效。原链接和编辑密钥保持不变。
<!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; } :root { --bg: #f2f2f7; --card: #ffffff; --header: rgba(255,255,255,.72); --text: #1c1c1e; --text-sub: #8e8e93; --border: rgba(60,60,67,.08); --shadow: 0 4px 20px rgba(0,0,0,.06); --shadow-hover: 0 12px 32px rgba(0,0,0,.12); --shadow-menu: 0 12px 40px rgba(0,0,0,.14); --accent: #007aff; --menu-bg: #ffffff; --menu-hover: rgba(118,118,128,.10); } @media (prefers-color-scheme: dark) { :root { --bg: #0b0b0e; --card: #1c1c1e; --header: rgba(28,28,30,.72); --text: #f5f5f7; --text-sub: #8e8e93; --border: rgba(255,255,255,.08); --shadow: 0 4px 20px rgba(0,0,0,.5); --shadow-hover: 0 12px 32px rgba(0,0,0,.7); --shadow-menu: 0 12px 40px rgba(0,0,0,.7); --accent: #0a84ff; --menu-bg: #2c2c2e; --menu-hover: rgba(118,118,128,.22); } } html[data-theme="light"] { --bg: #f2f2f7; --card: #ffffff; --header: rgba(255,255,255,.72); --text: #1c1c1e; --text-sub: #8e8e93; --border: rgba(60,60,67,.08); --shadow: 0 4px 20px rgba(0,0,0,.06); --shadow-hover: 0 12px 32px rgba(0,0,0,.12); --shadow-menu: 0 12px 40px rgba(0,0,0,.14); --accent: #007aff; --menu-bg: #ffffff; --menu-hover: rgba(118,118,128,.10); } html[data-theme="dark"] { --bg: #0b0b0e; --card: #1c1c1e; --header: rgba(28,28,30,.72); --text: #f5f5f7; --text-sub: #8e8e93; --border: rgba(255,255,255,.08); --shadow: 0 4px 20px rgba(0,0,0,.5); --shadow-hover: 0 12px 32px rgba(0,0,0,.7); --shadow-menu: 0 12px 40px rgba(0,0,0,.7); --accent: #0a84ff; --menu-bg: #2c2c2e; --menu-hover: rgba(118,118,128,.22); } body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; transition: background .3s ease, color .3s ease; } /* ==================== 顶部导航 ==================== */ header { position: sticky; top: 0; z-index: 100; backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); background: var(--header); border-bottom: 1px solid var(--border); transition: background .3s ease, border-color .3s ease; } .header-inner { max-width: 960px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; } .brand { display: flex; align-items: center; gap: 10px; min-width: 0; } .brand img { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--border); } .brand-name { font-size: 17px; font-weight: 700; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; } .icon-btn { width: 40px; height: 40px; border: none; border-radius: 50%; background: transparent; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 20px; transition: background .2s ease, transform .2s ease; -webkit-tap-highlight-color: transparent; position: relative; } .icon-btn:hover { background: var(--menu-hover); } .icon-btn:active { transform: scale(.92); } .icon-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; } /* ==================== 用户下拉菜单 ==================== */ .user-wrap { position: relative; } .menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 180px; background: var(--menu-bg); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-menu); padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.96); transform-origin: top right; transition: opacity .18s ease, transform .18s ease, visibility .18s; overflow: hidden; } .menu.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); } .menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; transition: background .15s ease; white-space: nowrap; } .menu a:hover { background: var(--menu-hover); } .menu a .ico { font-size: 15px; width: 18px; text-align: center; } /* ==================== 主内容 ==================== */ .wrap { max-width: 640px; margin: 0 auto; padding: 32px 20px 60px; } h1 { font-size: 22px; font-weight: 700; letter-spacing: -.3px; margin-bottom: 6px; } .sub { font-size: 13px; color: var(--text-sub); margin-bottom: 26px; } .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; } .card { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 20px 18px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .2s cubic-bezier(.25,.1,.25,1), box-shadow .2s ease, border-color .2s ease; -webkit-tap-highlight-color: transparent; } .card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--accent); } .card:active { transform: scale(.97); } .card .name { font-size: 15px; font-weight: 600; letter-spacing: -.1px; word-break: break-word; } .card .arrow { font-size: 16px; color: var(--text-sub); flex-shrink: 0; transition: color .2s, transform .2s; } .card:hover .arrow { color: var(--accent); transform: translateX(3px); } @media (max-width: 480px) { .brand-name { font-size: 15px; } .icon-btn { width: 36px; height: 36px; } .icon-btn svg { width: 20px; height: 20px; } } </style> </head> <body> <!-- ==================== 顶部导航 ==================== --> <header> <div class="header-inner"> <div class="brand"> <img src="/logo.gif" alt="logo"> <span class="brand-name">链接导航</span> </div> <div class="actions"> <!-- 主题切换 --> <button class="icon-btn" id="themeBtn" aria-label="切换深浅色"> <svg id="themeIcon" viewBox="0 0 24 24"> <circle cx="12" cy="12" r="4"></circle> <path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"></path> </svg> </button> <!-- 用户菜单 --> <div class="user-wrap"> <button class="icon-btn" id="userBtn" aria-label="用户菜单"> <svg viewBox="0 0 24 24"> <circle cx="12" cy="8" r="4"></circle> <path d="M4 21v-1a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v1"></path> </svg> </button> <div class="menu" id="userMenu"> <a href="/ymzz" target="_blank" rel="noopener"> <span class="ico">📤</span> <span>上传代码</span> </a> <a href="/edit/A9wbTSh7?key=RZhauQFPedNJSkLAuGQZ" target="_blank" rel="noopener"> <span class="ico">✏️</span> <span>编辑代码</span> </a> </div> </div> </div> </div> </header> <!-- ==================== 主内容 ==================== --> <div class="wrap"> <h1>链接导航</h1> <p class="sub">点击卡片跳转到对应页面</p> <div class="grid" id="grid"></div> </div> <script> // ============================================================ // ★ 以后添加卡片,只需要在这里加一行: // { name: "显示名称", url: "跳转网址" }, // ============================================================ const cards = [ { name: "广东联通", url: "/edit/AtigHcse?key=SzrJhD7xqCMGTNbyXThr" }, { name: "福建移动", url: "/edit/bbpW2m68?key=ZHCVzRqa36BpD5TEEZoM" }, ]; const grid = document.getElementById('grid'); cards.forEach(function (item) { const a = document.createElement('a'); a.className = 'card'; a.href = item.url; a.target = '_blank'; a.rel = 'noopener'; a.innerHTML = '<span class="name"></span><span class="arrow">→</span>'; a.querySelector('.name').textContent = item.name; grid.appendChild(a); }); // ============================================================ // 主题切换 // ============================================================ (function () { const root = document.documentElement; const btn = document.getElementById('themeBtn'); const icon = document.getElementById('themeIcon'); const SUN = '<circle cx="12" cy="12" r="4"></circle><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"></path>'; const MOON = '<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>'; function getSaved() { try { return localStorage.getItem('theme'); } catch (e) { return null; } } function save(t) { try { localStorage.setItem('theme', t); } catch (e) {} } const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; let current = getSaved() || (prefersDark ? 'dark' : 'light'); function apply(t) { root.setAttribute('data-theme', t); current = t; save(t); icon.innerHTML = (t === 'light') ? MOON : SUN; } apply(current); btn.addEventListener('click', function () { apply(current === 'light' ? 'dark' : 'light'); }); })(); // ============================================================ // 用户菜单 // ============================================================ (function () { const userBtn = document.getElementById('userBtn'); const userMenu = document.getElementById('userMenu'); userBtn.addEventListener('click', function (e) { e.stopPropagation(); userMenu.classList.toggle('show'); }); // 点其他地方关闭 document.addEventListener('click', function (e) { if (!userMenu.contains(e.target) && e.target !== userBtn) { userMenu.classList.remove('show'); } }); // 点菜单项后关闭 userMenu.querySelectorAll('a').forEach(function (a) { a.addEventListener('click', function () { userMenu.classList.remove('show'); }); }); // Esc 关闭 document.addEventListener('keydown', function (e) { if (e.key === 'Escape') userMenu.classList.remove('show'); }); })(); </script> </body> </html>
💾 保存修改
👁 预览效果