Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -492,86 +492,151 @@ def create_main_interface():
|
|
| 492 |
|
| 493 |
with ms.Application() as app:
|
| 494 |
with antd.ConfigProvider():
|
| 495 |
-
# Drawer ์ปดํฌ๋ํธ๋ค
|
| 496 |
with antd.Drawer(open=False, title="AI is Creating...", placement="left", width="750px") as code_drawer:
|
| 497 |
gr.HTML("""
|
| 498 |
<div class="thinking-container">
|
| 499 |
-
<div class="thinking-animation">
|
| 500 |
-
<lottie-player
|
| 501 |
-
src="https://assets2.lottiefiles.com/packages/lf20_szviypry.json"
|
| 502 |
-
background="transparent"
|
| 503 |
-
speed="1"
|
| 504 |
-
style="width: 300px; height: 300px;"
|
| 505 |
-
loop
|
| 506 |
-
autoplay>
|
| 507 |
-
</lottie-player>
|
| 508 |
-
</div>
|
| 509 |
-
|
| 510 |
-
<div class="thinking-tips" id="thinkingTips">
|
| 511 |
-
<h3>Did you know?</h3>
|
| 512 |
-
<div class="tip-content"></div>
|
| 513 |
-
</div>
|
| 514 |
-
|
| 515 |
<style>
|
| 516 |
.thinking-container {
|
| 517 |
text-align: center;
|
| 518 |
padding: 20px;
|
|
|
|
|
|
|
| 519 |
font-family: 'Arial', sans-serif;
|
| 520 |
}
|
| 521 |
|
| 522 |
-
.
|
| 523 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 524 |
}
|
| 525 |
|
| 526 |
-
.
|
| 527 |
-
background:
|
| 528 |
padding: 20px;
|
| 529 |
border-radius: 10px;
|
| 530 |
-
|
|
|
|
|
|
|
| 531 |
}
|
| 532 |
|
| 533 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 534 |
color: #1890ff;
|
| 535 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 536 |
}
|
| 537 |
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 542 |
}
|
| 543 |
</style>
|
| 544 |
|
| 545 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 546 |
<script>
|
| 547 |
const tips = [
|
| 548 |
-
"MOUSE-I
|
| 549 |
-
"
|
| 550 |
-
"
|
| 551 |
-
"
|
| 552 |
-
"
|
| 553 |
-
"
|
| 554 |
-
"
|
| 555 |
-
"
|
| 556 |
];
|
| 557 |
|
| 558 |
function updateTip() {
|
| 559 |
-
const tipElement = document.
|
| 560 |
if (tipElement) {
|
| 561 |
const randomTip = tips[Math.floor(Math.random() * tips.length)];
|
| 562 |
tipElement.innerHTML = randomTip;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 563 |
}
|
| 564 |
}
|
| 565 |
|
| 566 |
-
// ์ด๊ธฐ ํ ์ค์
|
| 567 |
updateTip();
|
| 568 |
-
|
| 569 |
-
// 3์ด๋ง๋ค ํ ์
๋ฐ์ดํธ
|
| 570 |
setInterval(updateTip, 3000);
|
| 571 |
</script>
|
| 572 |
</div>
|
| 573 |
""")
|
| 574 |
-
code_output = legacy.Markdown(visible=False)
|
|
|
|
|
|
|
| 575 |
|
| 576 |
with antd.Drawer(open=False, title="history", placement="left", width="900px") as history_drawer:
|
| 577 |
history_output = legacy.Chatbot(show_label=False, flushing=False, height=960, elem_classes="history_chatbot")
|
|
|
|
| 492 |
|
| 493 |
with ms.Application() as app:
|
| 494 |
with antd.ConfigProvider():
|
| 495 |
+
# Drawer ์ปดํฌ๋ํธ๋ค
|
| 496 |
with antd.Drawer(open=False, title="AI is Creating...", placement="left", width="750px") as code_drawer:
|
| 497 |
gr.HTML("""
|
| 498 |
<div class="thinking-container">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 499 |
<style>
|
| 500 |
.thinking-container {
|
| 501 |
text-align: center;
|
| 502 |
padding: 20px;
|
| 503 |
+
background: #f8f9fa;
|
| 504 |
+
border-radius: 15px;
|
| 505 |
font-family: 'Arial', sans-serif;
|
| 506 |
}
|
| 507 |
|
| 508 |
+
.progress-bar {
|
| 509 |
+
width: 100%;
|
| 510 |
+
height: 4px;
|
| 511 |
+
background: #e9ecef;
|
| 512 |
+
border-radius: 4px;
|
| 513 |
+
margin: 20px 0;
|
| 514 |
+
overflow: hidden;
|
| 515 |
+
}
|
| 516 |
+
|
| 517 |
+
.progress-bar-inner {
|
| 518 |
+
width: 30%;
|
| 519 |
+
height: 100%;
|
| 520 |
+
background: linear-gradient(90deg, #1890ff, #52c41a);
|
| 521 |
+
animation: progress 2s ease-in-out infinite;
|
| 522 |
+
}
|
| 523 |
+
|
| 524 |
+
.thinking-icon {
|
| 525 |
+
font-size: 48px;
|
| 526 |
+
margin: 20px 0;
|
| 527 |
+
animation: bounce 1s ease infinite;
|
| 528 |
}
|
| 529 |
|
| 530 |
+
.tip-box {
|
| 531 |
+
background: white;
|
| 532 |
padding: 20px;
|
| 533 |
border-radius: 10px;
|
| 534 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
| 535 |
+
margin: 20px 0;
|
| 536 |
+
transition: all 0.3s ease;
|
| 537 |
}
|
| 538 |
|
| 539 |
+
.tip-box:hover {
|
| 540 |
+
transform: translateY(-5px);
|
| 541 |
+
box-shadow: 0 6px 16px rgba(0,0,0,0.15);
|
| 542 |
+
}
|
| 543 |
+
|
| 544 |
+
.status-text {
|
| 545 |
color: #1890ff;
|
| 546 |
+
font-size: 18px;
|
| 547 |
+
margin: 15px 0;
|
| 548 |
+
animation: fade 1.5s ease infinite;
|
| 549 |
+
}
|
| 550 |
+
|
| 551 |
+
.icon-grid {
|
| 552 |
+
display: grid;
|
| 553 |
+
grid-template-columns: repeat(4, 1fr);
|
| 554 |
+
gap: 15px;
|
| 555 |
+
margin: 20px 0;
|
| 556 |
+
}
|
| 557 |
+
|
| 558 |
+
.icon-item {
|
| 559 |
+
padding: 10px;
|
| 560 |
+
background: rgba(24,144,255,0.1);
|
| 561 |
+
border-radius: 8px;
|
| 562 |
+
animation: pulse 2s ease infinite;
|
| 563 |
+
}
|
| 564 |
+
|
| 565 |
+
@keyframes progress {
|
| 566 |
+
0% { transform: translateX(-100%); }
|
| 567 |
+
100% { transform: translateX(400%); }
|
| 568 |
}
|
| 569 |
|
| 570 |
+
@keyframes bounce {
|
| 571 |
+
0%, 100% { transform: translateY(0); }
|
| 572 |
+
50% { transform: translateY(-10px); }
|
| 573 |
+
}
|
| 574 |
+
|
| 575 |
+
@keyframes fade {
|
| 576 |
+
0%, 100% { opacity: 1; }
|
| 577 |
+
50% { opacity: 0.6; }
|
| 578 |
+
}
|
| 579 |
+
|
| 580 |
+
@keyframes pulse {
|
| 581 |
+
0% { transform: scale(1); }
|
| 582 |
+
50% { transform: scale(1.05); }
|
| 583 |
+
100% { transform: scale(1); }
|
| 584 |
}
|
| 585 |
</style>
|
| 586 |
|
| 587 |
+
<div class="thinking-icon">๐จ</div>
|
| 588 |
+
|
| 589 |
+
<div class="status-text">Creating Your Visualization...</div>
|
| 590 |
+
|
| 591 |
+
<div class="progress-bar">
|
| 592 |
+
<div class="progress-bar-inner"></div>
|
| 593 |
+
</div>
|
| 594 |
+
|
| 595 |
+
<div class="icon-grid">
|
| 596 |
+
<div class="icon-item">๐</div>
|
| 597 |
+
<div class="icon-item">๐ฏ</div>
|
| 598 |
+
<div class="icon-item">๐ก</div>
|
| 599 |
+
<div class="icon-item">โจ</div>
|
| 600 |
+
</div>
|
| 601 |
+
|
| 602 |
+
<div class="tip-box">
|
| 603 |
+
<h3 style="color: #1890ff; margin-bottom: 10px;">Did You Know?</h3>
|
| 604 |
+
<div id="tip-content" style="font-size: 16px; line-height: 1.6;"></div>
|
| 605 |
+
</div>
|
| 606 |
+
|
| 607 |
<script>
|
| 608 |
const tips = [
|
| 609 |
+
"MOUSE-I is creating responsive and interactive visualizations! ๐",
|
| 610 |
+
"We're applying modern design principles for the best user experience! ๐จ",
|
| 611 |
+
"Your content will be optimized for all devices! ๐ฑ",
|
| 612 |
+
"Adding engaging animations to bring your data to life! โจ",
|
| 613 |
+
"Crafting a beautiful presentation just for you! ๐ฏ",
|
| 614 |
+
"Implementing interactive elements for better engagement! ๐ฎ",
|
| 615 |
+
"Optimizing colors and layout for visual appeal! ๐ช",
|
| 616 |
+
"Creating smooth transitions and animations! ๐"
|
| 617 |
];
|
| 618 |
|
| 619 |
function updateTip() {
|
| 620 |
+
const tipElement = document.getElementById('tip-content');
|
| 621 |
if (tipElement) {
|
| 622 |
const randomTip = tips[Math.floor(Math.random() * tips.length)];
|
| 623 |
tipElement.innerHTML = randomTip;
|
| 624 |
+
tipElement.style.opacity = 0;
|
| 625 |
+
setTimeout(() => {
|
| 626 |
+
tipElement.style.transition = 'opacity 0.5s ease';
|
| 627 |
+
tipElement.style.opacity = 1;
|
| 628 |
+
}, 100);
|
| 629 |
}
|
| 630 |
}
|
| 631 |
|
|
|
|
| 632 |
updateTip();
|
|
|
|
|
|
|
| 633 |
setInterval(updateTip, 3000);
|
| 634 |
</script>
|
| 635 |
</div>
|
| 636 |
""")
|
| 637 |
+
code_output = legacy.Markdown(visible=False)
|
| 638 |
+
|
| 639 |
+
|
| 640 |
|
| 641 |
with antd.Drawer(open=False, title="history", placement="left", width="900px") as history_drawer:
|
| 642 |
history_output = legacy.Chatbot(show_label=False, flushing=False, height=960, elem_classes="history_chatbot")
|