awacke1 commited on
Commit
1c26e4c
Β·
verified Β·
1 Parent(s): 1ec9a91

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +258 -0
app.py ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ # Define the storytelling points data structure
9
+ storytelling_points = [
10
+ {"number": 1, "emoji": "🏠", "keyword": "location", "description": "Start by establishing a clear location to help listeners visualize the scene."},
11
+ {"number": 2, "emoji": "πŸƒ", "keyword": "actions", "description": "Describe specific actions to create momentum and pull listeners into the moment."},
12
+ {"number": 3, "emoji": "🧠", "keyword": "thoughts", "description": "Share raw, unfiltered thoughts instead of sanitized summaries to add authenticity."},
13
+ {"number": 4, "emoji": "😲", "keyword": "emotions", "description": "Show rather than tell your emotions through physical descriptions of feelings."},
14
+ {"number": 5, "emoji": "πŸ’¬", "keyword": "dialogue", "description": "Use exact dialogue to bring characters to life instead of summarizing conversations."},
15
+ {"number": 6, "emoji": "πŸ”", "keyword": "zoom", "description": "Zoom into specific moments rather than giving bird's-eye summaries of events."},
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
+ # Define the quotes
33
+ quotes = [
34
+ {"text": "Stories are a communal currency of humanity.", "author": "Tahir Shah, in Arabian Nights"},
35
+ {"text": "The universe is made of stories, not of atoms.", "author": "Muriel Rukeyser"},
36
+ {"text": "There is no greater agony than bearing an untold story inside you.", "author": "Maya Angelou"}
37
+ ]
38
+
39
+ # Create the outline
40
+ st.markdown("## πŸ“š The Art of Storytelling: 20 Essential Techniques πŸ“š")
41
+ st.markdown(f"> \"{quotes[0]['text']}\" β€” {quotes[0]['author']}")
42
+
43
+ for point in storytelling_points:
44
+ st.markdown(f"{point['number']}. {point['emoji']} Start by establishing a clear **{point['keyword']}** to help listeners visualize the scene.")
45
+
46
+ st.markdown(f"> \"{quotes[1]['text']}\" β€” {quotes[1]['author']}")
47
+
48
+ # Create tabs for different visualizations
49
+ tab1, tab2, tab3 = st.tabs(["Vertical Flow", "Circular Layout", "Categorical Groups"])
50
+
51
+ with tab1:
52
+ st.markdown("### Vertical Flow Diagram")
53
+ mermaid_vertical = generate_vertical_diagram(storytelling_points)
54
+ st.markdown(mermaid_vertical, unsafe_allow_html=True)
55
+
56
+ with tab2:
57
+ st.markdown("### Circular Storytelling Process")
58
+ mermaid_circular = generate_circular_diagram(storytelling_points)
59
+ st.markdown(mermaid_circular, unsafe_allow_html=True)
60
+
61
+ with tab3:
62
+ st.markdown("### Categorical Groups")
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: "'Two weeks ago, I'm sitting on my couch in my living room taking a deep breath...'",
87
+ 2: "'I'm in my office. I open my laptop and start reading a message from my manager...'",
88
+ 3: "Instead of saying 'I was excited', say 'I thought: ah, this will be so cool! Finally, I can see her after all that time.'",
89
+ 4: "Instead of saying 'I was relieved', say 'In that moment, I leaned backward and let out this big sigh.'",
90
+ 5: "Instead of saying 'My manager was very happy with my work', say 'In that moment, my manager looked at me and said: Wow, that was really the best presentation you've ever given.'",
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
+ # Five pillars section
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
+ " %% Connections - circular flow",
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
+ " classDef q2 fill:#66cc99,stroke:#333,stroke-width:2px,color:#000;",
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 with storytelling elements grouped by category"""
209
+
210
+ diagram = ["```mermaid", "graph TB"]
211
+
212
+ # Create category subgraphs
213
+ diagram.extend([
214
+ " subgraph Foundation[\"πŸ›οΈ Foundation Elements\"]",
215
+ " 1(\"`1. 🏠 Location`\")",
216
+ " 2(\"`2. πŸƒ Action`\")",
217
+ " 3(\"`3. 🧠 Thoughts`\")",
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()