awacke1 commited on
Commit
ece76b0
โ€ข
1 Parent(s): 8166716

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -38
app.py CHANGED
@@ -1,21 +1,19 @@
1
  import streamlit as st
2
  import os
3
  import json
4
- from PIL import Image
5
 
6
- # Set page configuration
7
- st.set_page_config(page_title="๐ŸŒŒ๐Ÿš€ Remixable AI for Sci-Fi and Fantasy Storytelling", page_icon="๐Ÿช", layout="wide")
8
 
9
- # Directory to store scores
10
  score_dir = "scores"
11
  os.makedirs(score_dir, exist_ok=True)
12
 
13
- # Function to generate a unique key for each button
14
  def generate_key(label, header, idx):
15
- # Creates a unique key by combining label, header, and index
16
- return f"{header}_{label}_{idx}"
17
 
18
- # Function to increment score and save it
19
  def update_score(key, increment=1):
20
  score_file = os.path.join(score_dir, f"{key}.json")
21
  if os.path.exists(score_file):
@@ -41,50 +39,38 @@ def load_score(key):
41
  return score_data["score"]
42
  return 0
43
 
44
- # Transhuman Space glossary
45
  transhuman_glossary = {
46
- "๐Ÿš€ Core Technologies": ["Nanotechnology", "Artificial Intelligence", "Quantum Computing", "Spacecraft Engineering", "Biotechnology", "Cybernetics", "Virtual Reality", "Energy Systems", "Material Science", "Communication Technologies"],
47
- "๐ŸŒ Nations": ["Terran Federation", "Martian Syndicate", "Jovian Republics", "Asteroid Belt Communities", "Venusian Colonies", "Lunar States", "Outer System Alliances", "Digital Consciousness Collectives", "Transhumanist Enclaves", "Non-Human Intelligence Tribes"],
48
- "๐Ÿ’ก Memes": ["Post-Humanism", "Neo-Evolutionism", "Digital Ascendancy", "Solar System Nationalism", "Space Explorationism", "Cyber Democracy", "Interstellar Environmentalism", "Quantum Mysticism", "Techno-Anarchism", "Cosmic Preservationism"],
49
- "๐Ÿ› Institutions": ["Interstellar Council", "Transhuman Ethical Standards Organization", "Galactic Trade Union", "Space Habitat Authority", "Artificial Intelligence Safety Commission", "Extraterrestrial Relations Board", "Quantum Research Institute", "Biogenetics Oversight Committee", "Cyberspace Regulatory Agency", "Planetary Defense Coalition"],
50
- "๐Ÿ”— Organizations": ["Neural Network Pioneers", "Spacecraft Innovators Guild", "Quantum Computing Consortium", "Interplanetary Miners Union", "Cybernetic Augmentation Advocates", "Biotechnological Harmony Group", "Stellar Navigation Circle", "Virtual Reality Creators Syndicate", "Renewable Energy Pioneers", "Transhuman Rights Activists"],
51
- "โš”๏ธ War": ["Space Warfare Tactics", "Cyber Warfare", "Biological Warfare", "Nanotech Warfare", "Psychological Operations", "Quantum Encryption & Decryption", "Kinetic Bombardment", "Energy Shield Defense", "Stealth Spacecraft", "Artificial Intelligence Combat"],
52
- "๐ŸŽ– Military": ["Interstellar Navy", "Planetary Guard", "Cybernetic Marines", "Nanotech Soldiers", "Space Drone Fleet", "Quantum Signal Corps", "Special Operations Forces", "Artificial Intelligence Strategists", "Orbital Defense Systems", "Exoskeleton Brigades"],
53
- "๐Ÿฆน Outlaws": ["Pirate Fleets", "Hacktivist Collectives", "Smuggler Caravans", "Rebel AI Entities", "Black Market Biotech Dealers", "Quantum Thieves", "Space Nomad Raiders", "Cyberspace Intruders", "Anti-Transhumanist Factions", "Rogue Nanotech Swarms"],
54
- "๐Ÿ‘ฝ Terrorists": ["Bioengineered Virus Spreaders", "Nanotechnology Saboteurs", "Cyber Terrorist Networks", "Rogue AI Sects", "Space Anarchist Cells", "Quantum Data Hijackers", "Environmental Extremists", "Technological Singularity Cults", "Interspecies Supremacists", "Orbital Bombardment Threats"],
55
  }
56
 
57
- # Function to display the glossary for a selected area with Streamlit components
58
  def display_glossary(area):
59
  st.subheader(f"๐Ÿ“˜ Glossary for {area}")
60
  terms = transhuman_glossary[area]
61
  for idx, term in enumerate(terms, start=1):
62
  st.write(f"{idx}. {term}")
63
 
64
- # Display headers and buttons with scores, adapted for Transhuman Space
65
  def display_buttons_with_scores():
66
- headers = list(transhuman_glossary.keys())
67
- for header in headers:
68
- st.markdown(f"### {header}")
69
- terms = transhuman_glossary[header]
70
  for term in terms:
71
  key = generate_key(term, header, terms.index(term))
72
  score = load_score(key)
73
- if st.button(f"{term} {score}", key=key):
74
- new_score = update_score(key)
75
  st.experimental_rerun()
76
 
77
- # Adapt existing functions for Transhuman Space storytelling
78
- # Additional functions like `fetch_wikipedia_summary` can be adapted for fetching information
79
- # from a science fiction database or API if available.
80
-
81
- # Main application logic
82
  if __name__ == "__main__":
83
- st.title("๐ŸŒŒ Transhuman Space: An Encyclopedia for Role-Playing")
84
- st.markdown("## Explore the intricacies of Transhuman Space through interactive storytelling and encyclopedic knowledge.")
85
  display_buttons_with_scores()
86
-
87
- # Example extensions:
88
- # - Implementing image galleries for spacecraft designs and characters.
89
- # - Adding interactive maps of the solar system highlighting key locations in Transhuman Space.
90
- # - Creating dynamic character and technology profiles that users can explore and modify.
 
1
  import streamlit as st
2
  import os
3
  import json
 
4
 
5
+ # Set page configuration with a title and favicon
6
+ st.set_page_config(page_title="๐ŸŒŒ๐Ÿš€ Transhuman Space Encyclopedia", page_icon="๐ŸŒ ", layout="wide")
7
 
8
+ # Ensure the directory for storing scores exists
9
  score_dir = "scores"
10
  os.makedirs(score_dir, exist_ok=True)
11
 
12
+ # Function to generate a unique key for each button, including an emoji
13
  def generate_key(label, header, idx):
14
+ return f"{header}_{label}_{idx}_key"
 
15
 
16
+ # Function to increment and save score
17
  def update_score(key, increment=1):
18
  score_file = os.path.join(score_dir, f"{key}.json")
19
  if os.path.exists(score_file):
 
39
  return score_data["score"]
40
  return 0
41
 
42
+ # Transhuman Space glossary with full content
43
  transhuman_glossary = {
44
+ "๐Ÿš€ Core Technologies": ["Nanotechnology๐Ÿ”ฌ", "Artificial Intelligence๐Ÿค–", "Quantum Computing๐Ÿ’ป", "Spacecraft Engineering๐Ÿ›ธ", "Biotechnology๐Ÿงฌ", "Cybernetics๐Ÿฆพ", "Virtual Reality๐Ÿ•ถ๏ธ", "Energy Systemsโšก", "Material Science๐Ÿงช", "Communication Technologies๐Ÿ“ก"],
45
+ "๐ŸŒ Nations": ["Terran Federation๐ŸŒ", "Martian Syndicate๐Ÿ”ด", "Jovian Republics๐Ÿช", "Asteroid Belt Communities๐ŸŒŒ", "Venusian Colonies๐ŸŒ‹", "Lunar States๐ŸŒ–", "Outer System Alliancesโœจ", "Digital Consciousness Collectives๐Ÿง ", "Transhumanist Enclaves๐Ÿฆฟ", "Non-Human Intelligence Tribes๐Ÿ‘ฝ"],
46
+ "๐Ÿ’ก Memes": ["Post-Humanism๐Ÿšถโ€โ™‚๏ธโžก๏ธ๐Ÿš€", "Neo-Evolutionism๐Ÿงฌ๐Ÿ“ˆ", "Digital Ascendancy๐Ÿ’พ๐Ÿ‘‘", "Solar System Nationalism๐ŸŒž๐Ÿ›", "Space Explorationism๐Ÿš€๐Ÿ›ฐ", "Cyber Democracy๐Ÿ–ฅ๏ธ๐Ÿ—ณ๏ธ", "Interstellar Environmentalism๐ŸŒ๐Ÿ’š", "Quantum Mysticism๐Ÿ”ฎ๐Ÿ’ซ", "Techno-Anarchism๐Ÿ”Œ๐Ÿด", "Cosmic Preservationism๐ŸŒŒ๐Ÿ›ก๏ธ"],
47
+ "๐Ÿ› Institutions": ["Interstellar Council๐Ÿช–", "Transhuman Ethical Standards Organization๐Ÿ“œ", "Galactic Trade Union๐Ÿค", "Space Habitat Authority๐Ÿ ", "Artificial Intelligence Safety Commission๐Ÿค–๐Ÿ”’", "Extraterrestrial Relations Board๐Ÿ‘ฝ๐Ÿค", "Quantum Research Institute๐Ÿ”ฌ", "Biogenetics Oversight Committee๐Ÿงซ", "Cyberspace Regulatory Agency๐Ÿ’ป", "Planetary Defense Coalition๐ŸŒ๐Ÿ›ก"],
48
+ "๐Ÿ”— Organizations": ["Neural Network Pioneers๐Ÿง ๐ŸŒ", "Spacecraft Innovators Guild๐Ÿš€๐Ÿ› ", "Quantum Computing Consortium๐Ÿ’ป๐Ÿ”—", "Interplanetary Miners Unionโ›๏ธ๐Ÿช", "Cybernetic Augmentation Advocates๐Ÿฆพโค๏ธ", "Biotechnological Harmony Group๐Ÿงฌ๐Ÿ•Š", "Stellar Navigation Circle๐Ÿงญโœจ", "Virtual Reality Creators Syndicate๐Ÿ•ถ๏ธ๐ŸŽจ", "Renewable Energy Pioneersโšก๐ŸŒฑ", "Transhuman Rights Activists๐Ÿฆฟ๐Ÿ“ข"],
49
+ "โš”๏ธ War": ["Space Warfare Tactics๐Ÿš€โš”๏ธ", "Cyber Warfare๐Ÿ–ฅ๏ธ๐Ÿ”’", "Biological Warfare๐Ÿงฌ๐Ÿ’ฃ", "Nanotech Warfare๐Ÿ”ฌโš”๏ธ", "Psychological Operations๐Ÿง ๐Ÿ—ฃ๏ธ", "Quantum Encryption & Decryption๐Ÿ”๐Ÿ’ป", "Kinetic Bombardment๐Ÿš€๐Ÿ’ฅ", "Energy Shield Defense๐Ÿ›ก๏ธโšก", "Stealth Spacecraft๐Ÿš€๐Ÿ”‡", "Artificial Intelligence Combat๐Ÿค–โš”๏ธ"],
50
+ "๐ŸŽ– Military": ["Interstellar Navy๐Ÿš€๐ŸŽ–", "Planetary Guard๐ŸŒ๐Ÿ›ก", "Cybernetic Marines๐Ÿฆพ๐Ÿ”ซ", "Nanotech Soldiers๐Ÿ”ฌ๐Ÿ’‚", "Space Drone Fleet๐Ÿ›ธ๐Ÿค–", "Quantum Signal Corps๐Ÿ’ป๐Ÿ“ก", "Special Operations Forces๐Ÿ‘ฅโš”๏ธ", "Artificial Intelligence Strategists๐Ÿค–๐Ÿ—บ๏ธ", "Orbital Defense Systems๐ŸŒŒ๐Ÿ›ก๏ธ", "Exoskeleton Brigades๐Ÿฆพ๐Ÿšถโ€โ™‚๏ธ"],
51
+ "๐Ÿฆน Outlaws": ["Pirate Fleets๐Ÿดโ€โ˜ ๏ธ๐Ÿš€", "Hacktivist Collectives๐Ÿ’ป๐Ÿšซ", "Smuggler Caravans๐Ÿ›ธ๐Ÿ’ผ", "Rebel AI Entities๐Ÿค–๐Ÿšฉ", "Black Market Biotech Dealers๐Ÿงฌ๐Ÿ’ฐ", "Quantum Thieves๐Ÿ’ป๐Ÿ•ต๏ธโ€โ™‚๏ธ", "Space Nomad Raiders๐Ÿš€๐Ÿดโ€โ˜ ๏ธ", "Cyberspace Intruders๐Ÿ’ป๐Ÿ‘พ", "Anti-Transhumanist Factions๐Ÿšซ๐Ÿฆพ", "Rogue Nanotech Swarms๐Ÿ”ฌ๐Ÿฆ "],
52
+ "๐Ÿ‘ฝ Terrorists": ["Bioengineered Virus Spreaders๐Ÿงฌ๐Ÿ’‰", "Nanotechnology Saboteurs๐Ÿ”ฌ๐Ÿงจ", "Cyber Terrorist Networks๐Ÿ’ป๐Ÿ”ฅ", "Rogue AI Sects๐Ÿค–๐Ÿ›‘", "Space Anarchist Cells๐Ÿš€โ’ถ", "Quantum Data Hijackers๐Ÿ’ป๐Ÿ”“", "Environmental Extremists๐ŸŒ๐Ÿ’ฃ", "Technological Singularity Cults๐Ÿค–๐Ÿ™", "Interspecies Supremacists๐Ÿ‘ฝ๐Ÿ‘‘", "Orbital Bombardment Threats๐Ÿ›ฐ๏ธ๐Ÿ’ฅ"],
53
  }
54
 
55
+ # Display the glossary with Streamlit components, ensuring emojis are used
56
  def display_glossary(area):
57
  st.subheader(f"๐Ÿ“˜ Glossary for {area}")
58
  terms = transhuman_glossary[area]
59
  for idx, term in enumerate(terms, start=1):
60
  st.write(f"{idx}. {term}")
61
 
62
+ # Streamlined UI for displaying buttons with scores, integrating emojis
63
  def display_buttons_with_scores():
64
+ for header, terms in transhuman_glossary.items():
65
+ st.markdown(f"## {header}")
 
 
66
  for term in terms:
67
  key = generate_key(term, header, terms.index(term))
68
  score = load_score(key)
69
+ if st.button(f"{term} {score}๐Ÿš€", key=key):
70
+ update_score(key)
71
  st.experimental_rerun()
72
 
 
 
 
 
 
73
  if __name__ == "__main__":
74
+ st.title("๐ŸŒŒ๐Ÿš€ Transhuman Space Encyclopedia")
75
+ st.markdown("## Explore the universe of Transhuman Space through interactive storytelling and encyclopedic knowledge.๐ŸŒ ")
76
  display_buttons_with_scores()