-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
180 lines (173 loc) · 8.42 KB
/
index.html
File metadata and controls
180 lines (173 loc) · 8.42 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JSON Formatter - Free JSON Formatting Tool</title>
<link rel="icon" type="image/x-icon" href="favicon/favicon.ico">
<link rel="icon" type="image/png" sizes="32x32" href="favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon/favicon-16x16.png">
<link rel="apple-touch-icon" sizes="180x180" href="favicon/apple-touch-icon.png">
<link rel="manifest" href="favicon/site.webmanifest">
<link rel="stylesheet" href="styles.css">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
</head>
<body>
<div class="container">
<header class="header">
<h1><i class="fas fa-code"></i> JSON Formatter</h1>
<p>Free JSON formatting and validation tool</p>
</header>
<div class="main-content">
<div class="input-section">
<div class="section-header">
<h2><i class="fas fa-edit"></i> Input JSON</h2>
<div class="actions">
<button id="example-btn" class="btn btn-orange">
<i class="fas fa-lightbulb"></i> Example
</button>
</div>
</div>
<div class="actions">
<button id="clear-btn" class="btn btn-danger">
<i class="fas fa-trash"></i> Clear
</button>
<button id="url-btn" class="btn btn-info">
<i class="fas fa-link"></i> Load URL
</button>
<button id="upload-btn" class="btn btn-teal">
<i class="fas fa-upload"></i> Upload File
</button>
<input type="file" id="file-input" accept=".json" style="display: none;">
</div>
<textarea id="input-json" placeholder="Enter your JSON here..."></textarea>
<div class="error-message" id="error-message"></div>
</div>
<div class="controls">
<div class="format-options">
<label class="checkbox-container">
<input type="checkbox" id="sort-keys">
<span class="checkmark"></span>
Sort keys
</label>
<div class="indent-options">
<label for="indent-select">Indent:</label>
<select id="indent-select">
<option value="2">2 spaces</option>
<option value="3">3 spaces</option>
<option value="4">4 spaces</option>
<option value="tab">Tab</option>
</select>
</div>
<div class="validation-options">
<label for="standard-select">Standard:</label>
<select id="standard-select">
<option value="rfc8259">RFC 8259</option>
<option value="rfc7159">RFC 7159</option>
<option value="rfc4627">RFC 4627</option>
<option value="ecma404">ECMA-404</option>
</select>
</div>
<label class="checkbox-container">
<input type="checkbox" id="auto-fix">
<span class="checkmark"></span>
Auto-fix errors
</label>
</div>
<div class="format-buttons">
<button id="format-btn" class="btn btn-primary">
<i class="fas fa-magic"></i> Format JSON
</button>
<button id="minify-btn" class="btn btn-purple">
<i class="fas fa-compress"></i> Minify
</button>
<button id="validate-btn" class="btn btn-warning">
<i class="fas fa-check-circle"></i> Validate
</button>
</div>
</div>
<div class="output-section">
<div class="section-header">
<h2><i class="fas fa-file-code"></i> Output</h2>
<div class="actions">
<button id="copy-btn" class="btn btn-success">
<i class="fas fa-copy"></i> Copy
</button>
<button id="download-btn" class="btn btn-info">
<i class="fas fa-download"></i> Download
</button>
<button id="tree-view-btn" class="btn btn-purple">
<i class="fas fa-sitemap"></i> Tree View
</button>
</div>
</div>
<div class="search-container">
<input type="text" id="search-input" placeholder="Search in JSON..." class="search-input">
<button id="search-btn" class="btn btn-secondary">
<i class="fas fa-search"></i>
</button>
</div>
<div class="output-container">
<pre id="output-json"><code>Results will appear here...</code></pre>
</div>
<div class="stats-container" id="stats-container" style="display: none;">
<div class="stat-item">
<span class="stat-label">Size:</span>
<span class="stat-value" id="size-stat">-</span>
</div>
<div class="stat-item">
<span class="stat-label">Depth:</span>
<span class="stat-value" id="depth-stat">-</span>
</div>
<div class="stat-item">
<span class="stat-label">Keys:</span>
<span class="stat-value" id="keys-stat">-</span>
</div>
<div class="stat-item">
<span class="stat-label">Arrays:</span>
<span class="stat-value" id="arrays-stat">-</span>
</div>
</div>
</div>
</div>
<footer class="footer">
<p>Created by <strong>JSON Formatter</strong> - Free tool to format and validate JSON</p>
<div class="features">
<span><i class="fas fa-check"></i> Format JSON</span>
<span><i class="fas fa-check"></i> Validate JSON</span>
<span><i class="fas fa-check"></i> Minify JSON</span>
<span><i class="fas fa-check"></i> Auto-fix Errors</span>
<span><i class="fas fa-check"></i> Tree View</span>
<span><i class="fas fa-check"></i> Search & Filter</span>
<span><i class="fas fa-check"></i> URL Loading</span>
<span><i class="fas fa-check"></i> File Upload</span>
<span><i class="fas fa-check"></i> Statistics</span>
</div>
</footer>
</div>
<!-- Toast Container -->
<div id="toast-container" class="toast-container"></div>
<!-- URL Modal -->
<div id="url-modal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h3><i class="fas fa-link"></i> Load JSON from URL</h3>
<button class="modal-close" id="url-modal-close">
<i class="fas fa-times"></i>
</button>
</div>
<div class="modal-body">
<input type="url" id="url-input" placeholder="Enter JSON URL..." class="url-input">
<div class="modal-actions">
<button id="load-url-btn" class="btn btn-primary">
<i class="fas fa-download"></i> Load JSON
</button>
<button id="cancel-url-btn" class="btn btn-secondary">Cancel</button>
</div>
</div>
</div>
</div>
<script src="script.js"></script>
</body>
</html>