-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
212 lines (196 loc) · 7.18 KB
/
index.html
File metadata and controls
212 lines (196 loc) · 7.18 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!DOCTYPE html>
<html lang="en" class="dark">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, height=device-height, initial-scale=1 user-scalable=no, shrink-to-fit=no"
/>
<title>JSON Formatter</title>
<!-- Tailwind via CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=Inter:wght@400;600;800&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="style.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/emoji-js@3.6.0/lib/emoji.min.js"></script>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css"
crossorigin
/>
<link rel="shortcut icon" href="logo.png" type="image/x-icon" />
<meta name="title" content="JSON Formatter" />
<meta
name="description"
content="A clean, responsive, and modern JSON Formatter. Paste unformatted JSON, format it with syntax highlighting, copy the result, or clear the editor."
/>
<meta name="keywords" content="json formatter, formatter, json, syntax" />
<meta
name="image"
content="https://harsh98trivedi.github.io/JSON-Formatter/meta.jpg"
/>
<!-- Open Graph general (Facebook, Pinterest) -->
<meta name="og:title" content="JSON Formatter" />
<meta
name="og:description"
content="A clean, responsive, and modern JSON Formatter. Paste unformatted JSON, format it with syntax highlighting, copy the result, or clear the editor."
/>
<meta
name="og:image"
content="https://harsh98trivedi.github.io/JSON-Formatter/meta.jpg"
/>
<meta name="og:image:alt" content="JSON Formatter" />
<meta name="og:site_name" content="JSON Formatter" />
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="JSON Formatter" />
<meta
name="twitter:description"
content="A clean, responsive, and modern JSON Formatter. Paste unformatted JSON, format it with syntax highlighting, copy the result, or clear the editor."
/>
<meta
name="twitter:image:src"
content="https://harsh98trivedi.github.io/JSON-Formatter/meta.jpg"
/>
<!-- Search Engine -->
<meta
name="description"
content="A clean, responsive, and modern JSON Formatter. Paste unformatted JSON, format it with syntax highlighting, copy the result, or clear the editor."
/>
<meta
name="image"
content="https://harsh98trivedi.github.io/JSON-Formatter/meta.jpg"
/>
<!-- Schema.org for Google -->
<meta itemprop="name" content="JSON Formatter" />
<meta
itemprop="description"
content="A clean, responsive, and modern JSON Formatter. Paste unformatted JSON, format it with syntax highlighting, copy the result, or clear the editor."
/>
<meta
itemprop="image"
content="https://harsh98trivedi.github.io/JSON-Formatter/meta.jpg"
/>
<meta name="revisit-after" content="30 days" />
<!-- Google tag (gtag.js) -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-45C37D3GB5"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "G-45C37D3GB5");
</script>
</head>
<body class="select-none">
<div class="wrap">
<header class="header my-5">
<h1>JSON Formatter</h1>
<p>Fast, minimal, smooth — even for large files.</p>
</header>
<!-- INPUT -->
<section class="card">
<div class="card-head">
<label for="json-input" class="label">Input</label>
<div class="tools">
<input
type="file"
id="file-input"
accept=".json,application/json"
hidden
/>
<button id="btn-file" class="btn">📁 Load File</button>
<button id="btn-url" class="btn">🌐 Load URL</button>
<button id="btn-clear" class="btn danger">🗑️ Clear</button>
</div>
</div>
<textarea
id="json-input"
class="box scrollable"
placeholder="Paste JSON here, or load from a file/URL..."
></textarea>
<div class="row-info">
<span id="input-stats"></span>
<span id="source-info" class="truncate"></span>
</div>
</section>
<!-- ACTIONS -->
<section class="actions">
<button id="btn-format" class="cta">⚡ Format JSON</button>
<button id="btn-cancel" class="btn danger hidden">❌ Cancel</button>
</section>
<!-- OUTPUT -->
<section class="card">
<div class="card-head">
<label class="label">Formatted Output</label>
<div class="tools">
<div class="tools">
<button id="btn-copy" class="btn primary" disabled>
📋 Copy
</button>
<button id="btn-download" class="btn" disabled>
⬇️ Download JSON
</button>
</div>
</div>
</div>
<div class="out-shell box">
<div id="progress" class="overlay hidden">
<div class="meter"><div id="bar" class="fill"></div></div>
<div id="stage" class="stage">Preparing…</div>
<div id="detail" class="detail"></div>
<button id="btn-cancel-overlay" class="btn danger sm">
Cancel
</button>
</div>
<pre id="json-output" class="scrollable pre"></pre>
</div>
</section>
<footer
class="w-full text-center text-base text-gray-400 my-2.5 select-none"
>
Made with
<i
class="fa-solid fa-heart"
aria-label="love"
style="color: #c00; vertical-align: middle"
></i>
by
<a
href="https://harsh98trivedi.github.io"
class="underline"
target="_blank"
rel="noopener noreferrer"
>Harsh Trivedi</a
>
</footer>
</div>
<!-- URL Modal -->
<div id="modal" class="modal hidden">
<div class="dialog">
<h3>🌐 Load JSON from URL</h3>
<input
id="url-input"
type="url"
placeholder="https://example.com/data.json"
/>
<div class="dialog-actions">
<button id="url-load" class="btn primary">Load</button>
<button id="url-cancel" class="btn">Cancel</button>
</div>
</div>
</div>
<!-- Toast -->
<div id="toast" class="toast">Message</div>
<script type="module" src="script.js"></script>
</body>
</html>