Update app.css
Browse files
app.css
CHANGED
@@ -62,7 +62,6 @@ body {
|
|
62 |
color: var(--text-primary);
|
63 |
}
|
64 |
|
65 |
-
/* 우측 패널 크기 조절 */
|
66 |
.right_panel {
|
67 |
position: relative;
|
68 |
height: 600px;
|
@@ -73,24 +72,29 @@ body {
|
|
73 |
margin: 20px;
|
74 |
border-radius: 12px;
|
75 |
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
|
|
|
|
76 |
}
|
77 |
|
78 |
-
/*
|
79 |
.html_content {
|
80 |
-
|
81 |
-
|
|
|
82 |
background: var(--surface);
|
83 |
overflow: hidden;
|
84 |
}
|
85 |
|
|
|
86 |
.html_content iframe {
|
|
|
87 |
width: 100%;
|
88 |
-
height: 100%;
|
89 |
border: none;
|
90 |
display: block;
|
91 |
}
|
92 |
|
93 |
-
|
|
|
94 |
.html_content iframe html,
|
95 |
.html_content iframe body {
|
96 |
margin: 0;
|
@@ -100,7 +104,7 @@ body {
|
|
100 |
overflow: auto;
|
101 |
}
|
102 |
|
103 |
-
/* 렌더링 헤더 */
|
104 |
.render_header {
|
105 |
height: 30px;
|
106 |
background: var(--neutral-100);
|
@@ -109,9 +113,7 @@ body {
|
|
109 |
align-items: center;
|
110 |
padding: 0 12px;
|
111 |
gap: 6px;
|
112 |
-
|
113 |
-
top: 0;
|
114 |
-
z-index: 10;
|
115 |
}
|
116 |
|
117 |
.header_btn {
|
@@ -140,25 +142,41 @@ body {
|
|
140 |
align-items: center;
|
141 |
background: var(--surface);
|
142 |
}
|
143 |
-
|
144 |
-
/* 탭 컨텐츠가 전체 높이를 사용하도록 */
|
145 |
.ant-tabs-content {
|
146 |
height: 100%;
|
|
|
|
|
147 |
}
|
148 |
|
149 |
.ant-tabs-tabpane {
|
150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
}
|
152 |
|
153 |
-
/*
|
154 |
.ant-empty,
|
155 |
.ant-spin-container {
|
156 |
-
|
157 |
display: flex;
|
158 |
justify-content: center;
|
159 |
align-items: center;
|
160 |
}
|
161 |
|
|
|
|
|
|
|
162 |
.history_chatbot button {
|
163 |
background: none;
|
164 |
border: none;
|
@@ -378,26 +396,53 @@ function adjustIframeContent() {
|
|
378 |
iframes.forEach(iframe => {
|
379 |
try {
|
380 |
iframe.onload = function() {
|
|
|
381 |
const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
|
|
|
|
|
382 |
const style = iframeDoc.createElement('style');
|
383 |
style.textContent = `
|
384 |
html, body {
|
385 |
margin: 0;
|
386 |
padding: 0;
|
387 |
-
height:
|
388 |
width: 100%;
|
389 |
overflow: auto;
|
390 |
}
|
|
|
|
|
|
|
|
|
391 |
body > * {
|
392 |
-
|
393 |
}
|
394 |
`;
|
395 |
-
iframeDoc.head.appendChild(style);
|
396 |
|
397 |
-
|
398 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
399 |
});
|
400 |
-
resizeObserver.observe(iframe);
|
401 |
};
|
402 |
} catch (e) {
|
403 |
console.error('iframe 조정 중 오류:', e);
|
@@ -405,49 +450,29 @@ function adjustIframeContent() {
|
|
405 |
});
|
406 |
}
|
407 |
|
408 |
-
//
|
409 |
document.addEventListener('DOMContentLoaded', function() {
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
isResizing = true;
|
418 |
-
startY = e.pageY;
|
419 |
-
startHeight = panel.offsetHeight;
|
420 |
-
document.body.style.cursor = 'ns-resize';
|
421 |
-
}
|
422 |
-
});
|
423 |
-
|
424 |
-
document.addEventListener('mousemove', function(e) {
|
425 |
-
if (!isResizing) return;
|
426 |
-
|
427 |
-
const diff = e.pageY - startY;
|
428 |
-
const newHeight = Math.max(400, Math.min(800, startHeight + diff));
|
429 |
-
panel.style.height = `${newHeight}px`;
|
430 |
-
});
|
431 |
-
|
432 |
-
document.addEventListener('mouseup', function() {
|
433 |
-
isResizing = false;
|
434 |
-
document.body.style.cursor = '';
|
435 |
-
});
|
436 |
-
|
437 |
-
// 더블클릭으로 크기 토글
|
438 |
-
panel.addEventListener('dblclick', function(e) {
|
439 |
-
if (e.offsetY > panel.offsetHeight - 6) {
|
440 |
-
if (panel.offsetHeight === 600) {
|
441 |
-
panel.style.height = '800px';
|
442 |
-
} else {
|
443 |
-
panel.style.height = '600px';
|
444 |
}
|
445 |
-
}
|
|
|
|
|
|
|
|
|
|
|
446 |
});
|
447 |
});
|
448 |
|
449 |
-
//
|
450 |
-
|
451 |
-
const
|
452 |
-
|
|
|
|
|
453 |
</script>
|
|
|
62 |
color: var(--text-primary);
|
63 |
}
|
64 |
|
|
|
65 |
.right_panel {
|
66 |
position: relative;
|
67 |
height: 600px;
|
|
|
72 |
margin: 20px;
|
73 |
border-radius: 12px;
|
74 |
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
75 |
+
display: flex;
|
76 |
+
flex-direction: column;
|
77 |
}
|
78 |
|
79 |
+
/* 수정된 HTML 콘텐츠 영역 */
|
80 |
.html_content {
|
81 |
+
flex: 1;
|
82 |
+
display: flex;
|
83 |
+
flex-direction: column;
|
84 |
background: var(--surface);
|
85 |
overflow: hidden;
|
86 |
}
|
87 |
|
88 |
+
/* 수정된 iframe 스타일 */
|
89 |
.html_content iframe {
|
90 |
+
flex: 1;
|
91 |
width: 100%;
|
|
|
92 |
border: none;
|
93 |
display: block;
|
94 |
}
|
95 |
|
96 |
+
|
97 |
+
/* iframe 내부 스타일을 위한 추가 */
|
98 |
.html_content iframe html,
|
99 |
.html_content iframe body {
|
100 |
margin: 0;
|
|
|
104 |
overflow: auto;
|
105 |
}
|
106 |
|
107 |
+
/* 수정된 렌더링 헤더 */
|
108 |
.render_header {
|
109 |
height: 30px;
|
110 |
background: var(--neutral-100);
|
|
|
113 |
align-items: center;
|
114 |
padding: 0 12px;
|
115 |
gap: 6px;
|
116 |
+
flex-shrink: 0;
|
|
|
|
|
117 |
}
|
118 |
|
119 |
.header_btn {
|
|
|
142 |
align-items: center;
|
143 |
background: var(--surface);
|
144 |
}
|
145 |
+
/* 수정된 탭 콘텐츠 스타일 */
|
|
|
146 |
.ant-tabs-content {
|
147 |
height: 100%;
|
148 |
+
display: flex;
|
149 |
+
flex-direction: column;
|
150 |
}
|
151 |
|
152 |
.ant-tabs-tabpane {
|
153 |
+
flex: 1;
|
154 |
+
display: flex;
|
155 |
+
flex-direction: column;
|
156 |
+
}
|
157 |
+
|
158 |
+
/* 수정된 우측 콘텐츠 스타일 */
|
159 |
+
.right_content {
|
160 |
+
flex: 1;
|
161 |
+
display: flex;
|
162 |
+
flex-direction: column;
|
163 |
+
justify-content: center;
|
164 |
+
align-items: center;
|
165 |
+
background: var(--surface);
|
166 |
}
|
167 |
|
168 |
+
/* Empty와 Spin 컨테이너 수정 */
|
169 |
.ant-empty,
|
170 |
.ant-spin-container {
|
171 |
+
flex: 1;
|
172 |
display: flex;
|
173 |
justify-content: center;
|
174 |
align-items: center;
|
175 |
}
|
176 |
|
177 |
+
|
178 |
+
|
179 |
+
|
180 |
.history_chatbot button {
|
181 |
background: none;
|
182 |
border: none;
|
|
|
396 |
iframes.forEach(iframe => {
|
397 |
try {
|
398 |
iframe.onload = function() {
|
399 |
+
// iframe 내부 document 접근
|
400 |
const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
|
401 |
+
|
402 |
+
// 스타일 요소 생성
|
403 |
const style = iframeDoc.createElement('style');
|
404 |
style.textContent = `
|
405 |
html, body {
|
406 |
margin: 0;
|
407 |
padding: 0;
|
408 |
+
height: 100vh;
|
409 |
width: 100%;
|
410 |
overflow: auto;
|
411 |
}
|
412 |
+
body {
|
413 |
+
display: flex;
|
414 |
+
flex-direction: column;
|
415 |
+
}
|
416 |
body > * {
|
417 |
+
width: 100%;
|
418 |
}
|
419 |
`;
|
|
|
420 |
|
421 |
+
// 스타일 적용
|
422 |
+
if (iframeDoc.head) {
|
423 |
+
iframeDoc.head.appendChild(style);
|
424 |
+
}
|
425 |
+
|
426 |
+
// iframe 크기 조정
|
427 |
+
function updateIframeSize() {
|
428 |
+
const content = iframeDoc.body;
|
429 |
+
if (content) {
|
430 |
+
iframe.style.height = '100%';
|
431 |
+
content.style.minHeight = '100%';
|
432 |
+
}
|
433 |
+
}
|
434 |
+
|
435 |
+
// 초기 크기 설정
|
436 |
+
updateIframeSize();
|
437 |
+
|
438 |
+
// ResizeObserver로 크기 변화 감지
|
439 |
+
const resizeObserver = new ResizeObserver(updateIframeSize);
|
440 |
+
resizeObserver.observe(iframeDoc.body);
|
441 |
+
|
442 |
+
// iframe 내부 스크롤 이벤트 처리
|
443 |
+
iframeDoc.addEventListener('scroll', function(e) {
|
444 |
+
e.stopPropagation();
|
445 |
});
|
|
|
446 |
};
|
447 |
} catch (e) {
|
448 |
console.error('iframe 조정 중 오류:', e);
|
|
|
450 |
});
|
451 |
}
|
452 |
|
453 |
+
// 페이지 로드 시 실행
|
454 |
document.addEventListener('DOMContentLoaded', function() {
|
455 |
+
adjustIframeContent();
|
456 |
+
|
457 |
+
// DOM 변화 감지하여 새로운 iframe에도 적용
|
458 |
+
const observer = new MutationObserver(function(mutations) {
|
459 |
+
mutations.forEach(function(mutation) {
|
460 |
+
if (mutation.addedNodes.length) {
|
461 |
+
adjustIframeContent();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
462 |
}
|
463 |
+
});
|
464 |
+
});
|
465 |
+
|
466 |
+
observer.observe(document.body, {
|
467 |
+
childList: true,
|
468 |
+
subtree: true
|
469 |
});
|
470 |
});
|
471 |
|
472 |
+
// send_to_sandbox 함수 수정
|
473 |
+
function send_to_sandbox(code) {
|
474 |
+
const encoded_html = btoa(unescape(encodeURIComponent(code)));
|
475 |
+
const data_uri = `data:text/html;base64,${encoded_html}`;
|
476 |
+
return `<div class="render_content"><iframe src="${data_uri}" style="width:100%;height:100%;border:none;"></iframe></div>`;
|
477 |
+
}
|
478 |
</script>
|