-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.html
More file actions
162 lines (139 loc) · 4.08 KB
/
Copy pathpopup.html
File metadata and controls
162 lines (139 loc) · 4.08 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body {
width: 600px;
min-height: 400px;
padding: 20px;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: #f5f5f5;
}
.container {
background: white;
border-radius: 8px;
padding: 20px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
h1 {
color: #333;
margin-bottom: 20px;
font-size: 24px;
text-align: center;
}
.input-section {
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 8px;
font-weight: 600;
color: #555;
}
textarea {
width: 100%;
height: 120px;
padding: 12px;
border: 2px solid #ddd;
border-radius: 6px;
font-family: 'Courier New', monospace;
font-size: 12px;
resize: vertical;
box-sizing: border-box;
}
textarea:focus {
outline: none;
border-color: #4CAF50;
}
.button-group {
display: flex;
gap: 10px;
margin-bottom: 20px;
}
button {
flex: 1;
padding: 12px 20px;
border: none;
border-radius: 6px;
font-size: 14px;
font-weight: 600;
cursor: pointer;
transition: background-color 0.3s;
}
.primary-btn {
background: #4CAF50;
color: white;
}
.primary-btn:hover {
background: #45a049;
}
.secondary-btn {
background: #f0f0f0;
color: #333;
}
.secondary-btn:hover {
background: #e0e0e0;
}
.output-section {
margin-top: 20px;
}
.output {
background: #1e1e1e;
color: #f0f0f0;
padding: 15px;
border-radius: 6px;
font-family: 'Courier New', monospace;
font-size: 12px;
white-space: pre;
overflow-x: auto;
max-height: 300px;
overflow-y: auto;
border: 1px solid #333;
}
.error {
background: #ffebee;
color: #c62828;
padding: 12px;
border-radius: 6px;
border-left: 4px solid #c62828;
margin-top: 10px;
}
.example-links {
margin-top: 15px;
text-align: center;
}
.example-link {
color: #4CAF50;
text-decoration: none;
margin: 0 10px;
font-size: 12px;
}
.example-link:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="container">
<h1>JSON Table Formatter</h1>
<div class="input-section">
<label for="jsonInput">Enter JSON Data:</label>
<textarea id="jsonInput" placeholder='[{"name": "John", "age": 30, "city": "New York"}, {"name": "Jane", "age": 25, "city": "Boston"}]'></textarea>
</div>
<div class="button-group">
<button id="formatBtn" class="primary-btn">Format Table</button>
<button id="clearBtn" class="secondary-btn">Clear</button>
</div>
<div class="example-links">
<a href="#" class="example-link" id="example1">Simple Example</a>
<a href="#" class="example-link" id="example2">Complex Example</a>
</div>
<div class="output-section">
<label>Formatted Table:</label>
<div id="output" class="output"></div> </div>
</div>
<script src="table-formatter.js"></script>
<script src="popup.js"></script>
</body>
</html>