Update my_pages/pre_information_loss.py
Browse files
my_pages/pre_information_loss.py
CHANGED
|
@@ -1,6 +1,4 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
import time
|
| 3 |
-
from utils import go_to
|
| 4 |
from utils import add_bottom_navigation, add_fadein_text
|
| 5 |
|
| 6 |
def render():
|
|
@@ -13,41 +11,6 @@ def render():
|
|
| 13 |
"and returning as you wish, or follow the guided tutorial which will go through all pieces in order.", 2)
|
| 14 |
]
|
| 15 |
|
| 16 |
-
|
| 17 |
-
# Define CSS fade-in animation
|
| 18 |
-
st.markdown("""
|
| 19 |
-
<style>
|
| 20 |
-
@keyframes fadeIn {
|
| 21 |
-
from {opacity: 0;}
|
| 22 |
-
to {opacity: 1;}
|
| 23 |
-
}
|
| 24 |
-
.fade-in {
|
| 25 |
-
animation: fadeIn 1.5s ease-in forwards;
|
| 26 |
-
opacity: 0;
|
| 27 |
-
margin-bottom: 1em;
|
| 28 |
-
font-size: 24px;
|
| 29 |
-
color: #A6C8FF;
|
| 30 |
-
text-align: left;
|
| 31 |
-
}
|
| 32 |
-
</style>
|
| 33 |
-
""", unsafe_allow_html=True)
|
| 34 |
|
| 35 |
-
|
| 36 |
-
placeholders = [st.empty() for _ in paragraphs]
|
| 37 |
-
|
| 38 |
-
# Reveal paragraphs sequentially
|
| 39 |
-
for i, p in enumerate(paragraphs):
|
| 40 |
-
placeholders[i].markdown(f"<div class='fade-in'>{p[0]}</div>", unsafe_allow_html=True)
|
| 41 |
-
time.sleep(p[1]) # delay (seconds) before showing next one
|
| 42 |
-
|
| 43 |
-
# add_bottom_navigation("landing", "information_loss")
|
| 44 |
-
st.markdown("---")
|
| 45 |
-
col1, col2, col3 = st.columns([1, 4, 1])
|
| 46 |
-
|
| 47 |
-
with col1:
|
| 48 |
-
if st.button("Previous"):
|
| 49 |
-
go_to("landing")
|
| 50 |
-
|
| 51 |
-
with col3:
|
| 52 |
-
if st.button("Next"):
|
| 53 |
-
go_to("information_loss")
|
|
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
| 2 |
from utils import add_bottom_navigation, add_fadein_text
|
| 3 |
|
| 4 |
def render():
|
|
|
|
| 11 |
"and returning as you wish, or follow the guided tutorial which will go through all pieces in order.", 2)
|
| 12 |
]
|
| 13 |
|
| 14 |
+
add_fadein_text(paragraphs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
add_bottom_navigation("landing", "information_loss")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|