M17idd commited on
Commit
8f6f0d7
·
1 Parent(s): 9f7fa28

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +80 -37
app.py CHANGED
@@ -12,6 +12,8 @@ from together import Together
12
 
13
  import streamlit as st
14
 
 
 
15
  # ----------------- تنظیمات صفحه -----------------
16
  st.set_page_config(page_title="رزم یار ارتش", page_icon="🪖", layout="wide")
17
 
@@ -31,51 +33,54 @@ st.markdown("""
31
  .sidebar .sidebar-content {
32
  background-color: #ffffff;
33
  border-left: 2px solid #4e8a3e;
34
- padding-top: 20px;
35
  }
36
  .sidebar .sidebar-content div {
37
- margin-bottom: 20px;
38
  font-weight: bold;
39
  color: #2c3e50;
 
40
  }
41
  .stButton>button {
42
  background-color: #4e8a3e !important;
43
  color: white !important;
44
  font-weight: bold;
45
- border-radius: 10px;
46
- padding: 8px 20px;
47
  transition: 0.3s;
 
48
  }
49
  .stButton>button:hover {
50
  background-color: #3c6d30 !important;
51
  }
52
  .header-text {
53
  text-align: center;
54
- margin-top: 20px;
55
- margin-bottom: 40px;
56
- background-color: rgba(255, 255, 255, 0.8);
57
- padding: 20px;
58
- border-radius: 20px;
59
- box-shadow: 0 4px 12px rgba(0,0,0,0.15);
60
  }
61
  .header-text h1 {
62
- font-size: 42px;
63
  color: #2c3e50;
64
  margin: 0;
65
  font-weight: bold;
66
  }
67
  .subtitle {
68
- font-size: 18px;
69
  color: #34495e;
70
- margin-top: 8px;
71
  }
72
  .chat-message {
73
- background-color: rgba(255, 255, 255, 0.9);
74
  border: 1px solid #4e8a3e;
75
  border-radius: 12px;
76
- padding: 16px;
77
- margin-bottom: 15px;
78
- box-shadow: 0 4px 8px rgba(0,0,0,0.1);
 
79
  }
80
  .stTextInput>div>input, .stTextArea textarea {
81
  background-color: rgba(255,255,255,0.9) !important;
@@ -84,31 +89,69 @@ st.markdown("""
84
  text-align: right;
85
  font-family: 'Vazirmatn', Tahoma;
86
  }
87
- @keyframes fadeIn {
88
- from { opacity: 0; transform: translateY(10px); }
89
- to { opacity: 1; transform: translateY(0); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  }
91
  </style>
92
  """, unsafe_allow_html=True)
93
 
94
  # ----------------- بدنه اصلی -----------------
95
  with st.sidebar:
96
- st.image("log.png", width=180)
97
- st.markdown("### 🛡️ منو")
98
- st.button("گفتگوی جدید")
99
- st.button("تاریخچه")
100
- st.markdown("---")
101
- st.markdown("### 📚 مدل‌های هوش مصنوعی")
102
- st.button("مدل ها")
103
- st.markdown("### ✍️ تولید محتوا")
104
- st.button("متن و تصویر")
105
- st.markdown("### 🧭 دستیارها")
106
- st.button("دستیار ویژه")
107
- st.markdown("### 🛠️ ابزارها")
108
- st.button("ابزار مالی")
109
- st.markdown("---")
110
- st.button("⚙️ تنظیمات")
111
- st.button("❓ پشتیبانی")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
 
113
  # محتوای اصلی
114
  st.markdown("""
@@ -120,7 +163,7 @@ st.markdown("""
120
 
121
  st.markdown('<div class="chat-message">👋 سلام! چطور میتونم کمکتون کنم؟</div>', unsafe_allow_html=True)
122
 
123
- # کادر چت کاربر
124
  user_input = st.text_input("پیام خود را وارد کنید...")
125
 
126
  if user_input:
 
12
 
13
  import streamlit as st
14
 
15
+ import streamlit as st
16
+
17
  # ----------------- تنظیمات صفحه -----------------
18
  st.set_page_config(page_title="رزم یار ارتش", page_icon="🪖", layout="wide")
19
 
 
33
  .sidebar .sidebar-content {
34
  background-color: #ffffff;
35
  border-left: 2px solid #4e8a3e;
36
+ padding-top: 10px;
37
  }
38
  .sidebar .sidebar-content div {
39
+ margin-bottom: 10px;
40
  font-weight: bold;
41
  color: #2c3e50;
42
+ font-size: 15px;
43
  }
44
  .stButton>button {
45
  background-color: #4e8a3e !important;
46
  color: white !important;
47
  font-weight: bold;
48
+ border-radius: 8px;
49
+ padding: 5px 16px;
50
  transition: 0.3s;
51
+ font-size: 14px;
52
  }
53
  .stButton>button:hover {
54
  background-color: #3c6d30 !important;
55
  }
56
  .header-text {
57
  text-align: center;
58
+ margin-top: 15px;
59
+ margin-bottom: 25px;
60
+ background-color: rgba(255, 255, 255, 0.85);
61
+ padding: 16px;
62
+ border-radius: 16px;
63
+ box-shadow: 0 4px 10px rgba(0,0,0,0.1);
64
  }
65
  .header-text h1 {
66
+ font-size: 36px;
67
  color: #2c3e50;
68
  margin: 0;
69
  font-weight: bold;
70
  }
71
  .subtitle {
72
+ font-size: 16px;
73
  color: #34495e;
74
+ margin-top: 5px;
75
  }
76
  .chat-message {
77
+ background-color: rgba(255, 255, 255, 0.95);
78
  border: 1px solid #4e8a3e;
79
  border-radius: 12px;
80
+ padding: 14px;
81
+ margin-bottom: 10px;
82
+ box-shadow: 0 4px 8px rgba(0,0,0,0.08);
83
+ animation: fadeIn 0.5s ease;
84
  }
85
  .stTextInput>div>input, .stTextArea textarea {
86
  background-color: rgba(255,255,255,0.9) !important;
 
89
  text-align: right;
90
  font-family: 'Vazirmatn', Tahoma;
91
  }
92
+ img.small-logo {
93
+ width: 90px;
94
+ margin-bottom: 15px;
95
+ display: block;
96
+ margin-right: auto;
97
+ margin-left: auto;
98
+ }
99
+ .menu-item {
100
+ display: flex;
101
+ align-items: center;
102
+ gap: 8px;
103
+ padding: 6px 0;
104
+ font-size: 15px;
105
+ cursor: pointer;
106
+ }
107
+ .menu-item img {
108
+ width: 20px;
109
+ height: 20px;
110
  }
111
  </style>
112
  """, unsafe_allow_html=True)
113
 
114
  # ----------------- بدنه اصلی -----------------
115
  with st.sidebar:
116
+ st.image("log.png", class_="small-logo")
117
+
118
+ st.markdown("""
119
+ <div class="menu-item">
120
+ <img src="https://cdn-icons-png.flaticon.com/512/3596/3596165.png" />
121
+ گفتگوی جدید
122
+ </div>
123
+ <div class="menu-item">
124
+ <img src="https://cdn-icons-png.flaticon.com/512/709/709496.png" />
125
+ تاریخچه
126
+ </div>
127
+ <hr/>
128
+ <div class="menu-item">
129
+ <img src="https://cdn-icons-png.flaticon.com/512/1828/1828932.png" />
130
+ مدل‌های هوش مصنوعی
131
+ </div>
132
+ <div class="menu-item">
133
+ <img src="https://cdn-icons-png.flaticon.com/512/681/681494.png" />
134
+ تولید محتوا
135
+ </div>
136
+ <hr/>
137
+ <div class="menu-item">
138
+ <img src="https://cdn-icons-png.flaticon.com/512/3601/3601646.png" />
139
+ دستیار ویژه
140
+ </div>
141
+ <div class="menu-item">
142
+ <img src="https://cdn-icons-png.flaticon.com/512/709/709612.png" />
143
+ ابزار مالی
144
+ </div>
145
+ <hr/>
146
+ <div class="menu-item">
147
+ <img src="https://cdn-icons-png.flaticon.com/512/2099/2099058.png" />
148
+ تنظیمات
149
+ </div>
150
+ <div class="menu-item">
151
+ <img src="https://cdn-icons-png.flaticon.com/512/597/597177.png" />
152
+ پشتیبانی
153
+ </div>
154
+ """, unsafe_allow_html=True)
155
 
156
  # محتوای اصلی
157
  st.markdown("""
 
163
 
164
  st.markdown('<div class="chat-message">👋 سلام! چطور میتونم کمکتون کنم؟</div>', unsafe_allow_html=True)
165
 
166
+ # چت اینپوت کاربر
167
  user_input = st.text_input("پیام خود را وارد کنید...")
168
 
169
  if user_input: