aiqtech commited on
Commit
df7b8bc
ยท
verified ยท
1 Parent(s): 8f12ca4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -23
app.py CHANGED
@@ -14,16 +14,16 @@ body {
14
  background-color: #000000;
15
  }
16
  .sidebar .sidebar-content {
17
- background-color: #1A1A1A !important;
18
  padding: 0.5rem 0 0 0;
19
  }
20
  header, #MainMenu, footer {visibility: hidden;}
21
  .category-button {
22
- background-color: #222222;
23
  color: #FFFFFF;
24
  border: none;
25
  text-align: left;
26
- font-size: 1.1rem;
27
  font-weight: bold;
28
  padding: 10px 10px 10px 15px;
29
  width: 100%;
@@ -31,34 +31,34 @@ header, #MainMenu, footer {visibility: hidden;}
31
  transition: background-color 0.3s;
32
  }
33
  .category-button:hover {
34
- background-color: #333333;
35
  }
36
  .category-button:focus {
37
  outline: none;
38
  }
39
  .selected-category {
40
- background-color: #444444 !important;
41
  color: #FFFFFF !important;
42
  }
43
  .submenu-button {
44
- background-color: #2A2A2A;
45
  color: #FFFFFF;
46
  border: none;
47
  text-align: left;
48
- font-size: 1rem;
49
  padding: 6px 6px 6px 25px;
50
  width: 100%;
51
  margin: 0;
52
  transition: background-color 0.3s;
53
  }
54
  .submenu-button:hover {
55
- background-color: #3A3A3A;
56
  }
57
  .submenu-button:focus {
58
  outline: none;
59
  }
60
  .selected-submenu {
61
- background-color: #4A4A4A !important;
62
  color: #FFFFFF !important;
63
  font-weight: bold;
64
  }
@@ -79,11 +79,6 @@ st.set_page_config(
79
  # Apply CSS
80
  st.markdown(f"<style>{css}</style>", unsafe_allow_html=True)
81
 
82
- # Sidebar menu
83
- st.sidebar.markdown('<h1 style="margin-left: 15px;">๋ฉ”๋‰ด</h1>', unsafe_allow_html=True)
84
-
85
-
86
-
87
  # Menu structure (can be easily extended for multi-language support)
88
  menu_structure = {
89
  "๋ฒ ์ŠคํŠธ TOP 10": ["FLUX LoRA ์ŠคํŠœ๋””์˜ค", "[์„œ์น˜+VisionLLM] ํ•œ๊ตญ์–ด JinJavis","FLUX ํ™•์žฅ ์ด๋ฏธ์ง€ ์ƒ์„ฑ","์ด๋ฏธ์ง€์™€ ํ•œ๊ธ€ ํ”„๋กฌํ”„ํŠธ๋กœ ์ด๋ฏธ์ง€ ๋ณ€ํ˜•","LOGO ๋””์ž์ธ ์ƒ์„ฑ","FLUX GIF ์ƒ์„ฑ","์ด๋ฏธ์ง€์™€ ํ”„๋กฌํ”„ํŠธ๋กœ ์˜์ƒ ์ƒ์„ฑ","ํ…์ŠคํŠธ๋กœ ๊ฐ์ฒด๋งŒ ์ž˜๋ผ๋‚ด๊ณ  ๋ฐฐ๊ฒฝ ํˆฌ๋ช…ํ™”","์ƒํ’ˆ ์‚ฌ์ง„ ์—…๋กœ๋“œ+ํ”„๋กฌํ”„ํŠธ๋กœ ๋ฐฐ๊ฒฝ์„ ํ•ฉ์„ฑ","EveryText: ๋ชจ๋“  ๋ฌธ์ž๊ฐ€ ์ด๋ฏธ์ง€ ์ƒ์„ฑ์— ๋ฐ˜์˜"],
@@ -114,7 +109,7 @@ def select_item(item):
114
  st.session_state.selected_item = item
115
 
116
  # Sidebar menu
117
- st.sidebar.title("๋ฉ”๋‰ด")
118
 
119
  for category, items in menu_structure.items():
120
  is_expanded = st.session_state.expanded_category == category
@@ -144,10 +139,10 @@ content_map = {
144
  "์ƒํ’ˆ ์‚ฌ์ง„ ์—…๋กœ๋“œ+ํ”„๋กฌํ”„ํŠธ๋กœ ๋ฐฐ๊ฒฝ์„ ํ•ฉ์„ฑ": "https://aiqtech-producbrmg.hf.space",
145
  "EveryText: ๋ชจ๋“  ๋ฌธ์ž๊ฐ€ ์ด๋ฏธ์ง€ ์ƒ์„ฑ์— ๋ฐ˜์˜": "https://fantos-EveryText.hf.space",
146
 
147
- "FLUXLoRA์ŠคํŠœ๋””์˜ค ์„œ๋ฒ„#1": "https://seawolf2357-flxloraexp.hf.space", #(person)
148
- "FLUXLoRA์ŠคํŠœ๋””์˜ค ์„œ๋ฒ„#2": "https://fantaxy-flxloraexp.hf.space", #(eric)
149
- "FLUXLoRA์ŠคํŠœ๋””์˜ค ์„œ๋ฒ„#3": "https://fantos-flxloraexp.hf.space", #(rolls)
150
- "FLUXLoRA์ŠคํŠœ๋””์˜ค ์„œ๋ฒ„#4": "https://ginipick-flxloraexp.hf.space", #(wolf)
151
 
152
  "FLUX LoRA ์ŠคํŠœ๋””์˜ค": "https://fantos-flxloraexp.hf.space",
153
  "FLUX ํ™•์žฅ ์ด๋ฏธ์ง€ ์ƒ์„ฑ": "https://fantaxy-ofai-flx-expl-store.hf.space",
@@ -197,7 +192,6 @@ content_map = {
197
  "์˜ํ•™ ์ „๋ฌธ ๋ธ”๋กœ๊ทธ ์ƒ์„ฑ": "https://seawolf2357-ofai-jinjavis-blog-medi.hf.space",
198
  "์•ฝ๋ฆฌํ•™ ์ „๋ฌธ ๋ธ”๋กœ๊ทธ ์ƒ์„ฑ": "https://seawolf2357-ofai-jinjavis-blog-pharm.hf.space" ,
199
 
200
-
201
  "๋ธ”๋กœ๊ทธ ์ž๋™(์ปจํŽŒ/๋‹จ์ˆ˜) ์ƒ์„ฑ": "https://fantaxy-blogger-send-webhook-confirm-image.hf.space",
202
  "๋ธ”๋กœ๊ทธ ์ž๋™(๋ฌด์ธ/๋ณต์ˆ˜) ์ƒ์„ฑ": "https://fantaxy-blogger-send-webhook-auto-image.hf.space" ,
203
 
@@ -206,13 +200,13 @@ content_map = {
206
 
207
  if st.session_state.selected_item in content_map:
208
  main_content.markdown(
209
- f'<iframe src="{content_map[st.session_state.selected_item]}" width="100%" height="800" frameborder="0"></iframe>',
210
  unsafe_allow_html=True
211
  )
212
  else:
213
  main_content.markdown("<h2>๋ฉ”๋‰ด์—์„œ ํ•ญ๋ชฉ์„ ์„ ํƒํ•˜์„ธ์š”.</h2>")
214
 
215
- # Add JavaScript for dynamic iframe resizing
216
  st.markdown("""
217
  <script>
218
  function resizeIframe() {
@@ -221,7 +215,16 @@ function resizeIframe() {
221
  iframe.style.height = window.innerHeight + 'px';
222
  }
223
  }
 
 
 
 
 
 
 
 
224
  window.addEventListener('resize', resizeIframe);
225
  resizeIframe();
 
226
  </script>
227
- """, unsafe_allow_html=True)
 
14
  background-color: #000000;
15
  }
16
  .sidebar .sidebar-content {
17
+ background-color: #050505 !important;
18
  padding: 0.5rem 0 0 0;
19
  }
20
  header, #MainMenu, footer {visibility: hidden;}
21
  .category-button {
22
+ background-color: #0A0A0A;
23
  color: #FFFFFF;
24
  border: none;
25
  text-align: left;
26
+ font-size: 0.77rem;
27
  font-weight: bold;
28
  padding: 10px 10px 10px 15px;
29
  width: 100%;
 
31
  transition: background-color 0.3s;
32
  }
33
  .category-button:hover {
34
+ background-color: #0F0F0F;
35
  }
36
  .category-button:focus {
37
  outline: none;
38
  }
39
  .selected-category {
40
+ background-color: #151515 !important;
41
  color: #FFFFFF !important;
42
  }
43
  .submenu-button {
44
+ background-color: #0C0C0C;
45
  color: #FFFFFF;
46
  border: none;
47
  text-align: left;
48
+ font-size: 0.7rem;
49
  padding: 6px 6px 6px 25px;
50
  width: 100%;
51
  margin: 0;
52
  transition: background-color 0.3s;
53
  }
54
  .submenu-button:hover {
55
+ background-color: #111111;
56
  }
57
  .submenu-button:focus {
58
  outline: none;
59
  }
60
  .selected-submenu {
61
+ background-color: #181818 !important;
62
  color: #FFFFFF !important;
63
  font-weight: bold;
64
  }
 
79
  # Apply CSS
80
  st.markdown(f"<style>{css}</style>", unsafe_allow_html=True)
81
 
 
 
 
 
 
82
  # Menu structure (can be easily extended for multi-language support)
83
  menu_structure = {
84
  "๋ฒ ์ŠคํŠธ TOP 10": ["FLUX LoRA ์ŠคํŠœ๋””์˜ค", "[์„œ์น˜+VisionLLM] ํ•œ๊ตญ์–ด JinJavis","FLUX ํ™•์žฅ ์ด๋ฏธ์ง€ ์ƒ์„ฑ","์ด๋ฏธ์ง€์™€ ํ•œ๊ธ€ ํ”„๋กฌํ”„ํŠธ๋กœ ์ด๋ฏธ์ง€ ๋ณ€ํ˜•","LOGO ๋””์ž์ธ ์ƒ์„ฑ","FLUX GIF ์ƒ์„ฑ","์ด๋ฏธ์ง€์™€ ํ”„๋กฌํ”„ํŠธ๋กœ ์˜์ƒ ์ƒ์„ฑ","ํ…์ŠคํŠธ๋กœ ๊ฐ์ฒด๋งŒ ์ž˜๋ผ๋‚ด๊ณ  ๋ฐฐ๊ฒฝ ํˆฌ๋ช…ํ™”","์ƒํ’ˆ ์‚ฌ์ง„ ์—…๋กœ๋“œ+ํ”„๋กฌํ”„ํŠธ๋กœ ๋ฐฐ๊ฒฝ์„ ํ•ฉ์„ฑ","EveryText: ๋ชจ๋“  ๋ฌธ์ž๊ฐ€ ์ด๋ฏธ์ง€ ์ƒ์„ฑ์— ๋ฐ˜์˜"],
 
109
  st.session_state.selected_item = item
110
 
111
  # Sidebar menu
112
+ st.sidebar.markdown('<h1 style="font-size: 1.4rem; margin-left: 15px;">๋ฉ”๋‰ด</h1>', unsafe_allow_html=True)
113
 
114
  for category, items in menu_structure.items():
115
  is_expanded = st.session_state.expanded_category == category
 
139
  "์ƒํ’ˆ ์‚ฌ์ง„ ์—…๋กœ๋“œ+ํ”„๋กฌํ”„ํŠธ๋กœ ๋ฐฐ๊ฒฝ์„ ํ•ฉ์„ฑ": "https://aiqtech-producbrmg.hf.space",
140
  "EveryText: ๋ชจ๋“  ๋ฌธ์ž๊ฐ€ ์ด๋ฏธ์ง€ ์ƒ์„ฑ์— ๋ฐ˜์˜": "https://fantos-EveryText.hf.space",
141
 
142
+ "FLUXLoRA์ŠคํŠœ๋””์˜ค ์„œ๋ฒ„#1": "https://seawolf2357-flxloraexp.hf.space",
143
+ "FLUXLoRA์ŠคํŠœ๋””์˜ค ์„œ๋ฒ„#2": "https://fantaxy-flxloraexp.hf.space",
144
+ "FLUXLoRA์ŠคํŠœ๋””์˜ค ์„œ๋ฒ„#3": "https://fantos-flxloraexp.hf.space",
145
+ "FLUXLoRA์ŠคํŠœ๋””์˜ค ์„œ๋ฒ„#4": "https://ginipick-flxloraexp.hf.space",
146
 
147
  "FLUX LoRA ์ŠคํŠœ๋””์˜ค": "https://fantos-flxloraexp.hf.space",
148
  "FLUX ํ™•์žฅ ์ด๋ฏธ์ง€ ์ƒ์„ฑ": "https://fantaxy-ofai-flx-expl-store.hf.space",
 
192
  "์˜ํ•™ ์ „๋ฌธ ๋ธ”๋กœ๊ทธ ์ƒ์„ฑ": "https://seawolf2357-ofai-jinjavis-blog-medi.hf.space",
193
  "์•ฝ๋ฆฌํ•™ ์ „๋ฌธ ๋ธ”๋กœ๊ทธ ์ƒ์„ฑ": "https://seawolf2357-ofai-jinjavis-blog-pharm.hf.space" ,
194
 
 
195
  "๋ธ”๋กœ๊ทธ ์ž๋™(์ปจํŽŒ/๋‹จ์ˆ˜) ์ƒ์„ฑ": "https://fantaxy-blogger-send-webhook-confirm-image.hf.space",
196
  "๋ธ”๋กœ๊ทธ ์ž๋™(๋ฌด์ธ/๋ณต์ˆ˜) ์ƒ์„ฑ": "https://fantaxy-blogger-send-webhook-auto-image.hf.space" ,
197
 
 
200
 
201
  if st.session_state.selected_item in content_map:
202
  main_content.markdown(
203
+ f'<iframe src="{content_map[st.session_state.selected_item]}" width="100%" height="800" frameborder="0" allow="microphone"></iframe>',
204
  unsafe_allow_html=True
205
  )
206
  else:
207
  main_content.markdown("<h2>๋ฉ”๋‰ด์—์„œ ํ•ญ๋ชฉ์„ ์„ ํƒํ•˜์„ธ์š”.</h2>")
208
 
209
+ # Add JavaScript for dynamic iframe resizing and microphone permission
210
  st.markdown("""
211
  <script>
212
  function resizeIframe() {
 
215
  iframe.style.height = window.innerHeight + 'px';
216
  }
217
  }
218
+ async function requestMicrophonePermission() {
219
+ try {
220
+ await navigator.mediaDevices.getUserMedia({ audio: true });
221
+ console.log("Microphone permission granted");
222
+ } catch (err) {
223
+ console.error("Error requesting microphone permission:", err);
224
+ }
225
+ }
226
  window.addEventListener('resize', resizeIframe);
227
  resizeIframe();
228
+ requestMicrophonePermission();
229
  </script>
230
+ """, unsafe_allow_html=True)