Update app.py
Browse files
app.py
CHANGED
|
@@ -11,83 +11,108 @@ from typing import List
|
|
| 11 |
from together import Together
|
| 12 |
|
| 13 |
# ----------------- تنظیمات صفحه -----------------
|
|
|
|
|
|
|
| 14 |
st.set_page_config(page_title="رزم یار ارتش", page_icon="🪖", layout="wide")
|
| 15 |
|
| 16 |
st.markdown("""
|
| 17 |
<style>
|
|
|
|
| 18 |
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;700&display=swap');
|
| 19 |
html, body, [class*="css"] {
|
| 20 |
font-family: 'Vazirmatn', Tahoma, sans-serif;
|
| 21 |
direction: rtl;
|
| 22 |
text-align: right;
|
|
|
|
| 23 |
}
|
|
|
|
|
|
|
| 24 |
.stApp {
|
| 25 |
-
background:
|
|
|
|
| 26 |
background-size: cover;
|
| 27 |
backdrop-filter: blur(2px);
|
| 28 |
}
|
|
|
|
|
|
|
| 29 |
.stChatMessage {
|
| 30 |
-
background-color: rgba(255,255,255,0.
|
| 31 |
-
border:
|
| 32 |
-
border-radius:
|
| 33 |
-
padding:
|
| 34 |
-
margin-bottom:
|
| 35 |
-
box-shadow: 0 4px
|
| 36 |
-
animation: fadeIn 0.
|
| 37 |
}
|
|
|
|
|
|
|
| 38 |
.stTextInput > div > input, .stTextArea textarea {
|
| 39 |
-
background-color: rgba(255,255,255,0.
|
| 40 |
-
border
|
|
|
|
|
|
|
| 41 |
direction: rtl;
|
| 42 |
text-align: right;
|
| 43 |
font-family: 'Vazirmatn', Tahoma;
|
|
|
|
| 44 |
}
|
|
|
|
|
|
|
| 45 |
.stButton>button {
|
| 46 |
background-color: #4e8a3e !important;
|
| 47 |
color: white !important;
|
| 48 |
font-weight: bold;
|
| 49 |
-
border-radius:
|
| 50 |
-
padding:
|
| 51 |
-
transition: 0.3s;
|
|
|
|
| 52 |
}
|
| 53 |
.stButton>button:hover {
|
| 54 |
background-color: #3c6d30 !important;
|
|
|
|
| 55 |
}
|
|
|
|
|
|
|
| 56 |
.header-text {
|
| 57 |
text-align: center;
|
| 58 |
-
margin-top:
|
| 59 |
margin-bottom: 40px;
|
| 60 |
-
background-color: rgba(255, 255, 255, 0.
|
| 61 |
-
padding:
|
| 62 |
-
border-radius:
|
| 63 |
-
box-shadow: 0
|
|
|
|
| 64 |
}
|
| 65 |
.header-text h1 {
|
| 66 |
-
font-size:
|
| 67 |
color: #2c3e50;
|
| 68 |
margin: 0;
|
| 69 |
-
font-weight:
|
| 70 |
}
|
| 71 |
.subtitle {
|
| 72 |
-
font-size:
|
| 73 |
color: #34495e;
|
| 74 |
-
margin-top:
|
|
|
|
| 75 |
}
|
|
|
|
|
|
|
| 76 |
@keyframes fadeIn {
|
| 77 |
-
from { opacity: 0; transform: translateY(
|
| 78 |
to { opacity: 1; transform: translateY(0); }
|
| 79 |
}
|
| 80 |
</style>
|
| 81 |
""", unsafe_allow_html=True)
|
| 82 |
|
| 83 |
-
|
|
|
|
| 84 |
with col2:
|
| 85 |
-
st.image("log.png", width=
|
| 86 |
|
| 87 |
st.markdown("""
|
| 88 |
<div class="header-text">
|
| 89 |
<h1>رزم یار ارتش</h1>
|
| 90 |
-
<div class="subtitle">دستیار
|
| 91 |
</div>
|
| 92 |
""", unsafe_allow_html=True)
|
| 93 |
|
|
|
|
| 11 |
from together import Together
|
| 12 |
|
| 13 |
# ----------------- تنظیمات صفحه -----------------
|
| 14 |
+
import streamlit as st
|
| 15 |
+
|
| 16 |
st.set_page_config(page_title="رزم یار ارتش", page_icon="🪖", layout="wide")
|
| 17 |
|
| 18 |
st.markdown("""
|
| 19 |
<style>
|
| 20 |
+
/* فونت و راستچین */
|
| 21 |
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;700&display=swap');
|
| 22 |
html, body, [class*="css"] {
|
| 23 |
font-family: 'Vazirmatn', Tahoma, sans-serif;
|
| 24 |
direction: rtl;
|
| 25 |
text-align: right;
|
| 26 |
+
background-color: #f0f4f7;
|
| 27 |
}
|
| 28 |
+
|
| 29 |
+
/* پس زمینه صفحه اصلی */
|
| 30 |
.stApp {
|
| 31 |
+
background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
|
| 32 |
+
url("./military_bg.jpeg") no-repeat center center fixed;
|
| 33 |
background-size: cover;
|
| 34 |
backdrop-filter: blur(2px);
|
| 35 |
}
|
| 36 |
+
|
| 37 |
+
/* استایل پیامهای چت */
|
| 38 |
.stChatMessage {
|
| 39 |
+
background-color: rgba(255, 255, 255, 0.85);
|
| 40 |
+
border: 2px solid #4e8a3e;
|
| 41 |
+
border-radius: 16px;
|
| 42 |
+
padding: 18px;
|
| 43 |
+
margin-bottom: 18px;
|
| 44 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.3);
|
| 45 |
+
animation: fadeIn 0.5s ease-in-out;
|
| 46 |
}
|
| 47 |
+
|
| 48 |
+
/* استایل ورودی کاربر */
|
| 49 |
.stTextInput > div > input, .stTextArea textarea {
|
| 50 |
+
background-color: rgba(255, 255, 255, 0.95) !important;
|
| 51 |
+
border: 1px solid #ccc !important;
|
| 52 |
+
border-radius: 10px !important;
|
| 53 |
+
padding: 10px;
|
| 54 |
direction: rtl;
|
| 55 |
text-align: right;
|
| 56 |
font-family: 'Vazirmatn', Tahoma;
|
| 57 |
+
font-size: 16px;
|
| 58 |
}
|
| 59 |
+
|
| 60 |
+
/* استایل دکمه */
|
| 61 |
.stButton>button {
|
| 62 |
background-color: #4e8a3e !important;
|
| 63 |
color: white !important;
|
| 64 |
font-weight: bold;
|
| 65 |
+
border-radius: 12px;
|
| 66 |
+
padding: 10px 24px;
|
| 67 |
+
transition: all 0.3s ease;
|
| 68 |
+
font-size: 16px;
|
| 69 |
}
|
| 70 |
.stButton>button:hover {
|
| 71 |
background-color: #3c6d30 !important;
|
| 72 |
+
transform: scale(1.05);
|
| 73 |
}
|
| 74 |
+
|
| 75 |
+
/* سربرگ اصلی */
|
| 76 |
.header-text {
|
| 77 |
text-align: center;
|
| 78 |
+
margin-top: 30px;
|
| 79 |
margin-bottom: 40px;
|
| 80 |
+
background-color: rgba(255, 255, 255, 0.8);
|
| 81 |
+
padding: 30px;
|
| 82 |
+
border-radius: 24px;
|
| 83 |
+
box-shadow: 0 6px 16px rgba(0,0,0,0.25);
|
| 84 |
+
animation: fadeIn 0.6s ease-in-out;
|
| 85 |
}
|
| 86 |
.header-text h1 {
|
| 87 |
+
font-size: 48px;
|
| 88 |
color: #2c3e50;
|
| 89 |
margin: 0;
|
| 90 |
+
font-weight: 900;
|
| 91 |
}
|
| 92 |
.subtitle {
|
| 93 |
+
font-size: 20px;
|
| 94 |
color: #34495e;
|
| 95 |
+
margin-top: 10px;
|
| 96 |
+
font-weight: bold;
|
| 97 |
}
|
| 98 |
+
|
| 99 |
+
/* انیمیشن */
|
| 100 |
@keyframes fadeIn {
|
| 101 |
+
from { opacity: 0; transform: translateY(20px); }
|
| 102 |
to { opacity: 1; transform: translateY(0); }
|
| 103 |
}
|
| 104 |
</style>
|
| 105 |
""", unsafe_allow_html=True)
|
| 106 |
|
| 107 |
+
# ----------------- سربرگ با لوگو -----------------
|
| 108 |
+
col1, col2, col3 = st.columns([1, 0.5, 1])
|
| 109 |
with col2:
|
| 110 |
+
st.image("log.png", width=220)
|
| 111 |
|
| 112 |
st.markdown("""
|
| 113 |
<div class="header-text">
|
| 114 |
<h1>رزم یار ارتش</h1>
|
| 115 |
+
<div class="subtitle">دستیار هوشمند نیروهای مسلح</div>
|
| 116 |
</div>
|
| 117 |
""", unsafe_allow_html=True)
|
| 118 |
|