Skip to content

Commit

Permalink
try hiding profile st
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Stawicki committed Nov 29, 2024
1 parent e678e9d commit 27bf305
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/among_them/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,36 @@
def main():
gui_handler = GUIHandler()
st.set_page_config(page_title="Among Them", layout="wide")

# Inject JavaScript to remove the footer
js = """
<script>
// Wait for the page to fully load
window.addEventListener('load', function() {
// Use MutationObserver to watch for changes in the DOM
const observer = new MutationObserver(function(mutations) {
// Get all divs in the document
const divs = document.getElementsByTagName('div');
// If there are divs
if (divs.length > 0) {
// Get the last div
const lastDiv = divs[divs.length - 1];
// Check if it contains the profile container
if (lastDiv.className.includes('_profile')) {
lastDiv.remove();
// Disconnect the observer once we've found and removed the div
observer.disconnect();
}
}
});
// Start observing the document with the configured parameters
observer.observe(document, { childList: true, subtree: true });
});
</script>
"""
st.components.v1.html(js, height=0)

game_engine = GameEngine()

game_engine.state.DEBUG = True
Expand Down

0 comments on commit 27bf305

Please sign in to comment.