Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,9 +25,15 @@ text_to_type = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non
|
|
| 25 |
# Main content area
|
| 26 |
st.write("This is a Streamlit app where the text appears as if it's being typed like an A.I.")
|
| 27 |
|
| 28 |
-
#
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
# Main content area
|
| 26 |
st.write("This is a Streamlit app where the text appears as if it's being typed like an A.I.")
|
| 27 |
|
| 28 |
+
# Create a placeholder for the typed text
|
| 29 |
+
placeholder = st.empty()
|
| 30 |
+
|
| 31 |
+
# Type the text character by character with a typing animation effect
|
| 32 |
+
typed_text = ""
|
| 33 |
+
for char in text_to_type:
|
| 34 |
+
typed_text += char
|
| 35 |
+
placeholder.code(typed_text, language="text")
|
| 36 |
+
time.sleep(0.05) # Adjust typing speed here
|
| 37 |
+
|
| 38 |
+
# Add a delay after typing is complete
|
| 39 |
+
time.sleep(1)
|