Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,16 +14,16 @@ body {
|
|
14 |
background-color: #000000;
|
15 |
}
|
16 |
.sidebar .sidebar-content {
|
17 |
-
background-color: #
|
18 |
padding: 0.5rem 0 0 0;
|
19 |
}
|
20 |
header, #MainMenu, footer {visibility: hidden;}
|
21 |
.category-button {
|
22 |
-
background-color: #
|
23 |
color: #FFFFFF;
|
24 |
border: none;
|
25 |
text-align: left;
|
26 |
-
font-size:
|
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: #
|
35 |
}
|
36 |
.category-button:focus {
|
37 |
outline: none;
|
38 |
}
|
39 |
.selected-category {
|
40 |
-
background-color: #
|
41 |
color: #FFFFFF !important;
|
42 |
}
|
43 |
.submenu-button {
|
44 |
-
background-color: #
|
45 |
color: #FFFFFF;
|
46 |
border: none;
|
47 |
text-align: left;
|
48 |
-
font-size:
|
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: #
|
56 |
}
|
57 |
.submenu-button:focus {
|
58 |
outline: none;
|
59 |
}
|
60 |
.selected-submenu {
|
61 |
-
background-color: #
|
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.
|
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",
|
148 |
-
"FLUXLoRA์คํ๋์ค ์๋ฒ#2": "https://fantaxy-flxloraexp.hf.space",
|
149 |
-
"FLUXLoRA์คํ๋์ค ์๋ฒ#3": "https://fantos-flxloraexp.hf.space",
|
150 |
-
"FLUXLoRA์คํ๋์ค ์๋ฒ#4": "https://ginipick-flxloraexp.hf.space",
|
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)
|