Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,37 +9,54 @@ body {
|
|
| 9 |
font-family: Arial, sans-serif;
|
| 10 |
background-color: #f0f0f9;
|
| 11 |
}
|
| 12 |
-
|
| 13 |
h4 {
|
| 14 |
color: #333;
|
| 15 |
}
|
| 16 |
-
|
| 17 |
iframe {
|
| 18 |
border: 2px solid #007bff;
|
| 19 |
border-radius: 8px;
|
| 20 |
-
width: 100%;
|
| 21 |
-
height: 700px;
|
| 22 |
}
|
| 23 |
-
|
| 24 |
.gr-column {
|
| 25 |
padding: 10px;
|
| 26 |
-
width: 50%;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
}
|
|
|
|
| 28 |
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
"""
|
| 31 |
|
| 32 |
def app():
|
| 33 |
-
|
| 34 |
-
with gr.Blocks(css=css_style) as demo:
|
| 35 |
gr.Markdown("# AIQ Codepilot TEST", elem_id="main-title")
|
| 36 |
with gr.Row():
|
| 37 |
-
# ์ฒซ ๋ฒ์งธ HTML ์ปดํฌ๋ํธ๋ก IFrame ๊ตฌํ
|
| 38 |
with gr.Column():
|
| 39 |
gr.Markdown("### AIQ Codepilot", elem_id="title-1")
|
| 40 |
gr.HTML(value='<iframe src="https://www.chatbase.co/chatbot-iframe/100-daum-net-eurma-q2o"></iframe>')
|
| 41 |
|
| 42 |
-
# ๋ ๋ฒ์งธ HTML ์ปดํฌ๋ํธ๋ก IFrame ๊ตฌํ
|
| 43 |
with gr.Column():
|
| 44 |
gr.Markdown("### ์น์๋น์ค ๋์ ํ๋ฉด", elem_id="title-2")
|
| 45 |
gr.HTML(value='<iframe src="https://seawolf2357-frametest1.hf.space"></iframe>')
|
|
@@ -48,4 +65,3 @@ def app():
|
|
| 48 |
|
| 49 |
demo = app()
|
| 50 |
demo.launch(auth=("arxiv", "gpt"))
|
| 51 |
-
|
|
|
|
| 9 |
font-family: Arial, sans-serif;
|
| 10 |
background-color: #f0f0f9;
|
| 11 |
}
|
|
|
|
| 12 |
h4 {
|
| 13 |
color: #333;
|
| 14 |
}
|
|
|
|
| 15 |
iframe {
|
| 16 |
border: 2px solid #007bff;
|
| 17 |
border-radius: 8px;
|
| 18 |
+
width: 100%;
|
| 19 |
+
height: 700px;
|
| 20 |
}
|
|
|
|
| 21 |
.gr-column {
|
| 22 |
padding: 10px;
|
| 23 |
+
width: 50%;
|
| 24 |
+
}
|
| 25 |
+
/* '์ฝ๋' ํฌํจ ๊ฒฐ๊ณผ์ ๋ํ ์คํ์ผ */
|
| 26 |
+
.code-result {
|
| 27 |
+
background-color: black;
|
| 28 |
+
color: white;
|
| 29 |
+
padding: 10px;
|
| 30 |
+
border-radius: 8px;
|
| 31 |
}
|
| 32 |
+
"""
|
| 33 |
|
| 34 |
+
# JavaScript๋ก '์ฝ๋' ํฌํจ ๊ฒฐ๊ณผ ๊ฐ์ง ๋ฐ ์ฒ๋ฆฌ ๋ก์ง
|
| 35 |
+
javascript = """
|
| 36 |
+
document.addEventListener('DOMContentLoaded', (event) => {
|
| 37 |
+
const results = document.querySelectorAll('.gr-output');
|
| 38 |
+
results.forEach((result) => {
|
| 39 |
+
if (result.innerText.includes('์ฝ๋')) {
|
| 40 |
+
result.classList.add('code-result');
|
| 41 |
+
const copyButton = document.createElement('button');
|
| 42 |
+
copyButton.innerText = 'Copy';
|
| 43 |
+
copyButton.onclick = function() {
|
| 44 |
+
navigator.clipboard.writeText(result.innerText);
|
| 45 |
+
};
|
| 46 |
+
result.appendChild(copyButton);
|
| 47 |
+
}
|
| 48 |
+
});
|
| 49 |
+
});
|
| 50 |
"""
|
| 51 |
|
| 52 |
def app():
|
| 53 |
+
with gr.Blocks(css=css_style, js=javascript) as demo:
|
|
|
|
| 54 |
gr.Markdown("# AIQ Codepilot TEST", elem_id="main-title")
|
| 55 |
with gr.Row():
|
|
|
|
| 56 |
with gr.Column():
|
| 57 |
gr.Markdown("### AIQ Codepilot", elem_id="title-1")
|
| 58 |
gr.HTML(value='<iframe src="https://www.chatbase.co/chatbot-iframe/100-daum-net-eurma-q2o"></iframe>')
|
| 59 |
|
|
|
|
| 60 |
with gr.Column():
|
| 61 |
gr.Markdown("### ์น์๋น์ค ๋์ ํ๋ฉด", elem_id="title-2")
|
| 62 |
gr.HTML(value='<iframe src="https://seawolf2357-frametest1.hf.space"></iframe>')
|
|
|
|
| 65 |
|
| 66 |
demo = app()
|
| 67 |
demo.launch(auth=("arxiv", "gpt"))
|
|
|