Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,9 @@
|
|
1 |
import streamlit as st
|
|
|
2 |
|
3 |
# Function to generate HTML with textarea for speech synthesis
|
4 |
-
def
|
5 |
-
|
6 |
<!DOCTYPE html>
|
7 |
<html>
|
8 |
<head>
|
@@ -25,7 +26,8 @@ def generate_html_with_textarea(text_to_speak):
|
|
25 |
</body>
|
26 |
</html>
|
27 |
'''
|
28 |
-
|
|
|
29 |
# Game list and associated icons
|
30 |
games = ['Terraforming Mars', 'Twilight Imperium (Fourth Edition)', 'Scythe', 'Eclipse', 'Small World', 'Risk Legacy', 'Axis & Allies', 'Diplomacy', 'Pandemic Legacy: Season 1', 'Brass: Birmingham']
|
31 |
icons = ['πͺ', 'π', 'π€', 'π', 'π§ββοΈ', 'πΊοΈ', 'βοΈ', 'π€', 'π¦ ', 'π']
|
@@ -88,7 +90,8 @@ for i, (game, icon) in enumerate(zip(games, icons)):
|
|
88 |
|
89 |
if st.button(f"π Read {game}'s Strategies Aloud"):
|
90 |
st.markdown(text_to_speak)
|
91 |
-
|
|
|
92 |
|
93 |
|
94 |
|
|
|
1 |
import streamlit as st
|
2 |
+
import streamlit.components.v1 as components
|
3 |
|
4 |
# Function to generate HTML with textarea for speech synthesis
|
5 |
+
def generate_speech_textarea(text_to_speak):
|
6 |
+
documentHTML5 = '''
|
7 |
<!DOCTYPE html>
|
8 |
<html>
|
9 |
<head>
|
|
|
26 |
</body>
|
27 |
</html>
|
28 |
'''
|
29 |
+
components.html(documentHTML5, width=1280, height=1024)
|
30 |
+
|
31 |
# Game list and associated icons
|
32 |
games = ['Terraforming Mars', 'Twilight Imperium (Fourth Edition)', 'Scythe', 'Eclipse', 'Small World', 'Risk Legacy', 'Axis & Allies', 'Diplomacy', 'Pandemic Legacy: Season 1', 'Brass: Birmingham']
|
33 |
icons = ['πͺ', 'π', 'π€', 'π', 'π§ββοΈ', 'πΊοΈ', 'βοΈ', 'π€', 'π¦ ', 'π']
|
|
|
90 |
|
91 |
if st.button(f"π Read {game}'s Strategies Aloud"):
|
92 |
st.markdown(text_to_speak)
|
93 |
+
generate_speech_textarea(text_to_speak)
|
94 |
+
#st.markdown(text, unsafe_allow_html=True)
|
95 |
|
96 |
|
97 |
|