Skip to content

Commit ad69ae4

Browse files
committed
fix: update scroll logic
1 parent 9a1f191 commit ad69ae4

File tree

3 files changed

+25
-37
lines changed

3 files changed

+25
-37
lines changed

generator/css/content/json-body.css

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,18 @@
3838

3939
.json-textarea {
4040
flex-grow: 1;
41-
width: 100%;
41+
padding: 5px;
42+
border: none;
43+
line-height: 1.5;
44+
resize: none;
45+
overflow-y: auto !important;
46+
height: 100% !important;
4247
font-family: 'Courier New', monospace;
4348
font-size: 14px;
44-
padding: 15px;
45-
border: 1px solid #ddd;
46-
border-radius: 4px;
47-
resize: none;
48-
background: white;
49-
color: #333;
50-
margin-bottom: 10px;
51-
box-sizing: border-box;
49+
white-space: pre-wrap;
50+
word-wrap: break-word;
51+
overflow-wrap: break-word;
52+
overflow-x: hidden;
5253
}
5354

5455
.json-status-bar {
@@ -87,24 +88,20 @@
8788
}
8889

8990
.json-textarea.drag-over {
90-
border: 2px dashed var(--android-green) !important;
91-
background-color: rgba(61, 220, 132, 0.1) !important;
91+
border: 2px dashed var(--android-green) !important;
92+
background-color: rgba(61, 220, 132, 0.1) !important;
9293
}
9394

9495
[data-theme="dark"] .json-textarea.drag-over {
95-
background-color: rgba(61, 220, 132, 0.2) !important;
96+
background-color: rgba(61, 220, 132, 0.2) !important;
9697
}
9798

9899
.status-success {
99-
color: #3ddc84;
100-
}
101-
102-
.status-error {
103-
color: #ff4444;
100+
color: #3ddc84;
104101
}
105102

106103
.status-info {
107-
color: #4285f4;
104+
color: #4285f4;
108105
}
109106

110107
.json-editor-wrapper {
@@ -121,7 +118,7 @@
121118

122119
.line-numbers {
123120
width: 40px;
124-
padding: 15px 5px;
121+
padding: 7px 5px;
125122
font-family: 'Courier New', monospace;
126123
font-size: 14px;
127124
line-height: 1.5;
@@ -134,19 +131,6 @@
134131
height: 100%;
135132
}
136133

137-
.json-textarea {
138-
flex-grow: 1;
139-
padding: 15px;
140-
border: none;
141-
line-height: 1.5;
142-
resize: none;
143-
overflow-y: auto !important;
144-
height: 100% !important;
145-
white-space: nowrap;
146-
font-family: 'Courier New', monospace;
147-
font-size: 14px;
148-
}
149-
150134
[data-theme="dark"] .json-editor-wrapper {
151135
border-color: #444;
152136
background: #2d2f33;
@@ -156,9 +140,4 @@
156140
background: #252525;
157141
color: #777;
158142
border-right-color: #444;
159-
}
160-
161-
[data-theme="dark"] .json-textarea {
162-
background: #2d2f33;
163-
color: #e0e0e0;
164143
}

generator/css/mobile/json-body-mobile.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,10 @@
5353

5454
.json-textarea {
5555
padding: 10px;
56+
word-break: break-all;
57+
}
58+
59+
.current-line::after {
60+
left: 30px !important;
5661
}
5762
}

generator/js/content/json-body.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ export function initJsonBody() {
2121
const parsed = JSON.parse(textarea.value);
2222
textarea.value = JSON.stringify(parsed);
2323
updateStatus('JSON минифицирован', 'success');
24+
setTimeout(() => {
25+
textarea.style.whiteSpace = 'pre';
26+
textarea.style.whiteSpace = 'pre-wrap';
27+
}, 0);
2428
} catch (e) {
2529
updateStatus('Ошибка: невалидный JSON', 'error');
2630
}

0 commit comments

Comments
 (0)