Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,51 +1,126 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
| 2 |
|
| 3 |
def main():
|
| 4 |
st.set_page_config(page_title="Storytelling Mastery", page_icon="๐", layout="wide")
|
| 5 |
|
| 6 |
st.title("๐ญ The Art of Storytelling: Master Guide ๐ญ")
|
| 7 |
|
| 8 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
storytelling_points = [
|
| 10 |
-
{"number": 1, "emoji": "๐ ", "keyword": "location", "description": "
|
| 11 |
-
{"number": 2, "emoji": "๐", "keyword": "actions", "description": "
|
| 12 |
-
{"number": 3, "emoji": "๐ง ", "keyword": "thoughts", "description": "
|
| 13 |
-
{"number": 4, "emoji": "๐ฒ", "keyword": "emotions", "description": "
|
| 14 |
-
{"number": 5, "emoji": "๐ฌ", "keyword": "dialogue", "description": "
|
| 15 |
-
|
| 16 |
-
{"number": 7, "emoji": "๐ฌ", "keyword": "transport", "description": "Transport your audience into the trenches of your story's crucial moments."},
|
| 17 |
-
{"number": 8, "emoji": "๐๏ธ", "keyword": "detail", "description": "Avoid excessive detail in setting descriptionsโlisteners will fill in their own versions."},
|
| 18 |
-
{"number": 9, "emoji": "โฉ", "keyword": "momentum", "description": "Create forward momentum by stating actions that move the story along."},
|
| 19 |
-
{"number": 10, "emoji": "๐๏ธ", "keyword": "visual", "description": "Make your stories visual by showing emotions through physical manifestations."},
|
| 20 |
-
{"number": 11, "emoji": "๐", "keyword": "listen", "description": "Listen to great storytellers like John Krasinski to learn effective techniques."},
|
| 21 |
-
{"number": 12, "emoji": "๐ฃ๏ธ", "keyword": "juicy", "description": "Keep dialogue juicy and conversational rather than formal or stilted."},
|
| 22 |
-
{"number": 13, "emoji": "๐คธ", "keyword": "simplify", "description": "Simplify your storytelling approachโit doesn't need to be complicated."},
|
| 23 |
-
{"number": 14, "emoji": "๐งฉ", "keyword": "essentials", "description": "Focus on the essentials that make stories compelling rather than unnecessary details."},
|
| 24 |
-
{"number": 15, "emoji": "๐ถ", "keyword": "walk", "description": "Walk listeners through your experience step by step rather than jumping around."},
|
| 25 |
-
{"number": 16, "emoji": "๐", "keyword": "journey", "description": "Create an emotional journey that takes listeners through various feelings."},
|
| 26 |
-
{"number": 17, "emoji": "๐ฏ", "keyword": "focused", "description": "Stay focused on the core elements that drive your narrative forward."},
|
| 27 |
-
{"number": 18, "emoji": "๐ค", "keyword": "neurotic", "description": "Share neurotic thoughts that reveal your humanity and create connection."},
|
| 28 |
-
{"number": 19, "emoji": "โก", "keyword": "crucial", "description": "Capture those crucial moments that define the heart of your story."},
|
| 29 |
-
{"number": 20, "emoji": "๐ง ", "keyword": "master", "description": "Master these five key elements: location, action, thoughts, emotions, and dialogue."}
|
| 30 |
]
|
| 31 |
|
| 32 |
-
#
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
]
|
| 38 |
|
| 39 |
-
|
| 40 |
-
st.
|
| 41 |
-
st.markdown(f"> \"{quotes[0]['text']}\" โ {quotes[0]['author']}")
|
| 42 |
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
| 45 |
|
| 46 |
-
st.markdown(
|
| 47 |
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
tab1, tab2, tab3 = st.tabs(["Vertical Flow", "Circular Layout", "Categorical Groups"])
|
| 50 |
|
| 51 |
with tab1:
|
|
@@ -63,196 +138,88 @@ def main():
|
|
| 63 |
mermaid_categories = generate_categorical_diagram(storytelling_points)
|
| 64 |
st.markdown(mermaid_categories, unsafe_allow_html=True)
|
| 65 |
|
| 66 |
-
# Interactive element selector
|
| 67 |
st.markdown("## ๐ Explore Individual Storytelling Elements")
|
| 68 |
-
|
| 69 |
col1, col2 = st.columns([1, 3])
|
| 70 |
|
| 71 |
with col1:
|
| 72 |
-
# Create options for the dropdown - combine emoji, number and keyword
|
| 73 |
options = [f"{point['number']}. {point['emoji']} {point['keyword'].capitalize()}" for point in storytelling_points]
|
| 74 |
selected_option = st.selectbox("Select an element to explore:", options)
|
| 75 |
-
|
| 76 |
-
# Get the selected point number
|
| 77 |
selected_number = int(selected_option.split('.')[0])
|
| 78 |
selected_point = next(point for point in storytelling_points if point['number'] == selected_number)
|
| 79 |
|
| 80 |
with col2:
|
| 81 |
st.markdown(f"### {selected_option}")
|
| 82 |
st.markdown(f"**Description:** {selected_point['description']}")
|
| 83 |
-
|
| 84 |
-
# Add examples based on the selected point
|
| 85 |
examples = {
|
| 86 |
-
1: "'
|
| 87 |
-
2: "'I
|
| 88 |
-
3: "
|
| 89 |
-
4: "
|
| 90 |
-
5: "
|
| 91 |
-
6: "John Krasinski didn't just say 'I met a customs agent who was surprised about my wife.' He zoomed into the specific exchange of dialogue.",
|
| 92 |
-
7: "'The moment I walked through those doors, the music stopped, all eyes turned to me, and I could feel my heart pounding against my chest.'",
|
| 93 |
-
8: "Simply saying 'conference room' is better than listing every piece of furniture and decor.",
|
| 94 |
-
9: "Use active verbs like 'I grabbed my phone, texted her quickly, and rushed out the door' instead of static descriptions.",
|
| 95 |
-
10: "'He kept tapping his pen on the table and glancing up at the clock every few seconds' creates a clear image of anxiety.",
|
| 96 |
-
11: "Notice how comedians like John Krasinski use timing, facial expressions, and precise dialogue to enhance their stories.",
|
| 97 |
-
12: "Use 'Yeah, that's crazy!' instead of 'Yes, that's quite extraordinary.'",
|
| 98 |
-
13: "Cut out unnecessary backstory and context that doesn't serve the core narrative.",
|
| 99 |
-
14: "Focus on the surprise revelation, the key decision moment, or the unexpected twist.",
|
| 100 |
-
15: "Walk through events chronologically or in a way that builds tension effectively.",
|
| 101 |
-
16: "Start with anticipation, build to frustration, then release with relief or humor.",
|
| 102 |
-
17: "If a detail doesn't serve the story's purpose or emotional impact, leave it out.",
|
| 103 |
-
18: "'I thought: Oh no, everyone's going to think I'm an absolute fraud now!'",
|
| 104 |
-
19: "Sarah Willingham's story focused on the moment the lawyer realized his mistakeโthe color draining from his face.",
|
| 105 |
-
20: "A complete story incorporates all five elements to create an immersive experience."
|
| 106 |
}
|
| 107 |
-
|
| 108 |
-
st.markdown(f"**Example:** {examples[selected_number]}")
|
| 109 |
|
| 110 |
-
|
| 111 |
-
st.markdown("## ๐ง The Five Pillars of Storytelling")
|
| 112 |
-
|
| 113 |
-
pillars = storytelling_points[:5] # First 5 points are the pillars
|
| 114 |
-
|
| 115 |
-
cols = st.columns(5)
|
| 116 |
-
for i, pillar in enumerate(pillars):
|
| 117 |
-
with cols[i]:
|
| 118 |
-
st.markdown(f"### {pillar['emoji']} {pillar['keyword'].capitalize()}")
|
| 119 |
-
st.markdown(f"{pillar['description']}")
|
| 120 |
-
|
| 121 |
-
st.markdown(f"> \"{quotes[2]['text']}\" โ {quotes[2]['author']}")
|
| 122 |
|
| 123 |
def generate_vertical_diagram(points):
|
| 124 |
"""Generate a vertical flow Mermaid diagram"""
|
| 125 |
-
|
| 126 |
nodes = []
|
| 127 |
connections = []
|
| 128 |
styles = []
|
| 129 |
|
| 130 |
-
# Create nodes and connections
|
| 131 |
for i, point in enumerate(points):
|
| 132 |
node_id = point['number']
|
| 133 |
node_label = f"{node_id}. {point['emoji']} {point['keyword'].capitalize()}"
|
| 134 |
nodes.append(f" {node_id}(\"{node_label}\")")
|
| 135 |
-
|
| 136 |
-
# Add connection to next node (or back to first if last)
|
| 137 |
if i < len(points) - 1:
|
| 138 |
connections.append(f" {node_id} --> {points[i+1]['number']}")
|
| 139 |
else:
|
| 140 |
connections.append(f" {node_id} --> {points[0]['number']}")
|
| 141 |
|
| 142 |
-
# Add style classes
|
| 143 |
styles.extend([
|
| 144 |
" %% Style definitions",
|
| 145 |
" classDef foundation fill:#ff9900,stroke:#333,stroke-width:2px,color:#000;",
|
| 146 |
" classDef technique fill:#66cc99,stroke:#333,stroke-width:2px,color:#000;",
|
| 147 |
" classDef learning fill:#6699cc,stroke:#333,stroke-width:2px,color:#000;",
|
| 148 |
" classDef mastery fill:#cc6699,stroke:#333,stroke-width:2px,color:#000;",
|
| 149 |
-
""
|
| 150 |
-
" %% Apply styles",
|
| 151 |
-
" class 1,2,3,4,5 foundation;",
|
| 152 |
-
" class 6,7,8,9,10 technique;",
|
| 153 |
-
" class 11,12,13,14,15 learning;",
|
| 154 |
-
" class 16,17,18,19,20 mastery;"
|
| 155 |
])
|
| 156 |
|
| 157 |
-
# Assemble diagram
|
| 158 |
diagram = ["```mermaid", "graph TD"]
|
| 159 |
diagram.extend(nodes)
|
| 160 |
diagram.extend(connections)
|
| 161 |
diagram.extend(styles)
|
| 162 |
diagram.append("```")
|
| 163 |
-
|
| 164 |
return "\n".join(diagram)
|
| 165 |
|
| 166 |
def generate_circular_diagram(points):
|
| 167 |
"""Generate a circular flow Mermaid diagram"""
|
| 168 |
-
|
| 169 |
-
# Calculate positions in a circle
|
| 170 |
-
import math
|
| 171 |
-
|
| 172 |
diagram = ["```mermaid", "graph TD"]
|
| 173 |
-
|
| 174 |
-
# Create nodes in circular positions using subgraphs
|
| 175 |
-
diagram.append(" %% Nodes")
|
| 176 |
-
|
| 177 |
-
# Create all nodes first
|
| 178 |
for point in points:
|
| 179 |
node_id = point['number']
|
| 180 |
node_label = f"{node_id}. {point['emoji']} {point['keyword'].capitalize()}"
|
| 181 |
diagram.append(f" {node_id}[\"{node_label}\"]")
|
| 182 |
-
|
| 183 |
-
# Group nodes into four quarters
|
| 184 |
diagram.extend([
|
| 185 |
-
"
|
| 186 |
-
" 1 --> 2 --> 3 --> 4 --> 5 --> 6 --> 7 --> 8 --> 9 --> 10",
|
| 187 |
-
" 10 --> 11 --> 12 --> 13 --> 14 --> 15 --> 16 --> 17 --> 18 --> 19 --> 20",
|
| 188 |
-
" 20 -.-> 1",
|
| 189 |
-
"",
|
| 190 |
" %% Style definitions",
|
| 191 |
" classDef q1 fill:#ff9900,stroke:#333,stroke-width:2px,color:#000;",
|
| 192 |
-
"
|
| 193 |
-
" classDef q3 fill:#6699cc,stroke:#333,stroke-width:2px,color:#000;",
|
| 194 |
-
" classDef q4 fill:#cc6699,stroke:#333,stroke-width:2px,color:#000;",
|
| 195 |
-
"",
|
| 196 |
-
" %% Apply styles by quarters",
|
| 197 |
-
" class 1,2,3,4,5 q1;",
|
| 198 |
-
" class 6,7,8,9,10 q2;",
|
| 199 |
-
" class 11,12,13,14,15 q3;",
|
| 200 |
-
" class 16,17,18,19,20 q4;"
|
| 201 |
])
|
| 202 |
-
|
| 203 |
diagram.append("```")
|
| 204 |
-
|
| 205 |
return "\n".join(diagram)
|
| 206 |
|
| 207 |
def generate_categorical_diagram(points):
|
| 208 |
-
"""Generate a categorical Mermaid diagram
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
" 4(\"`4. ๐ฒ Emotions`\")",
|
| 219 |
-
" 5(\"`5. ๐ฌ Dialogue`\")",
|
| 220 |
-
" end",
|
| 221 |
-
"",
|
| 222 |
-
" subgraph Techniques[\"๐ง Storytelling Techniques\"]",
|
| 223 |
-
" 6(\"`6. ๐ Zoom In`\")",
|
| 224 |
-
" 7(\"`7. ๐ฌ Transport`\")",
|
| 225 |
-
" 8(\"`8. ๐๏ธ Simple Details`\")",
|
| 226 |
-
" 9(\"`9. โฉ Momentum`\")",
|
| 227 |
-
" 10(\"`10. ๐๏ธ Visualization`\")",
|
| 228 |
-
" end",
|
| 229 |
-
"",
|
| 230 |
-
" subgraph Development[\"๐ Story Development\"]",
|
| 231 |
-
" 11(\"`11. ๐ Study Masters`\")",
|
| 232 |
-
" 12(\"`12. ๐ฃ๏ธ Natural Speech`\")",
|
| 233 |
-
" 13(\"`13. ๐คธ Simplify`\")",
|
| 234 |
-
" 14(\"`14. ๐งฉ Core Elements`\")",
|
| 235 |
-
" 15(\"`15. ๐ถ Step by Step`\")",
|
| 236 |
-
" end",
|
| 237 |
-
"",
|
| 238 |
-
" subgraph Mastery[\"๐ Storytelling Mastery\"]",
|
| 239 |
-
" 16(\"`16. ๐ Emotional Arc`\")",
|
| 240 |
-
" 17(\"`17. ๐ฏ Stay Focused`\")",
|
| 241 |
-
" 18(\"`18. ๐ค Be Human`\")",
|
| 242 |
-
" 19(\"`19. โก Key Moments`\")",
|
| 243 |
-
" 20(\"`20. ๐ง Five Pillars`\")",
|
| 244 |
-
" end",
|
| 245 |
-
"",
|
| 246 |
-
" %% Connections between categories",
|
| 247 |
-
" Foundation --> Techniques",
|
| 248 |
-
" Techniques --> Development",
|
| 249 |
-
" Development --> Mastery",
|
| 250 |
-
" Mastery -.-> Foundation",
|
| 251 |
-
])
|
| 252 |
-
|
| 253 |
-
diagram.append("```")
|
| 254 |
-
|
| 255 |
return "\n".join(diagram)
|
| 256 |
|
| 257 |
if __name__ == "__main__":
|
| 258 |
-
main()
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import streamlit.components.v1 as components
|
| 3 |
+
import math
|
| 4 |
|
| 5 |
def main():
|
| 6 |
st.set_page_config(page_title="Storytelling Mastery", page_icon="๐", layout="wide")
|
| 7 |
|
| 8 |
st.title("๐ญ The Art of Storytelling: Master Guide ๐ญ")
|
| 9 |
|
| 10 |
+
# -----------------------------
|
| 11 |
+
# 1. The Storyteller's Song
|
| 12 |
+
# -----------------------------
|
| 13 |
+
st.markdown("## ๐ต The Storyteller's Journey Song ๐ต")
|
| 14 |
+
st.markdown("""
|
| 15 |
+
**Verse 1 โ Location**
|
| 16 |
+
*I'm in a quiet town, where twilight meets the dawn,*
|
| 17 |
+
*A simple street and weathered walls, where whispered dreams are drawn.*
|
| 18 |
+
|
| 19 |
+
**Verse 2 โ Actions**
|
| 20 |
+
*I lace my worn-out sneakers, stepping into a new dayโs light,*
|
| 21 |
+
*I pedal through cobbled memories, heart racing with each flight.*
|
| 22 |
+
|
| 23 |
+
**Verse 3 โ Thoughts**
|
| 24 |
+
*In every echo of my footsteps, a raw, unfiltered thought appears,*
|
| 25 |
+
*I muse, โAm I chasing shadows, or the brilliance of my years?โ*
|
| 26 |
+
|
| 27 |
+
**Verse 4 โ Emotions**
|
| 28 |
+
*My eyes reflect a storm of joy and painโa silent, candid art,*
|
| 29 |
+
*A trembling smile, a furrowed brow, emotions painted on my heart.*
|
| 30 |
+
|
| 31 |
+
**Verse 5 โ Dialogue**
|
| 32 |
+
*Then comes a gentle, piercing voice: โKeep moving, dare to feel;โ*
|
| 33 |
+
*Those words ignite the darkened skiesโmy destiny is real.*
|
| 34 |
+
|
| 35 |
+
**Chorus**
|
| 36 |
+
*Let each moment unfold its magic, in places, moves, and minds so bold,*
|
| 37 |
+
*For every whispered thought and burst of feeling tells a story yet untold.*
|
| 38 |
+
""")
|
| 39 |
+
|
| 40 |
+
st.markdown("---")
|
| 41 |
+
|
| 42 |
+
# -----------------------------
|
| 43 |
+
# 2. The Storytelling Points Outline
|
| 44 |
+
# -----------------------------
|
| 45 |
storytelling_points = [
|
| 46 |
+
{"number": 1, "emoji": "๐ ", "keyword": "location", "description": "Set a scene that sparks the imagination: a place that's simply stated but vividly felt."},
|
| 47 |
+
{"number": 2, "emoji": "๐", "keyword": "actions", "description": "Show the kinetic energyโwhether itโs walking, biking, or a spontaneous burst of movement."},
|
| 48 |
+
{"number": 3, "emoji": "๐ง ", "keyword": "thoughts", "description": "Reveal those raw, neurotic inner monologues that make you real and relatable."},
|
| 49 |
+
{"number": 4, "emoji": "๐ฒ", "keyword": "emotions", "description": "Let your body speak the language of your feelingsโevery twitch and tear is a story."},
|
| 50 |
+
{"number": 5, "emoji": "๐ฌ", "keyword": "dialogue", "description": "Capture crisp, memorable dialogue that slices through the moment like lightning."},
|
| 51 |
+
# Additional points can be used for further storytelling techniquesโฆ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
]
|
| 53 |
|
| 54 |
+
# -----------------------------
|
| 55 |
+
# 3. Random Literary Wit โ Ten Poetic Lines
|
| 56 |
+
# -----------------------------
|
| 57 |
+
random_poetry = [
|
| 58 |
+
"๐
Location: Where the horizon kisses the edge of dreams. ๐",
|
| 59 |
+
"๐ด Action: Pedaling through the city's heartbeat, every turn a burst of rhythm. ๐ถ",
|
| 60 |
+
"๐ญ Thoughts: Whispering secrets of a chaotic mind under a tranquil sky. ๐",
|
| 61 |
+
"๐ Emotions: A smile that trembles like morning dew on a rose. ๐",
|
| 62 |
+
"๐ฃ Dialogue: Words crackling like fire in the midnight hush. ๐ฅ",
|
| 63 |
+
"๐ฒ Nature: The forest murmurs ancient tales to those who dare to listen. ๐",
|
| 64 |
+
"๐ Waves: Dancing to the eternal hymn of the deep blue. ๐",
|
| 65 |
+
"๐ Dreams: Starlight scattered over the canvas of restless nights. โจ",
|
| 66 |
+
"๐ฅ Passion: A flame burning fierce in the silence of despair. โค๏ธ",
|
| 67 |
+
"๐ Reflection: Leaves falling like whispered memories in autumnโs embrace. ๐๏ธ"
|
| 68 |
]
|
| 69 |
|
| 70 |
+
st.markdown("## โจ Random Literary Wit")
|
| 71 |
+
st.code("\n".join(random_poetry), language="python")
|
|
|
|
| 72 |
|
| 73 |
+
# -----------------------------
|
| 74 |
+
# 4. Interactive Story Element Explorer (Vertical Flow and Tabs)
|
| 75 |
+
# -----------------------------
|
| 76 |
+
st.markdown("## ๐ The Art of Storytelling: 5 Essential Elements")
|
| 77 |
|
| 78 |
+
st.markdown("> \"The universe is made of stories, not of atoms.\" โ Muriel Rukeyser")
|
| 79 |
|
| 80 |
+
for point in storytelling_points:
|
| 81 |
+
st.markdown(f"{point['number']}. {point['emoji']} **{point['keyword'].capitalize()}** - {point['description']}")
|
| 82 |
+
|
| 83 |
+
# -----------------------------
|
| 84 |
+
# 5. Star Layout for the Five Pillars
|
| 85 |
+
# -----------------------------
|
| 86 |
+
st.markdown("## โญ Five Pillars in a Star Layout โญ")
|
| 87 |
+
|
| 88 |
+
# Using absolute positioning in a relative container to arrange five points on a circle
|
| 89 |
+
# Calculated using basic trigonometry (center = 200, radius = 150)
|
| 90 |
+
star_html = """
|
| 91 |
+
<div style="position: relative; width: 400px; height: 400px; margin: auto; border: 1px dashed #aaa; border-radius: 50%;">
|
| 92 |
+
<!-- Point 1: Location at angle 90ยฐ -->
|
| 93 |
+
<div style="position: absolute; top: 50px; left: 200px; transform: translate(-50%, -50%); text-align: center;">
|
| 94 |
+
<div style="font-size: 2em;">๐ </div>
|
| 95 |
+
<div><b>Location</b></div>
|
| 96 |
+
</div>
|
| 97 |
+
<!-- Point 2: Actions at angle ~162ยฐ -->
|
| 98 |
+
<div style="position: absolute; top: 154px; left: 57px; transform: translate(-50%, -50%); text-align: center;">
|
| 99 |
+
<div style="font-size: 2em;">๐</div>
|
| 100 |
+
<div><b>Actions</b></div>
|
| 101 |
+
</div>
|
| 102 |
+
<!-- Point 3: Thoughts at angle ~234ยฐ -->
|
| 103 |
+
<div style="position: absolute; top: 321px; left: 112px; transform: translate(-50%, -50%); text-align: center;">
|
| 104 |
+
<div style="font-size: 2em;">๐ง </div>
|
| 105 |
+
<div><b>Thoughts</b></div>
|
| 106 |
+
</div>
|
| 107 |
+
<!-- Point 4: Emotions at angle ~306ยฐ -->
|
| 108 |
+
<div style="position: absolute; top: 321px; left: 288px; transform: translate(-50%, -50%); text-align: center;">
|
| 109 |
+
<div style="font-size: 2em;">๐ฒ</div>
|
| 110 |
+
<div><b>Emotions</b></div>
|
| 111 |
+
</div>
|
| 112 |
+
<!-- Point 5: Dialogue at angle ~18ยฐ -->
|
| 113 |
+
<div style="position: absolute; top: 154px; left: 343px; transform: translate(-50%, -50%); text-align: center;">
|
| 114 |
+
<div style="font-size: 2em;">๐ฌ</div>
|
| 115 |
+
<div><b>Dialogue</b></div>
|
| 116 |
+
</div>
|
| 117 |
+
</div>
|
| 118 |
+
"""
|
| 119 |
+
components.html(star_html, height=450)
|
| 120 |
+
|
| 121 |
+
# -----------------------------
|
| 122 |
+
# 6. Additional Interactive Elements (Tabs & Dropdown)
|
| 123 |
+
# -----------------------------
|
| 124 |
tab1, tab2, tab3 = st.tabs(["Vertical Flow", "Circular Layout", "Categorical Groups"])
|
| 125 |
|
| 126 |
with tab1:
|
|
|
|
| 138 |
mermaid_categories = generate_categorical_diagram(storytelling_points)
|
| 139 |
st.markdown(mermaid_categories, unsafe_allow_html=True)
|
| 140 |
|
|
|
|
| 141 |
st.markdown("## ๐ Explore Individual Storytelling Elements")
|
|
|
|
| 142 |
col1, col2 = st.columns([1, 3])
|
| 143 |
|
| 144 |
with col1:
|
|
|
|
| 145 |
options = [f"{point['number']}. {point['emoji']} {point['keyword'].capitalize()}" for point in storytelling_points]
|
| 146 |
selected_option = st.selectbox("Select an element to explore:", options)
|
|
|
|
|
|
|
| 147 |
selected_number = int(selected_option.split('.')[0])
|
| 148 |
selected_point = next(point for point in storytelling_points if point['number'] == selected_number)
|
| 149 |
|
| 150 |
with col2:
|
| 151 |
st.markdown(f"### {selected_option}")
|
| 152 |
st.markdown(f"**Description:** {selected_point['description']}")
|
|
|
|
|
|
|
| 153 |
examples = {
|
| 154 |
+
1: "'In the stillness of a small town, I take in the crisp air...'",
|
| 155 |
+
2: "'I lace up my sneakers and step boldly into the unknown, each stride a heartbeat.'",
|
| 156 |
+
3: "'I muse: What if these fleeting moments are the stitches of my very soul?'",
|
| 157 |
+
4: "'My eyes shimmer with unspoken stories, my face a canvas of turbulent joy.'",
|
| 158 |
+
5: "'Then, a voice cuts through the silence: โKeep pushing, the dawn awaits!โ'"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
}
|
| 160 |
+
st.markdown(f"**Example:** {examples.get(selected_number, 'No example available.')}")
|
|
|
|
| 161 |
|
| 162 |
+
st.markdown("> \"There is no greater agony than bearing an untold story inside you.\" โ Maya Angelou")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
|
| 164 |
def generate_vertical_diagram(points):
|
| 165 |
"""Generate a vertical flow Mermaid diagram"""
|
|
|
|
| 166 |
nodes = []
|
| 167 |
connections = []
|
| 168 |
styles = []
|
| 169 |
|
|
|
|
| 170 |
for i, point in enumerate(points):
|
| 171 |
node_id = point['number']
|
| 172 |
node_label = f"{node_id}. {point['emoji']} {point['keyword'].capitalize()}"
|
| 173 |
nodes.append(f" {node_id}(\"{node_label}\")")
|
|
|
|
|
|
|
| 174 |
if i < len(points) - 1:
|
| 175 |
connections.append(f" {node_id} --> {points[i+1]['number']}")
|
| 176 |
else:
|
| 177 |
connections.append(f" {node_id} --> {points[0]['number']}")
|
| 178 |
|
|
|
|
| 179 |
styles.extend([
|
| 180 |
" %% Style definitions",
|
| 181 |
" classDef foundation fill:#ff9900,stroke:#333,stroke-width:2px,color:#000;",
|
| 182 |
" classDef technique fill:#66cc99,stroke:#333,stroke-width:2px,color:#000;",
|
| 183 |
" classDef learning fill:#6699cc,stroke:#333,stroke-width:2px,color:#000;",
|
| 184 |
" classDef mastery fill:#cc6699,stroke:#333,stroke-width:2px,color:#000;",
|
| 185 |
+
" class 1,2,3,4,5 foundation;"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 186 |
])
|
| 187 |
|
|
|
|
| 188 |
diagram = ["```mermaid", "graph TD"]
|
| 189 |
diagram.extend(nodes)
|
| 190 |
diagram.extend(connections)
|
| 191 |
diagram.extend(styles)
|
| 192 |
diagram.append("```")
|
|
|
|
| 193 |
return "\n".join(diagram)
|
| 194 |
|
| 195 |
def generate_circular_diagram(points):
|
| 196 |
"""Generate a circular flow Mermaid diagram"""
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
diagram = ["```mermaid", "graph TD"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
for point in points:
|
| 199 |
node_id = point['number']
|
| 200 |
node_label = f"{node_id}. {point['emoji']} {point['keyword'].capitalize()}"
|
| 201 |
diagram.append(f" {node_id}[\"{node_label}\"]")
|
|
|
|
|
|
|
| 202 |
diagram.extend([
|
| 203 |
+
" 1 --> 2 --> 3 --> 4 --> 5 --> 1",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
" %% Style definitions",
|
| 205 |
" classDef q1 fill:#ff9900,stroke:#333,stroke-width:2px,color:#000;",
|
| 206 |
+
" class 1,2,3,4,5 q1;"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
])
|
|
|
|
| 208 |
diagram.append("```")
|
|
|
|
| 209 |
return "\n".join(diagram)
|
| 210 |
|
| 211 |
def generate_categorical_diagram(points):
|
| 212 |
+
"""Generate a categorical Mermaid diagram grouping the storytelling elements"""
|
| 213 |
+
diagram = ["```mermaid", "graph TB",
|
| 214 |
+
" subgraph Foundation[\"Foundation Elements\"]",
|
| 215 |
+
" 1(\"`1. ๐ Location`\")",
|
| 216 |
+
" 2(\"`2. ๐ Actions`\")",
|
| 217 |
+
" 3(\"`3. ๐ง Thoughts`\")",
|
| 218 |
+
" 4(\"`4. ๐ฒ Emotions`\")",
|
| 219 |
+
" 5(\"`5. ๐ฌ Dialogue`\")",
|
| 220 |
+
" end",
|
| 221 |
+
"```"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
return "\n".join(diagram)
|
| 223 |
|
| 224 |
if __name__ == "__main__":
|
| 225 |
+
main()
|