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```
|
263 |
|
264 |
|
265 |
+
import streamlit as st
|
266 |
+
import streamlit.components.v1 as components
|
267 |
+
import math
|
268 |
+
|
269 |
+
def main():
|
270 |
+
st.set_page_config(page_title="Storytelling Mastery", page_icon="๐", layout="wide")
|
271 |
+
|
272 |
+
st.title("๐ญ The Art of Storytelling: Master Guide ๐ญ")
|
273 |
+
|
274 |
+
# -----------------------------
|
275 |
+
# 1. The Storyteller's Song
|
276 |
+
# -----------------------------
|
277 |
+
st.markdown("## ๐ต The Storyteller's Journey Song ๐ต")
|
278 |
+
st.markdown("""
|
279 |
+
**Verse 1 โ Location**
|
280 |
+
*I'm in a quiet town, where twilight meets the dawn,*
|
281 |
+
*A simple street and weathered walls, where whispered dreams are drawn.*
|
282 |
+
|
283 |
+
**Verse 2 โ Actions**
|
284 |
+
*I lace my worn-out sneakers, stepping into a new dayโs light,*
|
285 |
+
*I pedal through cobbled memories, heart racing with each flight.*
|
286 |
+
|
287 |
+
**Verse 3 โ Thoughts**
|
288 |
+
*In every echo of my footsteps, a raw, unfiltered thought appears,*
|
289 |
+
*I muse, โAm I chasing shadows, or the brilliance of my years?โ*
|
290 |
+
|
291 |
+
**Verse 4 โ Emotions**
|
292 |
+
*My eyes reflect a storm of joy and painโa silent, candid art,*
|
293 |
+
*A trembling smile, a furrowed brow, emotions painted on my heart.*
|
294 |
+
|
295 |
+
**Verse 5 โ Dialogue**
|
296 |
+
*Then comes a gentle, piercing voice: โKeep moving, dare to feel;โ*
|
297 |
+
*Those words ignite the darkened skiesโmy destiny is real.*
|
298 |
+
|
299 |
+
**Chorus**
|
300 |
+
*Let each moment unfold its magic, in places, moves, and minds so bold,*
|
301 |
+
*For every whispered thought and burst of feeling tells a story yet untold.*
|
302 |
+
""")
|
303 |
+
|
304 |
+
st.markdown("---")
|
305 |
+
|
306 |
+
# -----------------------------
|
307 |
+
# 2. The Storytelling Points Outline
|
308 |
+
# -----------------------------
|
309 |
+
storytelling_points = [
|
310 |
+
{"number": 1, "emoji": "๐ ", "keyword": "location", "description": "Set a scene that sparks the imagination: a place that's simply stated but vividly felt."},
|
311 |
+
{"number": 2, "emoji": "๐", "keyword": "actions", "description": "Show the kinetic energyโwhether itโs walking, biking, or a spontaneous burst of movement."},
|
312 |
+
{"number": 3, "emoji": "๐ง ", "keyword": "thoughts", "description": "Reveal those raw, neurotic inner monologues that make you real and relatable."},
|
313 |
+
{"number": 4, "emoji": "๐ฒ", "keyword": "emotions", "description": "Let your body speak the language of your feelingsโevery twitch and tear is a story."},
|
314 |
+
{"number": 5, "emoji": "๐ฌ", "keyword": "dialogue", "description": "Capture crisp, memorable dialogue that slices through the moment like lightning."},
|
315 |
+
# Additional points can be used for further storytelling techniquesโฆ
|
316 |
+
]
|
317 |
+
|
318 |
+
# -----------------------------
|
319 |
+
# 3. Random Literary Wit โ Ten Poetic Lines
|
320 |
+
# -----------------------------
|
321 |
+
random_poetry = [
|
322 |
+
"๐
Location: Where the horizon kisses the edge of dreams. ๐",
|
323 |
+
"๐ด Action: Pedaling through the city's heartbeat, every turn a burst of rhythm. ๐ถ",
|
324 |
+
"๐ญ Thoughts: Whispering secrets of a chaotic mind under a tranquil sky. ๐",
|
325 |
+
"๐ Emotions: A smile that trembles like morning dew on a rose. ๐",
|
326 |
+
"๐ฃ Dialogue: Words crackling like fire in the midnight hush. ๐ฅ",
|
327 |
+
"๐ฒ Nature: The forest murmurs ancient tales to those who dare to listen. ๐",
|
328 |
+
"๐ Waves: Dancing to the eternal hymn of the deep blue. ๐",
|
329 |
+
"๐ Dreams: Starlight scattered over the canvas of restless nights. โจ",
|
330 |
+
"๐ฅ Passion: A flame burning fierce in the silence of despair. โค๏ธ",
|
331 |
+
"๐ Reflection: Leaves falling like whispered memories in autumnโs embrace. ๐๏ธ"
|
332 |
+
]
|
333 |
+
|
334 |
+
st.markdown("## โจ Random Literary Wit")
|
335 |
+
st.code("\n".join(random_poetry), language="python")
|
336 |
+
|
337 |
+
# -----------------------------
|
338 |
+
# 4. Interactive Story Element Explorer (Vertical Flow and Tabs)
|
339 |
+
# -----------------------------
|
340 |
+
st.markdown("## ๐ The Art of Storytelling: 5 Essential Elements")
|
341 |
+
|
342 |
+
st.markdown("> \"The universe is made of stories, not of atoms.\" โ Muriel Rukeyser")
|
343 |
+
|
344 |
+
for point in storytelling_points:
|
345 |
+
st.markdown(f"{point['number']}. {point['emoji']} **{point['keyword'].capitalize()}** - {point['description']}")
|
346 |
+
|
347 |
+
# -----------------------------
|
348 |
+
# 5. Star Layout for the Five Pillars
|
349 |
+
# -----------------------------
|
350 |
+
st.markdown("## โญ Five Pillars in a Star Layout โญ")
|
351 |
+
|
352 |
+
# Using absolute positioning in a relative container to arrange five points on a circle
|
353 |
+
# Calculated using basic trigonometry (center = 200, radius = 150)
|
354 |
+
star_html = """
|
355 |
+
<div style="position: relative; width: 400px; height: 400px; margin: auto; border: 1px dashed #aaa; border-radius: 50%;">
|
356 |
+
<!-- Point 1: Location at angle 90ยฐ -->
|
357 |
+
<div style="position: absolute; top: 50px; left: 200px; transform: translate(-50%, -50%); text-align: center;">
|
358 |
+
<div style="font-size: 2em;">๐ </div>
|
359 |
+
<div><b>Location</b></div>
|
360 |
+
</div>
|
361 |
+
<!-- Point 2: Actions at angle ~162ยฐ -->
|
362 |
+
<div style="position: absolute; top: 154px; left: 57px; transform: translate(-50%, -50%); text-align: center;">
|
363 |
+
<div style="font-size: 2em;">๐</div>
|
364 |
+
<div><b>Actions</b></div>
|
365 |
+
</div>
|
366 |
+
<!-- Point 3: Thoughts at angle ~234ยฐ -->
|
367 |
+
<div style="position: absolute; top: 321px; left: 112px; transform: translate(-50%, -50%); text-align: center;">
|
368 |
+
<div style="font-size: 2em;">๐ง </div>
|
369 |
+
<div><b>Thoughts</b></div>
|
370 |
+
</div>
|
371 |
+
<!-- Point 4: Emotions at angle ~306ยฐ -->
|
372 |
+
<div style="position: absolute; top: 321px; left: 288px; transform: translate(-50%, -50%); text-align: center;">
|
373 |
+
<div style="font-size: 2em;">๐ฒ</div>
|
374 |
+
<div><b>Emotions</b></div>
|
375 |
+
</div>
|
376 |
+
<!-- Point 5: Dialogue at angle ~18ยฐ -->
|
377 |
+
<div style="position: absolute; top: 154px; left: 343px; transform: translate(-50%, -50%); text-align: center;">
|
378 |
+
<div style="font-size: 2em;">๐ฌ</div>
|
379 |
+
<div><b>Dialogue</b></div>
|
380 |
+
</div>
|
381 |
+
</div>
|
382 |
+
"""
|
383 |
+
components.html(star_html, height=450)
|
384 |
+
|
385 |
+
# -----------------------------
|
386 |
+
# 6. Additional Interactive Elements (Tabs & Dropdown)
|
387 |
+
# -----------------------------
|
388 |
+
tab1, tab2, tab3 = st.tabs(["Vertical Flow", "Circular Layout", "Categorical Groups"])
|
389 |
+
|
390 |
+
with tab1:
|
391 |
+
st.markdown("### Vertical Flow Diagram")
|
392 |
+
mermaid_vertical = generate_vertical_diagram(storytelling_points)
|
393 |
+
st.markdown(mermaid_vertical, unsafe_allow_html=True)
|
394 |
+
|
395 |
+
with tab2:
|
396 |
+
st.markdown("### Circular Storytelling Process")
|
397 |
+
mermaid_circular = generate_circular_diagram(storytelling_points)
|
398 |
+
st.markdown(mermaid_circular, unsafe_allow_html=True)
|
399 |
+
|
400 |
+
with tab3:
|
401 |
+
st.markdown("### Categorical Groups")
|
402 |
+
mermaid_categories = generate_categorical_diagram(storytelling_points)
|
403 |
+
st.markdown(mermaid_categories, unsafe_allow_html=True)
|
404 |
+
|
405 |
+
st.markdown("## ๐ Explore Individual Storytelling Elements")
|
406 |
+
col1, col2 = st.columns([1, 3])
|
407 |
+
|
408 |
+
with col1:
|
409 |
+
options = [f"{point['number']}. {point['emoji']} {point['keyword'].capitalize()}" for point in storytelling_points]
|
410 |
+
selected_option = st.selectbox("Select an element to explore:", options)
|
411 |
+
selected_number = int(selected_option.split('.')[0])
|
412 |
+
selected_point = next(point for point in storytelling_points if point['number'] == selected_number)
|
413 |
+
|
414 |
+
with col2:
|
415 |
+
st.markdown(f"### {selected_option}")
|
416 |
+
st.markdown(f"**Description:** {selected_point['description']}")
|
417 |
+
examples = {
|
418 |
+
1: "'In the stillness of a small town, I take in the crisp air...'",
|
419 |
+
2: "'I lace up my sneakers and step boldly into the unknown, each stride a heartbeat.'",
|
420 |
+
3: "'I muse: What if these fleeting moments are the stitches of my very soul?'",
|
421 |
+
4: "'My eyes shimmer with unspoken stories, my face a canvas of turbulent joy.'",
|
422 |
+
5: "'Then, a voice cuts through the silence: โKeep pushing, the dawn awaits!โ'"
|
423 |
+
}
|
424 |
+
st.markdown(f"**Example:** {examples.get(selected_number, 'No example available.')}")
|
425 |
+
|
426 |
+
st.markdown("> \"There is no greater agony than bearing an untold story inside you.\" โ Maya Angelou")
|
427 |
+
|
428 |
+
def generate_vertical_diagram(points):
|
429 |
+
"""Generate a vertical flow Mermaid diagram"""
|
430 |
+
nodes = []
|
431 |
+
connections = []
|
432 |
+
styles = []
|
433 |
+
|
434 |
+
for i, point in enumerate(points):
|
435 |
+
node_id = point['number']
|
436 |
+
node_label = f"{node_id}. {point['emoji']} {point['keyword'].capitalize()}"
|
437 |
+
nodes.append(f" {node_id}(\"{node_label}\")")
|
438 |
+
if i < len(points) - 1:
|
439 |
+
connections.append(f" {node_id} --> {points[i+1]['number']}")
|
440 |
+
else:
|
441 |
+
connections.append(f" {node_id} --> {points[0]['number']}")
|
442 |
+
|
443 |
+
styles.extend([
|
444 |
+
" %% Style definitions",
|
445 |
+
" classDef foundation fill:#ff9900,stroke:#333,stroke-width:2px,color:#000;",
|
446 |
+
" classDef technique fill:#66cc99,stroke:#333,stroke-width:2px,color:#000;",
|
447 |
+
" classDef learning fill:#6699cc,stroke:#333,stroke-width:2px,color:#000;",
|
448 |
+
" classDef mastery fill:#cc6699,stroke:#333,stroke-width:2px,color:#000;",
|
449 |
+
" class 1,2,3,4,5 foundation;"
|
450 |
+
])
|
451 |
+
|
452 |
+
diagram = ["```mermaid", "graph TD"]
|
453 |
+
diagram.extend(nodes)
|
454 |
+
diagram.extend(connections)
|
455 |
+
diagram.extend(styles)
|
456 |
+
diagram.append("```")
|
457 |
+
return "\n".join(diagram)
|
458 |
+
|
459 |
+
def generate_circular_diagram(points):
|
460 |
+
"""Generate a circular flow Mermaid diagram"""
|
461 |
+
diagram = ["```mermaid", "graph TD"]
|
462 |
+
for point in points:
|
463 |
+
node_id = point['number']
|
464 |
+
node_label = f"{node_id}. {point['emoji']} {point['keyword'].capitalize()}"
|
465 |
+
diagram.append(f" {node_id}[\"{node_label}\"]")
|
466 |
+
diagram.extend([
|
467 |
+
" 1 --> 2 --> 3 --> 4 --> 5 --> 1",
|
468 |
+
" %% Style definitions",
|
469 |
+
" classDef q1 fill:#ff9900,stroke:#333,stroke-width:2px,color:#000;",
|
470 |
+
" class 1,2,3,4,5 q1;"
|
471 |
+
])
|
472 |
+
diagram.append("```")
|
473 |
+
return "\n".join(diagram)
|
474 |
+
|
475 |
+
def generate_categorical_diagram(points):
|
476 |
+
"""Generate a categorical Mermaid diagram grouping the storytelling elements"""
|
477 |
+
diagram = ["```mermaid", "graph TB",
|
478 |
+
" subgraph Foundation[\"Foundation Elements\"]",
|
479 |
+
" 1(\"`1. ๐ Location`\")",
|
480 |
+
" 2(\"`2. ๐ Actions`\")",
|
481 |
+
" 3(\"`3. ๐ง Thoughts`\")",
|
482 |
+
" 4(\"`4. ๐ฒ Emotions`\")",
|
483 |
+
" 5(\"`5. ๐ฌ Dialogue`\")",
|
484 |
+
" end",
|
485 |
+
"```"]
|
486 |
+
return "\n".join(diagram)
|
487 |
+
|
488 |
+
if __name__ == "__main__":
|
489 |
+
main()
|