File size: 7,560 Bytes
9dda929
 
 
 
df82aa0
9dda929
df82aa0
 
 
9dda929
 
df82aa0
 
 
 
 
 
 
9dda929
df82aa0
9dda929
062a55d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9dda929
df82aa0
 
 
 
 
 
 
 
9dda929
 
df82aa0
 
 
9dda929
 
df82aa0
 
 
 
 
 
 
 
2ecd8b8
 
 
df82aa0
 
 
9dda929
df82aa0
 
 
062a55d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9dda929
df82aa0
062a55d
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
import streamlit as st
import pandas as pd
import folium
from streamlit_folium import folium_static
import extra_streamlit_components as stx

# ๐Ÿค  Howdy, partner! Welcome to the Wild West of coding! ๐ŸŒต

# ๐ŸŽญ Set the stage for our grand performance
st.set_page_config(page_title="Wild Bill vs Buffalo Bill", page_icon="๐Ÿค ", layout="wide")

# ๐Ÿง  Initialize our app's memory (it's not whiskey, I promise!)
if 'page' not in st.session_state:
    st.session_state.page = 'home'

# ๐Ÿช Cookie Manager: Because even cowboys need snacks
def get_manager():
    return stx.CookieManager()

cookie_manager = get_manager()

# Define the stories
wild_bill_story = """
# ๐Ÿ”ซ Wild Bill Hickok: The Legendary Gunslinger

## 1. ๐ŸŒŸ Early Life
   - ๐Ÿผ Born James Butler Hickok on May 27, 1837, in Homer, Illinois
   - ๐ŸŒพ Grew up on a farm, developing skills in shooting and horseback riding
   - ๐Ÿž๏ธ Left home at 18 to become a stagecoach driver on the Santa Fe Trail

## 2. ๐Ÿฆธโ€โ™‚๏ธ Rise to Fame
   - ๐Ÿ‘ฎ Became a lawman in Kansas and Nebraska territories
   - ๐ŸŽฏ Earned reputation as a skilled marksman and gunfighter
   - ๐Ÿ“ฐ Featured in dime novels, spreading his fame across the country

## 3. ๐Ÿ™๏ธ Notable Locations
   - ๐ŸŒฝ Rock Creek Station, Nebraska: Site of the McCanles Massacre (1861)
   - ๐Ÿ„ Abilene, Kansas: Served as city marshal (1871)
   - ๐Ÿœ๏ธ Cheyenne, Wyoming: Brief stint as sheriff (1876)

## 4. ๐Ÿ’€ The Fateful Day: August 2, 1876
   - ๐Ÿƒ Playing poker in Nuttal & Mann's Saloon, Deadwood
   - ๐Ÿ”ซ Shot in the back of the head by Jack McCall
   - ๐Ÿ–๏ธ Holding the famous "Dead Man's Hand" - aces and eights
"""

buffalo_bill_story = """
# ๐Ÿฆฌ Buffalo Bill Cody: The Showman of the West

## 1. ๐ŸŒŸ Early Life
   - ๐Ÿผ Born William Frederick Cody on February 26, 1846, in Le Claire, Iowa
   - ๐ŸŽ Began riding horses at a young age
   - ๐Ÿš‚ Worked as a Pony Express rider at age 14

## 2. ๐Ÿ‡ Rise to Fame
   - ๐Ÿฆฌ Earned nickname "Buffalo Bill" as a buffalo hunter for the railroad
   - ๐ŸŽ–๏ธ Served as a scout for the U.S. Army during Indian Wars
   - ๐Ÿ“ฐ Became famous through dime novels about his exploits

## 3. ๐ŸŽช Buffalo Bill's Wild West Show
   - ๐Ÿค  Created the famous traveling show in 1883
   - ๐ŸŒ Toured across America and Europe
   - ๐Ÿน Featured Native Americans, cowboys, and sharpshooters

## 4. ๐ŸŒ… Legacy
   - ๐Ÿ™๏ธ Founded the town of Cody, Wyoming
   - ๐Ÿž๏ธ Advocated for conservation of the American West
   - ๐ŸŽญ Shaped the world's perception of the American frontier
"""

# ๐Ÿก Home on the range
def home():
    st.title("๐Ÿค  Wild Bill Hickok vs Buffalo Bill Cody: A Tale of Two Western Legends")
    st.write("Welcome to our interactive dime novel! Choose a character to explore their story.")

# ๐Ÿ”ซ Wild Bill's saloon (careful, he's a quick draw!)
def wild_bill():
    st.title("๐Ÿ”ซ Wild Bill Hickok: The Legendary Gunslinger")
    st.markdown(wild_bill_story)

# ๐ŸŽช Step right up to Buffalo Bill's Wild West Show!
def buffalo_bill():
    st.title("๐Ÿฆฌ Buffalo Bill Cody: The Showman of the West")
    st.markdown(buffalo_bill_story)

# ๐Ÿงญ Navigation: Don't get lost in the prairie!
chosen_id = stx.tab_bar(data=[
    stx.TabBarItemData(id="home", title="Home", description="Start here"),
    stx.TabBarItemData(id="wild-bill", title="Wild Bill", description="Explore Wild Bill's story"),
    stx.TabBarItemData(id="buffalo-bill", title="Buffalo Bill", description="Discover Buffalo Bill's adventures"),
], default="home")

# ๐ŸŽ Giddy up to the chosen page!
if st.session_state.page != chosen_id:
    st.session_state.page = chosen_id
    st.rerun()

# ๐Ÿ•ฐ๏ธ Remember the last saloon... err, page you visited
cookie_manager.set("last_page", chosen_id)

# ๐Ÿ“œ Reveal the secrets of your past (visits)
st.sidebar.write(f"Last visited: {cookie_manager.get('last_page')}")

# Display the content based on the chosen page
if st.session_state.page == 'home':
    home()
elif st.session_state.page == 'wild-bill':
    wild_bill()
elif st.session_state.page == 'buffalo-bill':
    buffalo_bill()

# ๐Ÿ‘ข Put your boots on, we're going on a story adventure!
story_progress = stx.stepper_bar(steps=["Early Life", "Rise to Fame", "Notable Feats", "Legacy"])
st.sidebar.info(f"Story Progress: Phase #{story_progress}")

# ๐Ÿ—บ๏ธ Map: Because even legends need GPS sometimes
st.subheader("๐Ÿ—บ๏ธ Journey Through the Wild West")
m = folium.Map(location=[41, -100], zoom_start=4)

# ๐Ÿ“ Mark the spots where our legends left their boot prints
locations = [
    ("Homer, IL", 40.0356, -87.9506, "Wild Bill's first rodeo (birthplace)"),
    ("Rock Creek Station, NE", 40.1116, -97.0564, "Wild Bill's wild time (McCanles Massacre)"),
    ("Abilene, KS", 38.9172, -97.2137, "Wild Bill's badge-wearing days"),
    ("Cheyenne, WY", 41.1400, -104.8202, "Wild Bill's brief sheriff showdown"),
    ("Deadwood, SD", 44.3767, -103.7296, "Wild Bill's last poker game ๐Ÿ˜ข"),
    ("Le Claire, IA", 41.5978, -90.3485, "Buffalo Bill's first 'Yee-haw!' (birthplace)"),
    ("North Platte, NE", 41.1239, -100.7654, "Buffalo Bill's home on the range"),
    ("Cody, WY", 44.5263, -109.0565, "Buffalo Bill's namesake town (no buffaloes were harmed)"),
    ("Denver, CO", 39.7392, -104.9903, "Buffalo Bill's final bow ๐ŸŽญ")
]

# ๐ŸŽจ Paint the town red... or at least mark it on the map
for name, lat, lon, desc in locations:
    folium.Marker(
        [lat, lon],
        popup=f"{name}: {desc}",
        tooltip=name
    ).add_to(m)

# ๐ŸŒŸ Showcase our masterpiece map
folium_static(m)

# ๐Ÿ“Š Compare our legends (no gunslingers were harmed in the making of this table)
st.subheader("๐Ÿ“Š Side-by-Side Comparison")
comparison_data = {
    "Aspect": ["Birth Year", "Death Year", "Nickname Origin", "Primary Occupation", "Famous For", "Colorado Connection", "South Dakota Connection"],
    "Wild Bill Hickok": ["1837", "1876", "Unclear, possibly his wild nose ๐Ÿ‘ƒ", "Lawman, Gunfighter", "Quick Draw McGraw IRL", "Visited (probably for the beer ๐Ÿบ)", "Died in Deadwood (worst poker game ever)"],
    "Buffalo Bill Cody": ["1846", "1917", "Buffalo hunting (not actual buffaloes)", "Showman, Scout", "Wild West Show (wilder than spring break)", "Home in Denver (loved the mountains)", "Performed shows (to rival Deadwood's saloons)"]
}

# ๐ŸŽญ Let the comparison show begin!
df = pd.DataFrame(comparison_data)
st.table(df)

# ๐ŸŒ… Ride off into the sunset with our conclusion
st.markdown("""
## ๐ŸŒ… Conclusion: Legends of the West

Yeehaw! We've corralled the tales of two of the wildest cowboys to ever roam the American frontier! ๐Ÿค 

- ๐Ÿ”ซ **Wild Bill Hickok**: The man, the myth, the mustache! He lived fast, died young, and left a good-looking corpse (with a really bad poker hand).

- ๐ŸŽช **Buffalo Bill Cody**: The original showman who put the 'wild' in Wild West! He turned frontier life into a circus... literally!

These two buckaroos shaped the West faster than a tumbleweed ๐ŸŒฟ rollin' in a tornado! Their legacy is as enduring as the smell of a cowboy's boots after a long cattle drive. ๐Ÿ„๐Ÿ’จ

So next time you're sipping sarsaparilla ๐Ÿฅค in a saloon, tip your hat ๐Ÿค  to Wild Bill and Buffalo Bill - the OG influencers of the American West!

Remember, in the words of the great philosopher Woody from Toy Story: "There's a snake in my boot!" ๐Ÿ๐Ÿ‘ข (Okay, maybe that's not relevant, but it's still a great quote!)
""")

# ๐ŸŽฌ That's all, folks!
st.sidebar.markdown("---")
st.sidebar.markdown("Created with โค๏ธ and a lot of ๐Ÿค  using Streamlit")