- 首页:hero(标题/副文案/两个行动按钮)→ 搜索框前置 → 最近使用 → 按类别浏览(14 类磁贴)→ 完整工具目录
- 补齐 27 个缺失的 SVG symbol(i-edit/i-monitor/i-book/i-file/i-grid/i-abc/i-users/i-star/i-music/i-info/i-table/i-keyboard/i-mouse/i-type/i-diff/i-print/i-id/i-phone/i-mail/i-archive/i-cookie/i-braces/i-database/i-link/i-minimize/i-filter/i-lock)
- 修 icon('i-lock') 双前缀导致图标失效(app.js / admin.js)
- 补 --muted/--text/--brand/--panel-2 四个未定义 CSS 变量别名,跟随主题切换
- 修 server.mjs 在 Windows 下 path.normalize 返回反斜杠导致 /js/*.js、/css/*.css 全 404
- 收藏按钮不再重建工具页(避免重复扣积分)
232 lines
15 KiB
HTML
232 lines
15 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
||
<meta name="color-scheme" content="dark light" />
|
||
<meta name="theme-color" content="#070a11" />
|
||
<title>DevBox · 开发者工具箱</title>
|
||
<meta name="description" content="纯前端开发者工具箱:图片转换、哈希、AES、JWT、时间戳、JSON、正则、Diff、颜色、CIDR……离线可用。" />
|
||
<link rel="stylesheet" href="css/style.css" />
|
||
<script>
|
||
(() => {
|
||
try {
|
||
const saved = localStorage.getItem('devbox.theme')
|
||
const auto = matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark'
|
||
document.documentElement.dataset.theme = saved || auto
|
||
} catch { document.documentElement.dataset.theme = 'dark' }
|
||
})()
|
||
</script>
|
||
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%235b8cff'/%3E%3Cpath d='M20 22h24M20 32h16M20 42h20' stroke='white' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E" />
|
||
</head>
|
||
<body>
|
||
<svg class="sprite" aria-hidden="true">
|
||
<defs>
|
||
<symbol id="i-box" viewBox="0 0 24 24"><path d="M3 7.5 12 3l9 4.5v9L12 21l-9-4.5z"/><path d="M3 7.5 12 12l9-4.5M12 12v9"/></symbol>
|
||
<symbol id="i-image" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="2"/><circle cx="8.5" cy="9.5" r="1.5"/><path d="m4 17 5-5 4 4 3-3 4 4"/></symbol>
|
||
<symbol id="i-code" viewBox="0 0 24 24"><path d="m9 7-5 5 5 5M15 7l5 5-5 5"/></symbol>
|
||
<symbol id="i-hash" viewBox="0 0 24 24"><path d="M9 3 7 21M17 3l-2 18M4 8h17M3 16h17"/></symbol>
|
||
<symbol id="i-lock" viewBox="0 0 24 24"><rect x="4" y="10" width="16" height="11" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></symbol>
|
||
<symbol id="i-key" viewBox="0 0 24 24"><circle cx="8" cy="8" r="4"/><path d="m11 11 9 9M17 17l2-2M14 14l2-2"/></symbol>
|
||
<symbol id="i-clock" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></symbol>
|
||
<symbol id="i-calendar" viewBox="0 0 24 24"><rect x="3" y="5" width="18" height="16" rx="2"/><path d="M8 3v4M16 3v4M3 10h18"/></symbol>
|
||
<symbol id="i-text" viewBox="0 0 24 24"><path d="M4 6h16M4 12h10M4 18h13"/></symbol>
|
||
<symbol id="i-palette" viewBox="0 0 24 24"><path d="M12 21a9 9 0 1 1 9-9c0 2.5-2 3-3.5 3H16a2 2 0 0 0-1 3.7c.4.7-.2 2.3-3 2.3Z"/><circle cx="8" cy="10" r="1"/><circle cx="12" cy="7.5" r="1"/><circle cx="16" cy="10" r="1"/></symbol>
|
||
<symbol id="i-globe" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3c2.5 3 2.5 15 0 18M12 3c-2.5 3-2.5 15 0 18"/></symbol>
|
||
<symbol id="i-terminal" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="m7 9 3 3-3 3M13 15h4"/></symbol>
|
||
<symbol id="i-shield" viewBox="0 0 24 24"><path d="M12 3 5 6v6c0 4.5 3 8 7 9 4-1 7-4.5 7-9V6z"/><path d="m9 12 2 2 4-4"/></symbol>
|
||
<symbol id="i-ruler" viewBox="0 0 24 24"><rect x="2" y="8" width="20" height="8" rx="2"/><path d="M6 8v3M10 8v5M14 8v3M18 8v5"/></symbol>
|
||
<symbol id="i-search" viewBox="0 0 24 24"><circle cx="11" cy="11" r="7"/><path d="m20 20-4-4"/></symbol>
|
||
<symbol id="i-copy" viewBox="0 0 24 24"><rect x="9" y="9" width="12" height="12" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></symbol>
|
||
<symbol id="i-check" viewBox="0 0 24 24"><path d="m5 13 4 4L19 7"/></symbol>
|
||
<symbol id="i-trash" viewBox="0 0 24 24"><path d="M4 7h16M9 7V5h6v2M6 7l1 13h10l1-13"/></symbol>
|
||
<symbol id="i-menu" viewBox="0 0 24 24"><path d="M4 7h16M4 12h16M4 17h16"/></symbol>
|
||
<symbol id="i-close" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></symbol>
|
||
<symbol id="i-download" viewBox="0 0 24 24"><path d="M12 3v12m0 0 4-4m-4 4-4-4M4 19h16"/></symbol>
|
||
<symbol id="i-upload" viewBox="0 0 24 24"><path d="M12 21V9m0 0 4 4m-4-4-4 4M4 5h16"/></symbol>
|
||
<symbol id="i-swap" viewBox="0 0 24 24"><path d="M4 8h13l-3-3M20 16H7l3 3"/></symbol>
|
||
<symbol id="i-bolt" viewBox="0 0 24 24"><path d="M13 2 4 14h6l-1 8 9-12h-6z"/></symbol>
|
||
<symbol id="i-moon" viewBox="0 0 24 24"><path d="M20 14.5A8.5 8.5 0 0 1 9.5 4a8.5 8.5 0 1 0 10.5 10.5Z"/></symbol>
|
||
<symbol id="i-sun" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M19.1 4.9l-1.4 1.4M6.3 17.7l-1.4 1.4"/></symbol>
|
||
<symbol id="i-mono" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 3v18" /><path d="M12 3a9 9 0 0 1 0 18" fill="currentColor" stroke="none"/></symbol>
|
||
<!-- 工具分类用到的图标 -->
|
||
<symbol id="i-edit" viewBox="0 0 24 24"><path d="M4 20h4l10-10-4-4L4 16z"/><path d="m14 6 4 4"/></symbol>
|
||
<symbol id="i-monitor" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="12" rx="2"/><path d="M9 20h6M12 16v4"/></symbol>
|
||
<symbol id="i-book" viewBox="0 0 24 24"><path d="M5 4h9a3 3 0 0 1 3 3v13H8a3 3 0 0 1-3-3z"/><path d="M17 7h2v13H8"/></symbol>
|
||
<symbol id="i-file" viewBox="0 0 24 24"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/></symbol>
|
||
<symbol id="i-grid" viewBox="0 0 24 24"><rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/></symbol>
|
||
<symbol id="i-abc" viewBox="0 0 24 24"><path d="M3 17 6.5 7 10 17M4.4 14h4.2"/><path d="M13 17V7h3a3 3 0 0 1 0 6h-3"/><path d="M20 11h-2a2 2 0 0 0 0 4h2"/></symbol>
|
||
<symbol id="i-users" viewBox="0 0 24 24"><circle cx="9" cy="8" r="3.2"/><path d="M3.5 19a5.5 5.5 0 0 1 11 0"/><path d="M16 6.2a3 3 0 0 1 0 5.6M17.5 19a5 5 0 0 0-2.2-4.1"/></symbol>
|
||
<symbol id="i-star" viewBox="0 0 24 24"><path d="m12 3.5 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17.6l-5.4 2.8 1-6.1L3.2 10l6.1-.9z"/></symbol>
|
||
<symbol id="i-music" viewBox="0 0 24 24"><circle cx="7" cy="18" r="2.6"/><circle cx="18" cy="16" r="2.6"/><path d="M9.6 18V7l10.6-2v11"/></symbol>
|
||
<symbol id="i-info" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 11v6M12 7.6v.2"/></symbol>
|
||
<symbol id="i-table" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M3 10h18M9 10v10M15 10v10"/></symbol>
|
||
<symbol id="i-keyboard" viewBox="0 0 24 24"><rect x="2" y="6" width="20" height="12" rx="2"/><path d="M6 10h.2M10 10h.2M14 10h.2M18 10h.2M7 14h10"/></symbol>
|
||
<symbol id="i-mouse" viewBox="0 0 24 24"><rect x="6" y="3" width="12" height="18" rx="6"/><path d="M12 7v3"/></symbol>
|
||
<symbol id="i-type" viewBox="0 0 24 24"><path d="M4 6h16M9 6v13M15 6v13M12 19h6"/></symbol>
|
||
<symbol id="i-diff" viewBox="0 0 24 24"><path d="M6 4v16M18 4v16M6 9h5M6 15h5M13 12h5"/></symbol>
|
||
<symbol id="i-print" viewBox="0 0 24 24"><path d="M7 8V4h10v4"/><rect x="3" y="8" width="18" height="8" rx="2"/><path d="M7 16h10v4H7z"/></symbol>
|
||
<symbol id="i-id" viewBox="0 0 24 24"><rect x="2" y="5" width="20" height="14" rx="2"/><circle cx="8" cy="12" r="2.2"/><path d="M13 10h6M13 14h4M5 16a3 3 0 0 1 6 0"/></symbol>
|
||
<symbol id="i-phone" viewBox="0 0 24 24"><rect x="7" y="2" width="10" height="20" rx="2.5"/><path d="M11 18.5h2"/></symbol>
|
||
<symbol id="i-mail" viewBox="0 0 24 24"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="m3.5 7 8.5 6 8.5-6"/></symbol>
|
||
<symbol id="i-archive" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="5" rx="1.5"/><path d="M5 9v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9"/><path d="M10 13h4"/></symbol>
|
||
<symbol id="i-cookie" viewBox="0 0 24 24"><path d="M21 12.5A9 9 0 1 1 11.5 3a3.5 3.5 0 0 0 4.5 4.5 3.5 3.5 0 0 0 5 5Z"/><path d="M8.5 9.5h.2M9 15h.2M14 13.5h.2"/></symbol>
|
||
<symbol id="i-braces" viewBox="0 0 24 24"><path d="M8 3.5c-2 0-2.5 1.2-2.5 3v2c0 1.5-.6 2.5-2 2.5 1.4 0 2 1 2 2.5v2c0 1.8.5 3 2.5 3"/><path d="M16 3.5c2 0 2.5 1.2 2.5 3v2c0 1.5.6 2.5 2 2.5-1.4 0-2 1-2 2.5v2c0 1.8-.5 3-2.5 3"/></symbol>
|
||
<symbol id="i-database" viewBox="0 0 24 24"><ellipse cx="12" cy="6" rx="8" ry="3"/><path d="M4 6v6c0 1.7 3.6 3 8 3s8-1.3 8-3V6"/><path d="M4 12v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6"/></symbol>
|
||
<symbol id="i-link" viewBox="0 0 24 24"><path d="M10 13.5a4 4 0 0 0 5.7 0l2.8-2.8a4 4 0 0 0-5.7-5.7L11.5 6.3"/><path d="M14 10.5a4 4 0 0 0-5.7 0L5.5 13.3a4 4 0 0 0 5.7 5.7l1.3-1.3"/></symbol>
|
||
<symbol id="i-minimize" viewBox="0 0 24 24"><path d="M5 12h14"/></symbol>
|
||
<symbol id="i-filter" viewBox="0 0 24 24"><path d="M3 5h18l-7 8v6l-4-2v-4z"/></symbol>
|
||
<symbol id="i-lock" viewBox="0 0 24 24"><rect x="4" y="10" width="16" height="11" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></symbol>
|
||
</defs>
|
||
</svg>
|
||
|
||
<div class="auth" id="auth" hidden>
|
||
<div class="auth-card">
|
||
<div class="auth-brand">
|
||
<div class="brand-mark"><svg><use href="#i-box"/></svg></div>
|
||
<div><strong>DevBox</strong><span>开发者工具箱</span></div>
|
||
</div>
|
||
<div class="auth-tabs">
|
||
<button class="auth-tab active" data-mode="login">登录</button>
|
||
<button class="auth-tab" data-mode="register">注册</button>
|
||
</div>
|
||
<form id="authForm" autocomplete="on">
|
||
<label class="field"><span>用户名</span><input id="authUser" name="username" autocomplete="username" placeholder="3–20 位,字母/数字/汉字" /></label>
|
||
<label class="field" id="authPass2Wrap" hidden><span>确认密码</span><input id="authPass2" type="password" autocomplete="new-password" placeholder="再输一次" /></label>
|
||
<label class="field"><span>密码</span><input id="authPass" type="password" name="password" autocomplete="current-password" placeholder="至少 6 位" /></label>
|
||
<div class="auth-msg" id="authMsg"></div>
|
||
<button class="btn primary block" id="authSubmit">登录</button>
|
||
<p class="auth-hint" id="authHint">第一次来?点上面的「注册」,第一个注册的账号会自动成为管理员。</p>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="app">
|
||
<aside class="sidebar" id="sidebar">
|
||
<div class="brand">
|
||
<div class="brand-mark"><svg><use href="#i-box"/></svg></div>
|
||
<div class="brand-text">
|
||
<strong>DevBox</strong>
|
||
<span>开发者工具箱</span>
|
||
</div>
|
||
<button class="icon-btn only-mobile" id="closeNav" aria-label="关闭菜单"><svg><use href="#i-close"/></svg></button>
|
||
</div>
|
||
|
||
<div class="search">
|
||
<svg class="search-ico"><use href="#i-search"/></svg>
|
||
<input id="navSearch" type="search" placeholder="搜工具:哈希 / json / 颜色…" autocomplete="off" />
|
||
<kbd>⌘K</kbd>
|
||
</div>
|
||
|
||
<nav class="nav" id="nav"></nav>
|
||
|
||
<div class="side-foot">
|
||
<div class="tip">
|
||
<svg><use href="#i-bolt"/></svg>
|
||
<span>每次用工具扣 1 积分</span>
|
||
</div>
|
||
<div class="side-links">
|
||
<a href="#/about">关于</a>
|
||
<span>·</span>
|
||
<a href="http://110.42.217.133:3000/gitea/devbox" target="_blank" rel="noopener">源码</a>
|
||
</div>
|
||
</div>
|
||
</aside>
|
||
|
||
<div class="scrim" id="scrim"></div>
|
||
|
||
<main class="main">
|
||
<header class="topbar">
|
||
<button class="icon-btn only-mobile" id="openNav" aria-label="打开菜单"><svg><use href="#i-menu"/></svg></button>
|
||
<div class="crumb" id="crumb">工具箱</div>
|
||
<div class="top-right">
|
||
<button class="icon-btn only-mobile" id="themeCycle" aria-label="切换主题" title="切换主题"><svg><use href="#i-moon"/></svg></button>
|
||
<div class="theme-switch" id="themeSwitch" role="group" aria-label="主题">
|
||
<button type="button" data-theme="dark" title="深色" aria-pressed="true"><svg><use href="#i-moon"/></svg></button>
|
||
<button type="button" data-theme="light" title="浅色" aria-pressed="false"><svg><use href="#i-sun"/></svg></button>
|
||
<button type="button" data-theme="mono" title="黑白" aria-pressed="false"><svg><use href="#i-mono"/></svg></button>
|
||
</div>
|
||
<button class="ghost-btn" id="paletteBtn">
|
||
<svg><use href="#i-search"/></svg><span>快速查找</span><kbd>⌘K</kbd>
|
||
</button>
|
||
<div class="who" id="who" hidden>
|
||
<button class="credit-chip" id="creditBtn" title="兑换 CDK"><span>积分</span><b id="creditNum">0</b></button>
|
||
<button class="ghost-btn admin-btn" id="adminBtn" hidden>后台</button>
|
||
<button class="ghost-btn user-btn" id="userBtn"><i class="avatar-dot"></i><span id="userName"></span><em id="userDot"></em></button>
|
||
</div>
|
||
</div>
|
||
</header>
|
||
|
||
<div class="scroll" id="view"></div>
|
||
</main>
|
||
</div>
|
||
|
||
<div class="palette" id="palette" hidden>
|
||
<div class="palette-box">
|
||
<div class="palette-input">
|
||
<svg><use href="#i-search"/></svg>
|
||
<input id="paletteInput" placeholder="输入工具名、拼音首字母或关键词…" autocomplete="off" />
|
||
<kbd>esc</kbd>
|
||
</div>
|
||
<div class="palette-list" id="paletteList"></div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="sheet" id="sheet" hidden>
|
||
<div class="sheet-card">
|
||
<button class="sheet-x" data-close aria-label="关闭"><svg><use href="#i-close"/></svg></button>
|
||
<div id="sheetBody"></div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="toasts" id="toasts"></div>
|
||
|
||
<script src="js/util.js"></script>
|
||
<script src="js/theme.js"></script>
|
||
<script src="js/auth.js"></script>
|
||
<script src="js/qq-group.js"></script>
|
||
<script src="js/vendor/qrcode.js"></script>
|
||
<script src="js/vendor/bcrypt.js"></script>
|
||
<script src="js/vendor/marked.js"></script>
|
||
<script src="js/lib-simple.js"></script>
|
||
<script src="js/cat-text.js"></script>
|
||
<script src="js/cat-encode.js"></script>
|
||
<script src="js/cat-convert.js"></script>
|
||
<script src="js/cat-random.js"></script>
|
||
<script src="js/cat-dev.js"></script>
|
||
<script src="js/cat-css.js"></script>
|
||
<script src="js/cat-device.js"></script>
|
||
<script src="js/cat-office.js"></script>
|
||
<script src="js/cat-life.js"></script>
|
||
<script src="js/cat-time2.js"></script>
|
||
<script src="js/cat-code.js"></script>
|
||
<script src="js/cat-fun.js"></script>
|
||
<script src="js/cat-file.js"></script>
|
||
<script src="js/cat-check2.js"></script>
|
||
<script src="js/cat-zh.js"></script>
|
||
<script src="js/cat-gen.js"></script>
|
||
<script src="js/cat-zip.js"></script>
|
||
<script src="js/cat-misc2.js"></script>
|
||
<script src="js/cat-net.js"></script>
|
||
<script src="js/cat-final.js"></script>
|
||
<script src="js/cat-timers.js"></script>
|
||
<script src="js/cat-board.js"></script>
|
||
<script src="js/cat-misc.js"></script>
|
||
<script src="js/tools-text.js"></script>
|
||
<script src="js/tools-crypto.js"></script>
|
||
<script src="js/tools-time.js"></script>
|
||
<script src="js/tools-image.js"></script>
|
||
<script src="js/tools-web.js"></script>
|
||
<script src="js/tools-extra.js"></script>
|
||
<script src="js/tools-format.js"></script>
|
||
<script src="js/tools-codec-extra.js"></script>
|
||
<script src="js/tools-crypto-extra.js"></script>
|
||
<script src="js/tools-image-extra.js"></script>
|
||
<script src="js/tools-life.js"></script>
|
||
<script src="js/tools-text-extra.js"></script>
|
||
<script src="js/tools-creator.js"></script>
|
||
<script src="js/app.js"></script>
|
||
<script src="js/admin.js"></script>
|
||
</body>
|
||
</html>
|