M17idd commited on
Commit
60897a5
·
verified ·
1 Parent(s): c8c04c1

Update app.py

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