-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
68 lines (62 loc) · 3.4 KB
/
index.html
File metadata and controls
68 lines (62 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Lightweight JSON file viewer and validator">
<meta name="theme-color" content="#0d1117">
<title>JSON Viewer</title>
<link rel="manifest" href="manifest.json">
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect width='100' height='100' rx='20' fill='%23238636'/%3E%3Ctext x='50' y='65' font-size='40' text-anchor='middle' fill='white' font-family='monospace' font-weight='bold'%3E%7B%7D%3C/text%3E%3C/svg%3E">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<main class="container">
<header>
<div class="header-left">
<h1>🔧 JSON Viewer</h1>
<div id="fileInfo" class="file-info" style="display: none;">
<span id="fileName"></span>
<span id="fileSize"></span>
<span id="validation" class="validation" aria-live="polite"></span>
</div>
</div>
<div class="controls">
<button id="openFile" class="btn" aria-label="Open JSON file">Open File</button>
<button id="toggleView" class="btn" style="display: none;">Raw View</button>
<button id="collapseAll" class="btn" style="display: none;">Collapse All</button>
<button id="expandAll" class="btn" style="display: none;">Expand All</button>
<button id="toggleTheme" class="btn" aria-label="Toggle dark/light theme">🌓</button>
</div>
</header>
<div id="dropZone" class="drop-zone" role="region" aria-label="File drop zone">
<div class="drop-zone-content">
<svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
<polyline points="14 2 14 8 20 8"></polyline>
<circle cx="10" cy="13" r="2"></circle>
<path d="M14 13h2"></path>
</svg>
<p>Drop a JSON file here or click "Open File"</p>
<p class="hint">Or paste JSON directly into the viewer</p>
</div>
</div>
<div id="viewerContainer" style="display: none;">
<div class="toolbar">
<div class="search-box" role="search">
<input type="text" id="searchInput" placeholder="Search keys and values..." aria-label="Search keys and values" />
<button id="clearSearch" class="btn-icon" aria-label="Clear search">✕</button>
</div>
<div class="stats" id="statsContainer" aria-live="polite"></div>
</div>
<div id="treeView" class="tree-view" role="tree" aria-label="JSON tree"></div>
<div id="rawView" class="raw-view" style="display: none;">
<pre><code id="rawContent"></code></pre>
</div>
</div>
</main>
<input type="file" id="fileInput" accept=".json" style="display: none;" aria-label="Select JSON file">
<div id="toast" class="toast" role="status" aria-live="polite"></div>
<script src="app.js"></script>
</body>
</html>