Files
html-tools/tools/base64-encode/index.html
T
搜索客 4d18d4236e fix: 1.修复路径错误;
2.取消加载远程资源,修复因onerror的错误写法导致内网使用时无法切换加载本地静态资源的问题

Closes #8
2026-01-05 16:20:01 +08:00

311 lines
8.5 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<link rel="icon" href="../../favicon.svg">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Base64 编码解码 - JustHTMLs</title>
<link rel="canonical" href="https://www.htmls.dev/tools/base64-encode/">
<link rel="stylesheet" href="../../assets/vendor/fontawesome/css/all.min.css">
<style>
:root {
--primary: #f093fb;
--secondary: #f5576c;
--bg: #0f172a;
--bg-card: #1e293b;
--bg-hover: #334155;
--text: #f1f5f9;
--text-muted: #94a3b8;
--border: #334155;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: var(--bg);
color: var(--text);
line-height: 1.6;
min-height: 100vh;
}
.container {
max-width: 900px;
margin: 0 auto;
padding: 0 20px;
}
header {
background: var(--bg-card);
border-bottom: 1px solid var(--border);
padding: 16px 0;
}
.back-link {
display: inline-flex;
align-items: center;
gap: 8px;
color: var(--text-muted);
text-decoration: none;
font-size: 14px;
transition: color 0.2s;
}
.back-link:hover {
color: var(--primary);
}
main {
padding: 40px 0 80px;
}
.tool-header {
text-align: center;
margin-bottom: 40px;
}
.tool-icon-large {
width: 80px;
height: 80px;
border-radius: 20px;
display: flex;
align-items: center;
justify-content: center;
font-size: 40px;
margin: 0 auto 20px;
background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.tool-title {
font-size: 36px;
font-weight: 700;
margin-bottom: 12px;
}
.tool-description {
font-size: 18px;
color: var(--text-muted);
max-width: 600px;
margin: 0 auto;
}
.tool-meta {
display: flex;
align-items: center;
justify-content: center;
gap: 24px;
margin-top: 24px;
font-size: 14px;
color: var(--text-muted);
}
.tool-meta-item {
display: flex;
align-items: center;
gap: 6px;
}
.tool-actions {
display: flex;
align-items: center;
justify-content: center;
gap: 16px;
margin: 30px 0;
}
.btn {
padding: 14px 28px;
border-radius: 10px;
border: none;
cursor: pointer;
font-size: 16px;
font-weight: 500;
text-decoration: none;
display: inline-flex;
align-items: center;
gap: 8px;
transition: all 0.2s;
}
.btn-primary {
background: linear-gradient(135deg, var(--primary), var(--secondary));
color: white;
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(240, 147, 251, 0.4);
}
.btn-secondary {
background: var(--bg-hover);
color: var(--text);
}
.btn-secondary:hover {
background: #475569;
}
.info-section {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 16px;
padding: 30px;
margin: 30px 0;
}
.info-section h2 {
font-size: 20px;
margin-bottom: 16px;
display: flex;
align-items: center;
gap: 10px;
}
.info-section p {
color: var(--text-muted);
line-height: 1.8;
}
.info-section ul {
list-style: none;
margin-top: 16px;
}
.info-section li {
padding: 8px 0;
padding-left: 24px;
position: relative;
color: var(--text-muted);
}
.info-section li::before {
content: '•';
position: absolute;
left: 8px;
color: var(--primary);
}
.tags {
display: flex;
gap: 8px;
flex-wrap: wrap;
margin-top: 20px;
}
.tag {
padding: 6px 12px;
background: var(--bg-hover);
border-radius: 6px;
font-size: 13px;
color: var(--text-muted);
}
footer {
text-align: center;
padding: 40px 0;
color: var(--text-muted);
font-size: 14px;
border-top: 1px solid var(--border);
margin-top: 60px;
}
footer a {
color: var(--text-muted);
text-decoration: none;
}
footer a:hover {
color: var(--primary);
}
</style>
</head>
<body>
<header>
<div class="container">
<a href="../../" class="back-link">
<i class="fas fa-arrow-left"></i>
返回首页
</a>
</div>
</header>
<main class="container">
<div class="tool-header">
<div class="tool-icon-large">🔐</div>
<h1 class="tool-title">Base64 编码解码</h1>
<p class="tool-description">快速进行 Base64 编码和解码,支持文本和文件</p>
<div class="tool-meta">
<div class="tool-meta-item">
<i class="fas fa-user"></i>
<span>JustHTMLs</span>
</div>
<div class="tool-meta-item">
<i class="fas fa-code-branch"></i>
<span>v1.0.0</span>
</div>
<div class="tool-meta-item">
<i class="fas fa-calendar"></i>
<span>2025-12-22</span>
</div>
</div>
</div>
<div class="tool-actions">
<a href="app.html" target="_blank" class="btn btn-primary">
<i class="fas fa-external-link-alt"></i>
打开工具
</a>
<a href="https://github.com/justhtmls/html-tools/tree/main/tools/base64-encode" target="_blank" class="btn btn-secondary">
<i class="fab fa-github"></i>
查看源码
</a>
</div>
<div class="info-section">
<h2><i class="fas fa-info-circle" style="color: var(--primary);"></i> 工具介绍</h2>
<p>Base64 是一种用 64 个字符来表示任意二进制数据的方法。常用于在 HTTP 环境下传递较长的标识信息或编码图片、文件等。</p>
</div>
<div class="info-section">
<h2><i class="fas fa-star" style="color: var(--primary);"></i> 主要功能</h2>
<ul>
<li>实时编码和解码转换</li>
<li>支持 URL 安全模式(替换 +/ 为 -_)</li>
<li>支持拖拽文件进行编码</li>
<li>一键复制结果到剪贴板</li>
<li>完全离线工作,保护隐私</li>
</ul>
</div>
<div class="info-section">
<h2><i class="fas fa-keyboard" style="color: var(--primary);"></i> 使用场景</h2>
<ul>
<li>编码图片用于 Data URL</li>
<li>在 URL 中传递二进制数据</li>
<li>HTTP Basic 认证</li>
<li>邮件附件编码</li>
<li>配置文件中的二进制数据</li>
</ul>
</div>
<div class="tags">
<span class="tag">base64</span>
<span class="tag">encoder</span>
<span class="tag">decoder</span>
<span class="tag">converter</span>
</div>
</main>
<footer>
<p>&copy; 2025 JustHTMLs</p>
</footer>
<script src="../../assets/clicks.js" defer></script>
</body>
</html>