Files
devbox/index.html
T
2026-11-18 02:00:57 +08:00

168 lines
9.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!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>
</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">
<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/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/app.js"></script>
<script src="js/admin.js"></script>
</body>
</html>