Jon Solow
commited on
Commit
·
78974c7
1
Parent(s):
ddb39cb
Remove login component
Browse files- src/Home.py +0 -2
- src/login_component.py +0 -53
- src/shared_page.py +0 -4
- src/style.css +0 -150
src/Home.py
CHANGED
@@ -1,13 +1,11 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
from config import DEFAULT_ICON
|
4 |
-
from login_component import get_authorization_button
|
5 |
|
6 |
|
7 |
def get_app():
|
8 |
keeper_title = "NFL Playoff Challenge"
|
9 |
st.set_page_config(page_title=keeper_title, page_icon=DEFAULT_ICON)
|
10 |
-
get_authorization_button()
|
11 |
st.markdown(
|
12 |
"""
|
13 |
Welcome!
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
from config import DEFAULT_ICON
|
|
|
4 |
|
5 |
|
6 |
def get_app():
|
7 |
keeper_title = "NFL Playoff Challenge"
|
8 |
st.set_page_config(page_title=keeper_title, page_icon=DEFAULT_ICON)
|
|
|
9 |
st.markdown(
|
10 |
"""
|
11 |
Welcome!
|
src/login_component.py
DELETED
@@ -1,53 +0,0 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
|
3 |
-
from streamlit_oauth import OAuth2Component
|
4 |
-
import os
|
5 |
-
|
6 |
-
# # Load environment variables from .env file
|
7 |
-
# from dotenv import load_dotenv
|
8 |
-
# load_dotenv()
|
9 |
-
|
10 |
-
# Set environment variables
|
11 |
-
AUTHORIZE_URL = os.environ.get("AUTHORIZE_URL")
|
12 |
-
TOKEN_URL = os.environ.get("TOKEN_URL")
|
13 |
-
REFRESH_TOKEN_URL = os.environ.get("REFRESH_TOKEN_URL")
|
14 |
-
REVOKE_TOKEN_URL = os.environ.get("REVOKE_TOKEN_URL")
|
15 |
-
CLIENT_ID = os.environ.get("CLIENT_ID")
|
16 |
-
CLIENT_SECRET = os.environ.get("CLIENT_SECRET")
|
17 |
-
REDIRECT_URI = os.environ.get("REDIRECT_URI")
|
18 |
-
SCOPE = os.environ.get("SCOPE")
|
19 |
-
|
20 |
-
ENABLE_LOGIN = os.environ.get("ENABLE_LOGIN", False)
|
21 |
-
|
22 |
-
# Create OAuth2Component instance
|
23 |
-
oauth2 = OAuth2Component(CLIENT_ID, CLIENT_SECRET, AUTHORIZE_URL, TOKEN_URL, REFRESH_TOKEN_URL, REVOKE_TOKEN_URL)
|
24 |
-
|
25 |
-
|
26 |
-
def is_token_in_session() -> bool:
|
27 |
-
return "token" in st.session_state
|
28 |
-
|
29 |
-
|
30 |
-
def get_authorization_button():
|
31 |
-
if not ENABLE_LOGIN:
|
32 |
-
return
|
33 |
-
# Check if token exists in session state
|
34 |
-
if not is_token_in_session():
|
35 |
-
# If not, show authorize button
|
36 |
-
result = oauth2.authorize_button("Login", REDIRECT_URI, SCOPE)
|
37 |
-
if result and "token" in result:
|
38 |
-
# If authorization successful, save token in session state
|
39 |
-
st.session_state.token = result.get("token")
|
40 |
-
st.rerun()
|
41 |
-
else:
|
42 |
-
# # If token exists in session state, allow logout
|
43 |
-
st.session_state["token"]
|
44 |
-
if st.button("Logout"):
|
45 |
-
del st.session_state.token
|
46 |
-
st.rerun()
|
47 |
-
# # If token exists in session state, show the token
|
48 |
-
# token = st.session_state["token"]
|
49 |
-
# if st.button("Refresh Token"):
|
50 |
-
# # If refresh token button is clicked, refresh the token
|
51 |
-
# token = oauth2.refresh_token(token)
|
52 |
-
# st.session_state.token = token
|
53 |
-
# st.rerun()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/shared_page.py
CHANGED
@@ -2,9 +2,6 @@ import os
|
|
2 |
import streamlit as st
|
3 |
|
4 |
|
5 |
-
from login_component import get_authorization_button
|
6 |
-
|
7 |
-
|
8 |
def get_local_style():
|
9 |
code_str = ""
|
10 |
with open(os.path.join(os.path.dirname(__file__), "style.css")) as f:
|
@@ -18,4 +15,3 @@ def local_css():
|
|
18 |
|
19 |
def common_page_config():
|
20 |
local_css()
|
21 |
-
get_authorization_button()
|
|
|
2 |
import streamlit as st
|
3 |
|
4 |
|
|
|
|
|
|
|
5 |
def get_local_style():
|
6 |
code_str = ""
|
7 |
with open(os.path.join(os.path.dirname(__file__), "style.css")) as f:
|
|
|
15 |
|
16 |
def common_page_config():
|
17 |
local_css()
|
|
src/style.css
CHANGED
@@ -1,150 +0,0 @@
|
|
1 |
-
.mrs-grid-player {
|
2 |
-
font-size: x-small;
|
3 |
-
margin-bottom: 5px;
|
4 |
-
padding-left: 4px;
|
5 |
-
padding-right: 4px;
|
6 |
-
}
|
7 |
-
|
8 |
-
.tier {
|
9 |
-
text-align: center;
|
10 |
-
}
|
11 |
-
|
12 |
-
.timeslot {
|
13 |
-
text-align: center;
|
14 |
-
}
|
15 |
-
|
16 |
-
.tier1 {
|
17 |
-
border: 2px solid blue;
|
18 |
-
}
|
19 |
-
.tier2 {
|
20 |
-
border: 2px solid gold;
|
21 |
-
}
|
22 |
-
|
23 |
-
.tier3 {
|
24 |
-
border: 2px solid silver;
|
25 |
-
}
|
26 |
-
|
27 |
-
.tier4 {
|
28 |
-
border: 2px solid brown;
|
29 |
-
}
|
30 |
-
|
31 |
-
.drop-player {
|
32 |
-
color: red;
|
33 |
-
}
|
34 |
-
|
35 |
-
.light-hold-player {
|
36 |
-
color: yellow;
|
37 |
-
}
|
38 |
-
|
39 |
-
.hold-player {
|
40 |
-
color: rgba(68, 235, 62, 0.774);
|
41 |
-
}
|
42 |
-
|
43 |
-
.playerslot {
|
44 |
-
border-left: 1px solid white;
|
45 |
-
border-right: 1px solid white;
|
46 |
-
}
|
47 |
-
|
48 |
-
.grid-legend {
|
49 |
-
color: white;
|
50 |
-
border: 1px solid white;
|
51 |
-
display: flex;
|
52 |
-
gap: 5px;
|
53 |
-
justify-content: center;
|
54 |
-
font-size: x-small;
|
55 |
-
}
|
56 |
-
|
57 |
-
.grid-container-6 {
|
58 |
-
display: grid;
|
59 |
-
grid-template-columns: repeat(6, 1fr);
|
60 |
-
grid-template-rows: repeat(9, auto);
|
61 |
-
grid-column-gap: 0px;
|
62 |
-
grid-row-gap: 10px;
|
63 |
-
color: white;
|
64 |
-
|
65 |
-
.timeslot1 { grid-area: 1 / 1 / 2 / 2; }
|
66 |
-
.timeslot2 { grid-area: 1 / 2 / 2 / 3; }
|
67 |
-
.timeslot3 { grid-area: 1 / 3 / 2 / 4; }
|
68 |
-
.timeslot4 { grid-area: 1 / 4 / 2 / 5; }
|
69 |
-
.timeslot5 { grid-area: 1 / 5 / 2 / 6; }
|
70 |
-
.timeslot6 { grid-area: 1 / 6 / 2 / 7; }
|
71 |
-
.tier1 { grid-area: 2 / 1 / 3 / 7; }
|
72 |
-
.playerslot1 { grid-area: 3 / 1 / 4 / 2; }
|
73 |
-
.playerslot2 { grid-area: 3 / 2 / 4 / 3; }
|
74 |
-
.playerslot3 { grid-area: 3 / 3 / 4 / 4; }
|
75 |
-
.playerslot4 { grid-area: 3 / 4 / 4 / 5; }
|
76 |
-
.playerslot5 { grid-area: 3 / 5 / 4 / 6; }
|
77 |
-
.playerslot6 { grid-area: 3 / 6 / 4 / 7; }
|
78 |
-
.tier2 { grid-area: 4 / 1 / 5 / 7; }
|
79 |
-
.playerslot7 { grid-area: 5 / 1 / 6 / 2; }
|
80 |
-
.playerslot8 { grid-area: 5 / 2 / 6 / 3; }
|
81 |
-
.playerslot9 { grid-area: 5 / 3 / 6 / 4; }
|
82 |
-
.playerslot10 { grid-area: 5 / 4 / 6 / 5; }
|
83 |
-
.playerslot11 { grid-area: 5 / 5 / 6 / 6; }
|
84 |
-
.playerslot12 { grid-area: 5 / 6 / 6 / 7; }
|
85 |
-
.tier3 { grid-area: 6 / 1 / 7 / 7; }
|
86 |
-
.playerslot13 { grid-area: 7 / 1 / 8 / 2; }
|
87 |
-
.playerslot14 { grid-area: 7 / 2 / 8 / 3; }
|
88 |
-
.playerslot15 { grid-area: 7 / 3 / 8 / 4; }
|
89 |
-
.playerslot16 { grid-area: 7 / 4 / 8 / 5; }
|
90 |
-
.playerslot17 { grid-area: 7 / 5 / 8 / 6; }
|
91 |
-
.playerslot18 { grid-area: 7 / 6 / 8 / 7; }
|
92 |
-
.tier4 { grid-area: 8 / 1 / 9 / 7; }
|
93 |
-
.playerslot19 { grid-area: 9 / 1 / 10 / 2; }
|
94 |
-
.playerslot20 { grid-area: 9 / 2 / 10 / 3; }
|
95 |
-
.playerslot21 { grid-area: 9 / 3 / 10 / 4; }
|
96 |
-
.playerslot22 { grid-area: 9 / 4 / 10 / 5; }
|
97 |
-
.playerslot23 { grid-area: 9 / 5 / 10 / 6; }
|
98 |
-
.playerslot24 { grid-area: 9 / 6 / 10 / 7; }
|
99 |
-
|
100 |
-
}
|
101 |
-
|
102 |
-
.grid-container-7 {
|
103 |
-
display: grid;
|
104 |
-
grid-template-columns: repeat(7, 1fr);
|
105 |
-
grid-template-rows: repeat(9, auto);
|
106 |
-
grid-column-gap: 0px;
|
107 |
-
grid-row-gap: 10px;
|
108 |
-
color: white;
|
109 |
-
|
110 |
-
.timeslot1 { grid-area: 1 / 1 / 2 / 2; }
|
111 |
-
.timeslot2 { grid-area: 1 / 2 / 2 / 3; }
|
112 |
-
.timeslot3 { grid-area: 1 / 3 / 2 / 4; }
|
113 |
-
.timeslot4 { grid-area: 1 / 4 / 2 / 5; }
|
114 |
-
.timeslot5 { grid-area: 1 / 5 / 2 / 6; }
|
115 |
-
.timeslot6 { grid-area: 1 / 6 / 2 / 7; }
|
116 |
-
.timeslot7 { grid-area: 1 / 7 / 2 / 8; }
|
117 |
-
.tier1 { grid-area: 2 / 1 / 3 / 8; }
|
118 |
-
.playerslot1 { grid-area: 3 / 1 / 4 / 2; }
|
119 |
-
.playerslot2 { grid-area: 3 / 2 / 4 / 3; }
|
120 |
-
.playerslot3 { grid-area: 3 / 3 / 4 / 4; }
|
121 |
-
.playerslot4 { grid-area: 3 / 4 / 4 / 5; }
|
122 |
-
.playerslot5 { grid-area: 3 / 5 / 4 / 6; }
|
123 |
-
.playerslot6 { grid-area: 3 / 6 / 4 / 7; }
|
124 |
-
.playerslot7 { grid-area: 3 / 7 / 4 / 8; }
|
125 |
-
.tier2 { grid-area: 4 / 1 / 5 / 8; }
|
126 |
-
.playerslot8 { grid-area: 5 / 1 / 6 / 2; }
|
127 |
-
.playerslot9 { grid-area: 5 / 2 / 6 / 3; }
|
128 |
-
.playerslot10 { grid-area: 5 / 3 / 6 / 4; }
|
129 |
-
.playerslot11 { grid-area: 5 / 4 / 6 / 5; }
|
130 |
-
.playerslot12 { grid-area: 5 / 5 / 6 / 6; }
|
131 |
-
.playerslot13 { grid-area: 5 / 6 / 6 / 7; }
|
132 |
-
.playerslot14 { grid-area: 5 / 7 / 6 / 8; }
|
133 |
-
.tier3 { grid-area: 6 / 1 / 7 / 8; }
|
134 |
-
.playerslot15 { grid-area: 7 / 1 / 8 / 2; }
|
135 |
-
.playerslot16 { grid-area: 7 / 2 / 8 / 3; }
|
136 |
-
.playerslot17 { grid-area: 7 / 3 / 8 / 4; }
|
137 |
-
.playerslot18 { grid-area: 7 / 4 / 8 / 5; }
|
138 |
-
.playerslot19 { grid-area: 7 / 5 / 8 / 6; }
|
139 |
-
.playerslot20 { grid-area: 7 / 6 / 8 / 7; }
|
140 |
-
.playerslot21 { grid-area: 7 / 7 / 8 / 8; }
|
141 |
-
.tier4 { grid-area: 8 / 1 / 9 / 8; }
|
142 |
-
.playerslot22 { grid-area: 9 / 1 / 10 / 2; }
|
143 |
-
.playerslot23 { grid-area: 9 / 2 / 10 / 3; }
|
144 |
-
.playerslot24 { grid-area: 9 / 3 / 10 / 4; }
|
145 |
-
.playerslot25 { grid-area: 9 / 4 / 10 / 5; }
|
146 |
-
.playerslot26 { grid-area: 9 / 5 / 10 / 6; }
|
147 |
-
.playerslot27 { grid-area: 9 / 6 / 10 / 7; }
|
148 |
-
.playerslot28 { grid-area: 9 / 7 / 10 / 8; }
|
149 |
-
|
150 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|