Spaces:
Sleeping
Sleeping
Update pages/4_Mini_Game.py
Browse files- pages/4_Mini_Game.py +32 -10
pages/4_Mini_Game.py
CHANGED
|
@@ -167,16 +167,38 @@ if st.session_state.game_finished:
|
|
| 167 |
st.markdown("## Game Over")
|
| 168 |
st.write(f"Your score: **{score}/{total}**")
|
| 169 |
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
|
| 181 |
if st.button("Play Again"):
|
| 182 |
restart_game()
|
|
|
|
| 167 |
st.markdown("## Game Over")
|
| 168 |
st.write(f"Your score: **{score}/{total}**")
|
| 169 |
|
| 170 |
+
if percentage >= 75:
|
| 171 |
+
st.markdown(
|
| 172 |
+
f"""
|
| 173 |
+
<div style="
|
| 174 |
+
background-color: rgba(0, 128, 0, 0.15);
|
| 175 |
+
border-left: 6px solid green;
|
| 176 |
+
padding: 15px;
|
| 177 |
+
border-radius: 8px;
|
| 178 |
+
font-size: 20px;
|
| 179 |
+
font-weight: bold;
|
| 180 |
+
">
|
| 181 |
+
🎉 Percentage Score: {percentage:.2f}%
|
| 182 |
+
</div>
|
| 183 |
+
""",
|
| 184 |
+
unsafe_allow_html=True
|
| 185 |
+
)
|
| 186 |
+
else:
|
| 187 |
+
st.markdown(
|
| 188 |
+
f"""
|
| 189 |
+
<div style="
|
| 190 |
+
background-color: rgba(255, 0, 0, 0.15);
|
| 191 |
+
border-left: 6px solid red;
|
| 192 |
+
padding: 15px;
|
| 193 |
+
border-radius: 8px;
|
| 194 |
+
font-size: 20px;
|
| 195 |
+
font-weight: bold;
|
| 196 |
+
">
|
| 197 |
+
❌ Percentage Score: {percentage:.2f}%
|
| 198 |
+
</div>
|
| 199 |
+
""",
|
| 200 |
+
unsafe_allow_html=True
|
| 201 |
+
)
|
| 202 |
|
| 203 |
if st.button("Play Again"):
|
| 204 |
restart_game()
|