Update app-backup.py
Browse files- app-backup.py +136 -1
app-backup.py
CHANGED
|
@@ -994,6 +994,7 @@ HTML = """
|
|
| 994 |
<title>๐จ AI ํ๋ฆฝ๋ถ - Comic Style</title>
|
| 995 |
<link rel="stylesheet" href="/static/flipbook.css">
|
| 996 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
|
|
| 997 |
<link href="https://fonts.googleapis.com/css2?family=Bangers&family=Comic+Neue:wght@400;700&display=swap" rel="stylesheet">
|
| 998 |
<script src="/static/three.js"></script>
|
| 999 |
<script src="/static/iscroll.js"></script>
|
|
@@ -1479,6 +1480,124 @@ HTML = """
|
|
| 1479 |
border-bottom-left-radius: 4px;
|
| 1480 |
}
|
| 1481 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1482 |
.chat-time {
|
| 1483 |
font-size: 11px;
|
| 1484 |
color: #6B7280;
|
|
@@ -1842,12 +1961,28 @@ HTML = """
|
|
| 1842 |
const messagesContainer = $id('aiChatMessages');
|
| 1843 |
const messageElement = document.createElement('div');
|
| 1844 |
messageElement.className = `chat-message ${isUser ? 'user' : 'ai'}`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1845 |
messageElement.innerHTML = `
|
| 1846 |
<div class="chat-avatar">
|
| 1847 |
<i class="fas ${isUser ? 'fa-user' : 'fa-robot'}"></i>
|
| 1848 |
</div>
|
| 1849 |
<div class="chat-bubble">
|
| 1850 |
-
<div class="chat-content">${
|
| 1851 |
<div class="chat-time">${formatTime()}</div>
|
| 1852 |
</div>
|
| 1853 |
`;
|
|
|
|
| 994 |
<title>๐จ AI ํ๋ฆฝ๋ถ - Comic Style</title>
|
| 995 |
<link rel="stylesheet" href="/static/flipbook.css">
|
| 996 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 997 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/9.1.6/marked.min.js"></script>
|
| 998 |
<link href="https://fonts.googleapis.com/css2?family=Bangers&family=Comic+Neue:wght@400;700&display=swap" rel="stylesheet">
|
| 999 |
<script src="/static/three.js"></script>
|
| 1000 |
<script src="/static/iscroll.js"></script>
|
|
|
|
| 1480 |
border-bottom-left-radius: 4px;
|
| 1481 |
}
|
| 1482 |
|
| 1483 |
+
/* ๋งํฌ๋ค์ด ๋ ๋๋ง ์คํ์ผ */
|
| 1484 |
+
.chat-content.markdown-body {
|
| 1485 |
+
font-size: 14px;
|
| 1486 |
+
line-height: 1.6;
|
| 1487 |
+
}
|
| 1488 |
+
|
| 1489 |
+
.chat-content.markdown-body h1,
|
| 1490 |
+
.chat-content.markdown-body h2,
|
| 1491 |
+
.chat-content.markdown-body h3,
|
| 1492 |
+
.chat-content.markdown-body h4 {
|
| 1493 |
+
margin: 12px 0 8px 0;
|
| 1494 |
+
font-family: 'Bangers', cursive;
|
| 1495 |
+
color: #3B82F6;
|
| 1496 |
+
border-bottom: 2px solid #E5E7EB;
|
| 1497 |
+
padding-bottom: 4px;
|
| 1498 |
+
}
|
| 1499 |
+
|
| 1500 |
+
.chat-content.markdown-body h1 { font-size: 1.4em; }
|
| 1501 |
+
.chat-content.markdown-body h2 { font-size: 1.25em; }
|
| 1502 |
+
.chat-content.markdown-body h3 { font-size: 1.1em; }
|
| 1503 |
+
.chat-content.markdown-body h4 { font-size: 1em; }
|
| 1504 |
+
|
| 1505 |
+
.chat-content.markdown-body p {
|
| 1506 |
+
margin: 8px 0;
|
| 1507 |
+
}
|
| 1508 |
+
|
| 1509 |
+
.chat-content.markdown-body strong {
|
| 1510 |
+
color: #8B5CF6;
|
| 1511 |
+
font-weight: 700;
|
| 1512 |
+
}
|
| 1513 |
+
|
| 1514 |
+
.chat-content.markdown-body em {
|
| 1515 |
+
color: #059669;
|
| 1516 |
+
font-style: italic;
|
| 1517 |
+
}
|
| 1518 |
+
|
| 1519 |
+
.chat-content.markdown-body ul,
|
| 1520 |
+
.chat-content.markdown-body ol {
|
| 1521 |
+
margin: 8px 0;
|
| 1522 |
+
padding-left: 20px;
|
| 1523 |
+
}
|
| 1524 |
+
|
| 1525 |
+
.chat-content.markdown-body li {
|
| 1526 |
+
margin: 4px 0;
|
| 1527 |
+
position: relative;
|
| 1528 |
+
}
|
| 1529 |
+
|
| 1530 |
+
.chat-content.markdown-body ul li::marker {
|
| 1531 |
+
color: #EF4444;
|
| 1532 |
+
}
|
| 1533 |
+
|
| 1534 |
+
.chat-content.markdown-body ol li::marker {
|
| 1535 |
+
color: #3B82F6;
|
| 1536 |
+
font-weight: 700;
|
| 1537 |
+
}
|
| 1538 |
+
|
| 1539 |
+
.chat-content.markdown-body blockquote {
|
| 1540 |
+
margin: 10px 0;
|
| 1541 |
+
padding: 8px 12px;
|
| 1542 |
+
border-left: 4px solid #FACC15;
|
| 1543 |
+
background: #FEF9C3;
|
| 1544 |
+
border-radius: 0 8px 8px 0;
|
| 1545 |
+
font-style: italic;
|
| 1546 |
+
}
|
| 1547 |
+
|
| 1548 |
+
.chat-content.markdown-body code {
|
| 1549 |
+
background: #F3F4F6;
|
| 1550 |
+
padding: 2px 6px;
|
| 1551 |
+
border-radius: 4px;
|
| 1552 |
+
font-family: 'Consolas', monospace;
|
| 1553 |
+
font-size: 0.9em;
|
| 1554 |
+
color: #EF4444;
|
| 1555 |
+
}
|
| 1556 |
+
|
| 1557 |
+
.chat-content.markdown-body pre {
|
| 1558 |
+
background: #1F2937;
|
| 1559 |
+
color: #F9FAFB;
|
| 1560 |
+
padding: 12px;
|
| 1561 |
+
border-radius: 8px;
|
| 1562 |
+
overflow-x: auto;
|
| 1563 |
+
margin: 10px 0;
|
| 1564 |
+
}
|
| 1565 |
+
|
| 1566 |
+
.chat-content.markdown-body pre code {
|
| 1567 |
+
background: transparent;
|
| 1568 |
+
color: inherit;
|
| 1569 |
+
padding: 0;
|
| 1570 |
+
}
|
| 1571 |
+
|
| 1572 |
+
.chat-content.markdown-body hr {
|
| 1573 |
+
border: none;
|
| 1574 |
+
border-top: 2px dashed #D1D5DB;
|
| 1575 |
+
margin: 12px 0;
|
| 1576 |
+
}
|
| 1577 |
+
|
| 1578 |
+
.chat-content.markdown-body a {
|
| 1579 |
+
color: #3B82F6;
|
| 1580 |
+
text-decoration: underline;
|
| 1581 |
+
}
|
| 1582 |
+
|
| 1583 |
+
.chat-content.markdown-body table {
|
| 1584 |
+
width: 100%;
|
| 1585 |
+
border-collapse: collapse;
|
| 1586 |
+
margin: 10px 0;
|
| 1587 |
+
}
|
| 1588 |
+
|
| 1589 |
+
.chat-content.markdown-body th,
|
| 1590 |
+
.chat-content.markdown-body td {
|
| 1591 |
+
border: 2px solid #E5E7EB;
|
| 1592 |
+
padding: 8px;
|
| 1593 |
+
text-align: left;
|
| 1594 |
+
}
|
| 1595 |
+
|
| 1596 |
+
.chat-content.markdown-body th {
|
| 1597 |
+
background: #F3F4F6;
|
| 1598 |
+
font-weight: 700;
|
| 1599 |
+
}
|
| 1600 |
+
|
| 1601 |
.chat-time {
|
| 1602 |
font-size: 11px;
|
| 1603 |
color: #6B7280;
|
|
|
|
| 1961 |
const messagesContainer = $id('aiChatMessages');
|
| 1962 |
const messageElement = document.createElement('div');
|
| 1963 |
messageElement.className = `chat-message ${isUser ? 'user' : 'ai'}`;
|
| 1964 |
+
|
| 1965 |
+
// AI ๋ฉ์์ง๋ ๋งํฌ๋ค์ด์ HTML๋ก ๋ณํ
|
| 1966 |
+
let displayContent = content;
|
| 1967 |
+
if (!isUser && typeof marked !== 'undefined') {
|
| 1968 |
+
try {
|
| 1969 |
+
marked.setOptions({
|
| 1970 |
+
breaks: true, // ์ค๋ฐ๊ฟ์ <br>๋ก ๋ณํ
|
| 1971 |
+
gfm: true // GitHub Flavored Markdown
|
| 1972 |
+
});
|
| 1973 |
+
displayContent = marked.parse(content);
|
| 1974 |
+
} catch (e) {
|
| 1975 |
+
console.error('๋งํฌ๋ค์ด ํ์ฑ ์ค๋ฅ:', e);
|
| 1976 |
+
displayContent = content;
|
| 1977 |
+
}
|
| 1978 |
+
}
|
| 1979 |
+
|
| 1980 |
messageElement.innerHTML = `
|
| 1981 |
<div class="chat-avatar">
|
| 1982 |
<i class="fas ${isUser ? 'fa-user' : 'fa-robot'}"></i>
|
| 1983 |
</div>
|
| 1984 |
<div class="chat-bubble">
|
| 1985 |
+
<div class="chat-content markdown-body">${displayContent}</div>
|
| 1986 |
<div class="chat-time">${formatTime()}</div>
|
| 1987 |
</div>
|
| 1988 |
`;
|