awacke1 commited on
Commit
3b1655c
β€’
1 Parent(s): b2c222d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -5
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import streamlit as st
2
 
3
- # Function to generate HTML with textarea
4
  def generate_html_with_textarea(text_to_speak):
5
  return f'''
6
  <!DOCTYPE html>
@@ -17,7 +17,7 @@ def generate_html_with_textarea(text_to_speak):
17
  </head>
18
  <body>
19
  <h1>πŸ”Š Read It Aloud</h1>
20
- <textarea id="textArea" rows="10" cols="80">
21
  {text_to_speak}
22
  </textarea>
23
  <br>
@@ -38,9 +38,10 @@ for i, (game, icon) in enumerate(zip(games, icons)):
38
 
39
  # Expanders for each game to outline map rules or strategies
40
  with st.expander(f"See Map Building & Gamification Strategy for {game}"):
41
- # Defining text for each game's map strategy to use as a variable
42
  text_to_speak = ""
43
-
 
 
44
  if game == 'Terraforming Mars':
45
  text_to_speak = "πŸͺπŸ’‘ **Terraforming Mars** \n1️⃣ πŸŒ±πŸ’§ Opt for plant-heavy and water tiles \n2️⃣ πŸ­πŸŒ‹ Position factories near volcanic areas \n3️⃣ πŸŒπŸ’‘ Control key parameters and energy grid \n4️⃣ πŸ›€οΈπŸŒ‘οΈ Connect colonies and temperature control \n5️⃣ πŸš€πŸŽ― Upgrade spaceports and aim for synergies."
46
  st.markdown(text_to_speak)
@@ -81,6 +82,15 @@ for i, (game, icon) in enumerate(zip(games, icons)):
81
  text_to_speak = "πŸ­πŸ›€οΈ **Brass Birmingham** \n1️⃣ πŸ­πŸ›€οΈ Industry and canal routes \n2️⃣ πŸ“ˆπŸΊ Economic management and beer supply \n3️⃣ πŸ› οΈπŸ—ΊοΈ Optimize developments and map control \n4️⃣ πŸ€πŸ’‘ Partnerships and market strategy \n5️⃣ πŸš‚πŸ† Railroads and victory points."
82
  st.markdown(text_to_speak)
83
 
84
- # Button to read the strategies aloud
 
 
 
85
  if st.button(f"πŸ”Š Read {game}'s Strategies Aloud"):
 
86
  st.markdown(generate_html_with_textarea(text_to_speak), unsafe_allow_html=True)
 
 
 
 
 
 
1
  import streamlit as st
2
 
3
+ # Function to generate HTML with textarea for speech synthesis
4
  def generate_html_with_textarea(text_to_speak):
5
  return f'''
6
  <!DOCTYPE html>
 
17
  </head>
18
  <body>
19
  <h1>πŸ”Š Read It Aloud</h1>
20
+ <textarea id="textArea" rows="10" cols="80" readonly>
21
  {text_to_speak}
22
  </textarea>
23
  <br>
 
38
 
39
  # Expanders for each game to outline map rules or strategies
40
  with st.expander(f"See Map Building & Gamification Strategy for {game}"):
 
41
  text_to_speak = ""
42
+
43
+ # ... Cut here for content change!
44
+
45
  if game == 'Terraforming Mars':
46
  text_to_speak = "πŸͺπŸ’‘ **Terraforming Mars** \n1️⃣ πŸŒ±πŸ’§ Opt for plant-heavy and water tiles \n2️⃣ πŸ­πŸŒ‹ Position factories near volcanic areas \n3️⃣ πŸŒπŸ’‘ Control key parameters and energy grid \n4️⃣ πŸ›€οΈπŸŒ‘οΈ Connect colonies and temperature control \n5️⃣ πŸš€πŸŽ― Upgrade spaceports and aim for synergies."
47
  st.markdown(text_to_speak)
 
82
  text_to_speak = "πŸ­πŸ›€οΈ **Brass Birmingham** \n1️⃣ πŸ­πŸ›€οΈ Industry and canal routes \n2️⃣ πŸ“ˆπŸΊ Economic management and beer supply \n3️⃣ πŸ› οΈπŸ—ΊοΈ Optimize developments and map control \n4️⃣ πŸ€πŸ’‘ Partnerships and market strategy \n5️⃣ πŸš‚πŸ† Railroads and victory points."
83
  st.markdown(text_to_speak)
84
 
85
+ # ... Cut here for content change!
86
+
87
+
88
+
89
  if st.button(f"πŸ”Š Read {game}'s Strategies Aloud"):
90
+ st.markdown(text_to_speak)
91
  st.markdown(generate_html_with_textarea(text_to_speak), unsafe_allow_html=True)
92
+
93
+
94
+
95
+
96
+