-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
245 lines (231 loc) · 12.9 KB
/
Copy pathindex.html
File metadata and controls
245 lines (231 loc) · 12.9 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Diff</title>
<link rel="icon" href="icons/favicon.svg" type="image/svg+xml" />
<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=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="design/Main.css" />
<script type="module" src="source/Main.js"></script>
</head>
<body class="light-mode is-editing">
<script>
// The mode is taken before anything is drawn, so a page that opens
// dark does not open with a flash of light
(() => {
const mode = localStorage.getItem("mode") || "system";
const isDark = mode === "dark" || (mode === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches);
document.body.classList.toggle("dark-mode", isDark);
document.body.classList.toggle("light-mode", !isDark);
})();
</script>
<header class="header">
<div class="header-logo" data-tip="Go to another tool" data-tip-bottom aria-label="Go to another tool">
<i class="svg-icon"></i>
</div>
<h1 data-action="open-history" data-tip="Open the history" data-tip-bottom aria-label="Open the history">
<span>Diff</span>
<i class="arrow header-caret"></i>
</h1>
<div class="header-status"></div>
</header>
<main class="main">
<section class="inputs">
<article class="input" data-side="old">
<header>
<div class="input-title">Old</div>
<div class="input-name"></div>
<div class="input-kind">JSON</div>
<button class="btn btn-tiny input-clear" data-action="clear-file">Clear</button>
<button class="btn btn-tiny" data-action="upload-file">Upload</button>
</header>
<textarea name="old" placeholder="Paste the old file here, or drop it" spellcheck="false"></textarea>
<div class="input-drop">
<div class="input-drop-box"></div>
<p>Drop the file here</p>
</div>
</article>
<article class="input" data-side="new">
<header>
<div class="input-title">New</div>
<div class="input-name"></div>
<div class="input-kind">JSON</div>
<button class="btn btn-tiny input-clear" data-action="clear-file">Clear</button>
<button class="btn btn-tiny" data-action="upload-file">Upload</button>
</header>
<textarea name="new" placeholder="Paste the new file here, or drop it" spellcheck="false"></textarea>
<div class="input-drop">
<div class="input-drop-box"></div>
<p>Drop the file here</p>
</div>
</article>
</section>
<section class="result">
<div class="result-scroll"></div>
<div class="result-map"></div>
<div class="result-hscroll"><div></div></div>
<div class="result-empty">
<div class="result-empty-box"></div>
<div>
<h2>The files are the same</h2>
<p>Nothing changed between them, as they are compared.</p>
</div>
</div>
</section>
</main>
<div class="top">
<ol class="steps">
<li class="steps-prev" data-action="prev-change" data-tip="The change before" data-tip-bottom aria-label="The change before">
<i class="arrow"></i>
</li>
<li class="steps-count">–/0</li>
<li class="steps-next" data-action="next-change" data-tip="The next change" data-tip-bottom aria-label="The next change">
<i class="arrow"></i>
</li>
</ol>
<ol class="icons">
<li class="icon-copy" data-action="copy-patch" data-tip="Copy the changes as a patch" data-tip-bottom aria-label="Copy the changes as a patch">
<i class="svg-icon"></i>
</li>
<li class="icon-swap" data-action="swap-files" data-tip="Swap the files" data-tip-bottom aria-label="Swap the files">
<i class="svg-icon"></i>
</li>
<li class="icon-settings" data-action="open-settings" data-tip="Settings" data-tip-bottom aria-label="Settings">
<i class="svg-icon"></i>
</li>
</ol>
<ol class="mode">
<li class="mode-light selected" data-action="mode-light" data-tip="Light mode" data-tip-bottom aria-label="Light mode">
<i class="svg-icon"></i>
</li>
<li class="mode-system" data-action="mode-system" data-tip="Follow the system" data-tip-bottom aria-label="Follow the system">
<i class="svg-icon"></i>
</li>
<li class="mode-dark" data-action="mode-dark" data-tip="Dark mode" data-tip-bottom aria-label="Dark mode">
<i class="svg-icon"></i>
</li>
</ol>
</div>
<aside class="bar">
<div class="bar-group bar-edit">
<button class="bar-toggle" data-action="load-example" data-tip="Put two files in to see it at work" data-tip-bottom aria-label="Put two files in to see it at work">Example</button>
</div>
<div class="bar-group bar-result">
<nav class="tabs">
<span class="tabs-mark"></span>
<a href="#" class="selected" data-action="set-layout" data-layout="split">Side by side</a>
<a href="#" data-action="set-layout" data-layout="unified">Unified</a>
<a href="#" data-action="set-layout" data-layout="tree">Structure</a>
</nav>
<i class="bar-line"></i>
<button class="bar-toggle bar-wrap" data-action="toggle-wrap" data-tip-bottom>Wrap</button>
<button class="bar-toggle bar-unfold" data-action="toggle-fold" data-tip-bottom>Unfold</button>
<i class="bar-line"></i>
<button class="bar-toggle bar-save" data-action="open-save" data-tip-bottom>Save</button>
</div>
<i class="bar-line"></i>
<button class="btn btn-small btn-fill bar-state" data-action="compare-files" data-tip-bottom>Compare</button>
</aside>
<div class="toast"></div>
<div class="tooltip" popover="manual"></div>
<section>
<div class="backdrop history-dialog" data-dialog="history">
<dialog open>
<h2>History</h2>
<p class="history-empty">Nothing has been compared yet. Every diff lands here, and the ones you save stay for good.</p>
<div class="history-scroll">
<section class="history-section" data-section="pinned">
<h3>Saved</h3>
<ol class="history-list"></ol>
</section>
<section class="history-section" data-section="recent">
<h3>Recent</h3>
<ol class="history-list"></ol>
</section>
</div>
<footer>
<button class="btn" data-action="clear-recent">Clear the recent</button>
<button class="btn" data-action="close-history">Close</button>
</footer>
<a href="#" class="close" data-action="close-history"></a>
</dialog>
</div>
<div class="backdrop" data-dialog="save">
<dialog open>
<h2>Save the diff</h2>
<p>A saved diff stays in the history for good, under its name.</p>
<form>
<div class="field" data-field="name">
<label>Name</label>
<input type="text" name="name" placeholder="What the diff is about" />
<div class="error" data-error="name">You must name the diff.</div>
</div>
<footer>
<button class="btn btn-fill dialog-btn" data-action="save-entry">Save</button>
<button class="btn save-forget" data-action="forget-entry">Forget</button>
<button class="btn" data-action="close-save">Cancel</button>
</footer>
</form>
<a href="#" class="close" data-action="close-save"></a>
</dialog>
</div>
<div class="backdrop settings-dialog" data-dialog="settings">
<dialog open>
<h2>Settings</h2>
<nav class="tabs">
<span class="tabs-mark"></span>
<a href="#" class="selected" data-action="settings-tab" data-tab="options">Options</a>
<a href="#" data-action="settings-tab" data-tab="keys">Shortcuts</a>
</nav>
<div class="settings-scroll">
<ol class="keys-list"></ol>
<form>
<h3>Comparing</h3>
<label class="toggle-input" data-field="ignoreSpace">
<input type="checkbox" role="switch" name="ignoreSpace" value="1" />
<div>Ignore the spaces when comparing the lines</div>
</label>
<label class="toggle-input" data-field="ignoreCase">
<input type="checkbox" role="switch" name="ignoreCase" value="1" />
<div>Ignore the case of the letters</div>
</label>
<h3>Lines</h3>
<label class="toggle-input" data-field="markWords">
<input type="checkbox" role="switch" name="markWords" value="1" />
<div>Mark the words that changed inside a line</div>
</label>
<label class="toggle-input" data-field="highlightCode">
<input type="checkbox" role="switch" name="highlightCode" value="1" />
<div>Color the code the way its language is written</div>
</label>
<label class="toggle-input" data-field="hideSame">
<input type="checkbox" role="switch" name="hideSame" value="1" />
<div>Hide the lines that did not change, but a few around each change</div>
</label>
<label class="toggle-input" data-field="wrapLines">
<input type="checkbox" role="switch" name="wrapLines" value="1" />
<div>Wrap the long lines</div>
</label>
<h3>JSON</h3>
<label class="toggle-input" data-field="prettyJson">
<input type="checkbox" role="switch" name="prettyJson" value="1" />
<div>Write the JSON out again before comparing its lines</div>
</label>
<label class="toggle-input" data-field="sortKeys">
<input type="checkbox" role="switch" name="sortKeys" value="1" />
<div>Sort the keys of the JSON before comparing its lines</div>
</label>
</form>
</div>
<footer>
<button class="btn btn-fill" data-action="save-settings">Save settings</button>
<button class="btn" data-action="close-settings">Cancel</button>
</footer>
<a href="#" class="close" data-action="close-settings"></a>
</dialog>
</div>
</section>
</body>
</html>