add json formatter
This commit is contained in:
16
index.html
16
index.html
@@ -382,6 +382,15 @@
|
||||
<div class="tooltip">颜色选择器</div>
|
||||
</div>
|
||||
|
||||
<div class="tool-item" data-tool="json">
|
||||
<div class="tool-icon">📋</div>
|
||||
<div class="tool-info">
|
||||
<h3>JSON 格式化</h3>
|
||||
<p>JSON 代码格式化、压缩和验证工具</p>
|
||||
</div>
|
||||
<div class="tooltip">JSON 格式化</div>
|
||||
</div>
|
||||
|
||||
<div class="tool-item" data-tool="other">
|
||||
<div class="tool-icon">⚙️</div>
|
||||
<div class="tool-info">
|
||||
@@ -464,6 +473,10 @@
|
||||
title: "颜色选择器",
|
||||
url: "color_pick.html",
|
||||
},
|
||||
json: {
|
||||
title: "JSON 格式化",
|
||||
url: "json_formatter.html",
|
||||
},
|
||||
other: {
|
||||
title: "其他功能",
|
||||
url: "other_function.html",
|
||||
@@ -536,12 +549,13 @@
|
||||
// Ctrl/Cmd + 数字键快速切换工具
|
||||
if (e.ctrlKey || e.metaKey) {
|
||||
const key = parseInt(e.key);
|
||||
if (key >= 1 && key <= 5) {
|
||||
if (key >= 1 && key <= 6) {
|
||||
const toolNames = [
|
||||
"welcome",
|
||||
"calculator",
|
||||
"number",
|
||||
"color",
|
||||
"json",
|
||||
"other",
|
||||
];
|
||||
const toolName = toolNames[key - 1];
|
||||
|
||||
Reference in New Issue
Block a user