Skip to content

Commit e8f9fb6

Browse files
committed
Updates with formatting changes and UI improvements
1 parent d65f9cb commit e8f9fb6

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
2-
npm-debug.log
2+
npm-debug.log
3+
NOTES.md

app.css

+11-4
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ a.h{
2727
.t:focus,
2828
.t:active {
2929
width: 45%;
30-
height: 200px;
31-
padding: 2%;
30+
height: 350px;
31+
padding: 1%;
3232
resize: none;
3333
outline: none;
3434
font-size: 1em;
@@ -39,14 +39,21 @@ a.h{
3939

4040
.b {
4141
font-size: 1em;
42-
margin: 0 auto;
42+
margin: 20px auto;
4343
display: block;
4444
cursor: pointer;
4545
background: none;
46-
padding: 1%;
46+
padding: 0.5%;
4747
border: 1px solid #000;
4848
}
4949

50+
pre{
51+
display: block;
52+
font-family: monospace;
53+
white-space: pre;
54+
font-size: 12px;
55+
}
56+
5057
@media only screen and (max-width: 768px) {
5158
.t {
5259
width: 100%;

bundle.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ function diffDisplay(str1, str2) {
2727
});
2828

2929
display.appendChild(fragment);
30+
31+
location.hash = '#diff';
3032
}
3133

3234
// app sorting
@@ -43,7 +45,7 @@ function appSort(ev, tid1, tid2) {
4345
sortStr2 = jsonabc.sort(inputStr2);
4446

4547
document.getElementById(tid1).value = sortStr1;
46-
document.getElementById(tid1).value = sortStr2;
48+
document.getElementById(tid2).value = sortStr2;
4749

4850
diffDisplay(sortStr1, sortStr2);
4951
} catch (ex) {

index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
<h1>JSON Sort and Diff</h1>
1717
<form onsubmit="appSort(event, 't1', 't2')">
1818
<div class="boxes">
19-
<textarea id="t1" class="t left" name="jsonabc1" placeholder="Paste your first unsorted JSON here" aria-label="Paste your first unsorted JSON here"
19+
<textarea id="t1" class="t" name="jsonabc1" placeholder="Paste your first unsorted JSON here" aria-label="Paste your first unsorted JSON here"
2020
spellcheck="false" required aria-required="true"></textarea>
21-
<textarea id="t2" class="t right" name="jsonabc2" placeholder="Paste your second unsorted JSON here" aria-label="Paste your second unsorted JSON here"
21+
<textarea id="t2" class="t" name="jsonabc2" placeholder="Paste your second unsorted JSON here" aria-label="Paste your second unsorted JSON here"
2222
spellcheck="false" required aria-required="true"></textarea>
2323
</div>
2424
<div>

main.js

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ function diffDisplay(str1, str2) {
2626
});
2727

2828
display.appendChild(fragment);
29+
30+
location.hash = '#diff';
2931
}
3032

3133
// app sorting

0 commit comments

Comments
 (0)