File size: 1,880 Bytes
d747bc4
 
507acad
581c2fc
 
 
 
 
 
 
 
0c74398
 
85779ec
0c74398
930dab2
6b5a327
930dab2
 
07847b9
1345b51
 
 
 
 
 
07847b9
1345b51
07847b9
1345b51
 
 
bba5ccc
1345b51
930dab2
be0de61
 
 
 
 
 
 
 
 
 
 
 
 
 
930dab2
0c74398
d747bc4
 
 
 
 
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
import streamlit as st

from battlewords.ui import run_app, _init_session


def _new_game() -> None:
    st.session_state.clear()
    _init_session()
    st.rerun()


def main(opened=False):
    st.set_page_config(
        page_title="Battlewords",
        layout="wide",
        initial_sidebar_state=None,
        page_icon="app/static/favicon.ico"
    )

    st.html('''
    <!-- Google Tag Manager -->
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-MKBM5JQ6');</script>
    ''', unsafe_allow_javascript=True)

    st.html('''
    <!-- Google Tag Manager (noscript) -->
    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MKBM5JQ6"
    height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    ''', unsafe_allow_javascript=True)

    st.markdown(
        """<style>
                div[data-testid='stSidebar'] { display: none !important; }
                /* #root {transition: opacity 1s ease, visibility 1s ease;} */
                .bw-fadein-prep {visibility: hidden !important; opacity: 0.75; transition: opacity 1s ease, visibility 1s ease !important}
                .bw-fadein-prep #bw-spinner-overlay {
                    visibility: visible !important;
                    opacity: 1 !important;
                }
                /* #REMOVE ALERT */
                .st-emotion-cache-15g2oxy.emjbblw2 { 
                    opacity: 0;
                    display: none;
                }
          </style>""",
        unsafe_allow_html=True,
    )
    run_app()


if __name__ == "__main__":
    main()