import marimo
__generated_with = "0.12.8"
app = marimo.App(
width="medium",
layout_file="layouts/welcome-elaine.slides.json",
)
@app.cell(hide_code=True)
def _(mo):
mo.md("""# Seja bem-vinda, Elaine!""")
return
@app.cell(hide_code=True)
def _():
import marimo as mo
return (mo,)
@app.cell(hide_code=True)
def _(mo):
# Create an accordion component with the personal message inside
def create_accordion_message():
# Create the accordion component
accordion = mo.accordion(
{
"A Letter for Elaine ": f"""
Dear Elaine,
I'm looking forward to the day you will be reading this letter to me in person.
I'm sure we will be wrong about many things, but not about the fact that you are
an adorable smart girl.
I prepared this page on April 10-11, in 2025. I love your parents very much
and I hope you inherit (no pressure!) a lot from them.
With love,
Uncle Arthur
"""
},
)
# Return the accordion component
return accordion
# Create the accordion component
letter_accordion = create_accordion_message()
return (letter_accordion,)
@app.cell(hide_code=True)
def _(mo):
# Create a letter for the parents inside an accordion
def create_parents_letter_accordion():
# Create the accordion with the letter inside
accordion = mo.accordion(
{
"A Letter for Brandon & Lindsay ": f"""
Hey,
I prepared this as a gift to Elaine and, of course, to you. This is a list of advice on how to raise a child from 0 to 10.
Of course I know nothing about this and used deep research, which usually provides solid information.
Besides a cursory review, I haven't verified the quality of the results. They look solid and logical.
They are, however, presented as hopeful goals rather than guarantees - aspirations for what we want to happen
in a child's development. In any case, in the face of the unknown and absence of tested knowledge,
logic is all we have.
With love,
Arthur
"""
},
)
# Return the accordion component
return accordion
# Create and display the parents letter accordion
parents_letter_accordion = create_parents_letter_accordion()
return (parents_letter_accordion,)
@app.cell(hide_code=True)
def _(letter_accordion, mo, parents_letter_accordion):
# Display the accordion with a headline
mo.output.replace(mo.vstack([
parents_letter_accordion,
letter_accordion,
]))
return
@app.cell(hide_code=True)
def _():
# Emojis for the advice tabs (ensure at least 5)
advice_emojis = ["⭐", "🧸", "🎈", "🖍️", "💡"]
# Corresponding styles for each advice tab content
# Each item is a dict: {'border': 'border-color', 'bg': 'background-color'}
advice_styles = [
{'border': '#4285f4', 'bg': '#e8f0fe'}, # Blue
{'border': '#34a853', 'bg': '#e6f4ea'}, # Green
{'border': '#fbbc05', 'bg': '#fff8e1'}, # Yellow
{'border': '#ea4335', 'bg': '#fce8e6'}, # Red
{'border': '#9c27b0', 'bg': '#f3e5f5'} # Purple
]
year_value_map = {
0: "Elaine is here! 🌱",
1: "My first year! 🎂",
2: "Toddler Times Two! 👣",
3: "Happy three! ✨",
4: "Fabulous Four! 🚀",
5: "A full hand of years! 🖐️",
6: "Super Six! 🦸",
7: "Lucky Seven! 🍀",
8: "I'm 8! I'm not a child!",
9: "Nearly Double Digits! 🎉",
10: "Two full hands! 🙌"
}
# Dictionary to store SVG content for each year
flower_svgs = {
0: """
""",
1: """
""",
# Add more years (2-10) with the corresponding SVG code
# The pattern continues for years 2-10
# Example for year 2:
2: """
""",
3: """
""",
4: """
""",
5: """
""",
6: """
""",
7: """
""",
8: """
""",
9: """
""",
# Continue with years 3-10...
# For brevity, I'll add placeholders for years 3-9 and include year 10
10: """
"""
}
# Dictionary to store advice for each year
parenting_advice = {
0: [
"Respond consistently to distress, but avoid hyper-attunement to every minor fuss; allow brief moments for infant self-discovery/soothing within a secure context.",
"Aim for one consistent primary caregiver, especially in the first 6 months, to provide a clear anchor for secure attachment, more so than a patchwork of caregivers.",
"Look beyond crying; recognize signs of overstimulation (gaze aversion, arching) and other non-verbal cues to provide more attuned care and prevent meltdowns.",
"During inconsolable crying, focus on providing a calm, steady, regulating presence (\"containment\") rather than solely on stopping the tears immediately.",
"Reserve firm \"No's\" for safety; use quick, engaging redirection for most non-dangerous exploration to respect developmental drives while maintaining boundaries."
],
1: [
"Proactively build tolerance for separation through games (peek-a-boo, hide-and-seek with talking) and short, planned practice separations, not just reacting to anxiety.",
"Never sneak out; use a brief, consistent ritual and leave confidently (even with tears) stating return time concretely. Lingering prolongs distress.",
"Go beyond responding; expand toddler's utterance into a full phrase, then extend the topic with new info or questions to accelerate language skills.",
"Frame participation in routines (dressing, cleanup) as helpful contributions, leveraging imitation drive to foster competence and cooperation, not just compliance.",
"View \"No!\" and boundary testing primarily as cognitive exploration (cause/effect, autonomy), not just defiance, allowing for more empathetic limit-setting."
],
2: [
"Use tantrums as teaching moments: systematically validate feelings, label emotions, connect, and set limits while problem-solving, turning conflict into connection.",
"Reframe tantrums not as manipulation, but as communication of overwhelm or testing control; respond calmly, acknowledge desire, hold limits, comfort after.",
"During meltdowns, focus first on helping the child calm down using your own calm presence before attempting to correct behavior or teach lessons.",
"If a break is needed, use a calm-down space with or near the child, focusing on regulation support, not punitive isolation which can increase shame/distress.",
"Go beyond basic labels; introduce nuanced feeling words in context and use a simple color-based Mood Meter to help toddlers categorize and express emotions."
],
3: [
"Strategically use imaginative play scenarios (with dolls, puppets) to practice challenging social skills like sharing, turn-taking, and conflict resolution.",
"Go beyond \"calm down\"; teach concrete methods like \"belly breathing,\" using a calm-down space/jar, or visual aids, and practice them during calm times.",
"Make transitions smoother by pairing verbal warnings (e.g., \"5 more minutes\") with a sensory cue like a visual timer, a specific song, or a gentle touch.",
"Actively teach emotion recognition using games with feeling face cards, discussing character expressions in books, and labeling emotions observed in others.",
"Emphasize effort over outcome in praise; when misbehavior occurs, focus on understanding impact and \"repairing\" harm (apology, kind deed) rather than solely on punishment."
],
4: [
"Allow small, safe failures and manageable risks; don't rescue from all challenges. Frame setbacks as learning opportunities to build coping skills and perseverance.",
"Go beyond encouragement; teach a concrete process (Stop/Calm, Say Problem, Think Solutions, Try, Reflect) for navigating conflicts and challenges.",
"To promote reflection and solutions instead of defensiveness, ask \"How can you fix this?\" or \"What could you do differently?\" instead of \"Why did you do that?\".",
"Frame chores and helpful behaviors not just as tasks, but as contributions that care for the family, pets, or shared spaces, linking responsibility to empathy.",
"Acknowledge anxiety (\"It's okay to feel scared\"), but gently coach facing fears in small steps rather than allowing complete avoidance, which reinforces anxiety."
],
5: [
"Deliberately resist correcting imperfect efforts on self-care tasks (crooked bed-making, misaligned buttons) to prioritize developing intrinsic motivation and competence over perfectionism, especially challenging for achievement-oriented parents.", "Invest in robust imaginative play that develops classroom-essential social-emotional skills (turn-taking, rule-following, negotiating roles) rather than primarily drilling academic readiness like letter recognition.", "Anchor abstract time words ('tomorrow,' 'later') to concrete sequential experiences ('after you sleep, wake up, and eat breakfast') to reduce confusion and anxiety about anticipated events.", "Recognize 'talking back' as often representing clumsy bids for autonomy; acknowledge the underlying need for independence while redirecting to appropriate expressions by offering legitimate choices.", "Transform storytime into proactive social-emotional training by posing questions that prompt problem-solving: 'What could the character have done instead?' to mentally rehearse strategies for navigating school social scenarios."
],
6: [
"Deliberately shift praise from outcomes or innate traits ('You're so smart!') to process and strategy ('You found a clever way to solve that problem'), which research shows builds resilience, challenge-seeking, and a growth mindset.", "Explicitly teach friendship initiation skills through role-play (joining groups, sharing materials/ideas, being a good listener) rather than assuming social competencies develop naturally without direct instruction.", "Frame household rules through the lens of fairness and logical consequences ('We clean toys so everyone has safe play space') rather than authority alone, leveraging six-year-olds' emerging sense of justice and cause-effect reasoning.", "Introduce 'feeling thermometers' (1-5 scales) to help children develop emotional granularity beyond basic labels, teaching that different intensity levels require different regulation strategies.", "Deliberately schedule periods of unstructured 'do nothing' time (distinct from screen time) where boredom becomes the catalyst for creativity, daydreaming, and developing internal resources, especially valuable for children with highly scheduled lives."
],
7: [
"Present hypothetical social dilemmas during calm moments ('What would you do if you saw someone sitting alone?') to actively cultivate perspective-taking skills that build on seven-year-olds' emerging empathy.", "When addressing lying, recognize it partially as evidence of cognitive development (Theory of Mind), respond calmly without high emotion, and focus conversations on trust and relationship rather than punishment.", "Replace ineffective reassurances about fears ('Don't worry') with validation plus collaborative coping strategies ('It's normal to feel nervous; let's create a plan together with specific steps to manage this situation').", "During disagreements, explicitly introduce the concept that two people can experience the same event differently and both perspectives can be valid, challenging their tendency toward single-factor thinking.", "Elevate reading practice beyond decoding to 'meaning detective' work by asking questions about character motivation, multiple word meanings, and contextual clues about emotions not explicitly stated in text."
],
8: [
"Proactively rehearse specific peer pressure resistance techniques through role-play (direct refusal, suggesting alternatives, having exit strategies) rather than simply warning about 'bad influences' or expecting good choices without practice.", "Reframe emotional outbursts as evidence of lagging skills (emotional regulation, impulse control) rather than pure misbehavior, responding with empathy for the feeling, clear boundaries on behavior, then explicitly teaching missing coping strategies.", "Support exploration of varying interests without excessive pressure for long-term commitment, recognizing that dabbling and shifting passions are fundamental to self-discovery rather than signs of problematic inconsistency.", "Leverage eight-year-olds' black-and-white thinking to establish clear family values ('In our family, we tell the truth even when it's difficult'), providing moral foundations that will guide more complex ethical reasoning later.", "Implement the 'complaint sandwich' technique when children express criticism rudely: validate the underlying feeling, set clear boundaries about respectful communication, then suggest alternative phrasing that addresses the same concern appropriately."
],
9: [
"Shift from solving your child's problems to collaborative brainstorming by asking guiding questions ('What solutions have you considered?' 'What else might work?') that position you as consultant rather than fixer, building resourcefulness and problem-solving confidence.", "Complement screen time limits with active 'digital citizenship' education covering online safety, respectful communication, privacy management, information evaluation, and understanding the permanence of digital footprints.", "Initiate factual, matter-of-fact conversations about puberty before significant physical changes occur, using age-appropriate books and language to normalize the process and establish yourself as a trusted information source.", "Consciously model healthy conflict resolution between parents using 'I feel' statements, focusing on needs not blame, and working toward solutions, providing your child a lived blueprint for managing her own complex social relationships.", "Frame household responsibilities as contributions to family functioning ('we all help our home run smoothly') rather than tying basic chores directly to allowance, which can inadvertently create a purely transactional view of family participation."
],
10: [
"Evolve from 'rules enforcer' to 'values consultant' by asking questions that help your preteen apply core family principles to complex situations ('How does our value of kindness apply to this friendship dilemma?'), developing internal moral reasoning.", "Move beyond content filtering to actively teaching media literacy skills by discussing who creates media messages and why, identifying stereotypes (particularly gender-based ones), distinguishing fact from opinion, and analyzing persuasion techniques.", "Establish simple but consistent one-on-one connection rituals (bedtime chats, weekly walks, shared hobbies) that signal ongoing availability despite busy schedules and your child's natural gravitational pull toward peer relationships.", "Nurture healthy skepticism by encouraging your child to respectfully question assumptions, look for supporting evidence, and think critically about information, framing this as valuable intellectual development rather than defiance.", "Deliberately shift body-related conversations away from appearance toward function and capability ('bodies are for doing, not just for looking'), emphasizing strength, energy, and health over weight, shape or conventional attractiveness."
]
}
return (
advice_emojis,
advice_styles,
flower_svgs,
parenting_advice,
year_value_map,
)
@app.cell(hide_code=True)
def _(year_value_map):
# Create tab labels for years
tab_labels = [f"Year {i}" for i in range(11)]
# Create the year tabs widget - Keys are labels, values don't matter here
# as the content is generated reactively in the next cell.
tabs_dict_years = {}
for i in range(11):
label = f"Year {i}"
# Get the custom value from the map, provide a fallback if needed
value = year_value_map.get(i, f"Value for Year {i}")
tabs_dict_years[label] = value
return (tabs_dict_years,)
@app.cell(hide_code=True)
def _(mo, tabs_dict_years, year_value_map):
default_year_value = year_value_map[0]
year_tabs = mo.ui.tabs(tabs_dict_years, value=default_year_value)
return (year_tabs,)
@app.cell(hide_code=True)
def _(advice_emojis, advice_styles, mo):
def create_advice_tabs_dictionary(advice_list):
"""Creates the dictionary mapping advice tab emojis to styled content."""
_advice_tabs_dict = {}
if not advice_list:
_advice_tabs_dict["Info"] = mo.md("No specific advice available for this year.")
else:
for i, advice_text in enumerate(advice_list):
# Ensure we don't go out of bounds for emojis/styles
if i < len(advice_emojis) and i < len(advice_styles):
tab_key = advice_emojis[i] # Use emoji as the key/label
current_style = advice_styles[i] # Get the style dict for this tip
advice_content = mo.md(f"""
{advice_text}
""")
_advice_tabs_dict[tab_key] = advice_content
else:
# Fallback if there are more tips than emojis/styles (optional)
tab_key = f"Tip {i+1}"
advice_content = mo.md(f"
{advice_text}
") # Basic fallback
_advice_tabs_dict[tab_key] = advice_content
return _advice_tabs_dict
return (create_advice_tabs_dictionary,)
@app.cell(hide_code=True)
def _(year_tabs):
selected_year_str = year_tabs.value.split()[-1]
selected_year = int(selected_year_str)
return (selected_year,)
@app.cell(hide_code=True)
def _(flower_svgs, mo, selected_year):
# 1. Get the SVG for the selected year
svg_display = mo.Html(f"""