-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
94 lines (86 loc) · 2.12 KB
/
index.html
File metadata and controls
94 lines (86 loc) · 2.12 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>WTF JSON</title>
<script src="./dist/index.js"></script>
<style>
* {
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: Arial, sans-serif;
}
body {
height: 100vh;
display: flex;
flex-direction: column;
background-color: #00dbde;
background-image: linear-gradient(90deg, #00dbde 0%, #fc00ff 100%);
}
a {
color: #fff;
font-weight: bold;
text-transform: uppercase;
text-align: center;
}
h1 {
font-size: 1.4rem;
}
header {
display: flex;
padding: 3rem;
align-items: center;
justify-content: center;
}
section {
display: flex;
flex-wrap: wrap;
height: 100%;
padding: 1rem;
gap: 1rem;
}
textarea {
border: none;
outline: none;
border-radius: 1rem;
resize: none;
overflow: auto;
flex: 1 1;
min-width: 20rem;
padding: 1rem;
background-color: rgba(255, 255, 255, 0.75);
}
</style>
</head>
<body>
<header>
<a href="https://github.com/yoannchb-pro/wtf-json" target="_blank"
><h1>wtfJson | A typescript librairie to parse any kind of JSON</h1></a
>
</header>
<section>
<textarea
id="input"
placeholder="Input (for example: [hello,, world])"
></textarea>
<textarea
id="output"
readonly
placeholder="Output (should give: ['hello', 'world'])"
></textarea>
</section>
</body>
<script>
const input = document.querySelector("#input");
const output = document.querySelector("#output");
const exec = () => {
const json = input.value;
const result = wtfJson(json);
if (json) output.value = JSON.stringify(result, undefined, 4);
else output.value = "";
};
input.addEventListener("input", exec);
</script>
</html>