Spaces:
Running
Running
Commit
·
63ab6be
1
Parent(s):
6a7d54f
Update page1.py
Browse files
page1.py
CHANGED
@@ -9,27 +9,40 @@ from streamlit_chat import message
|
|
9 |
import time
|
10 |
import random
|
11 |
def text():
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
apiKey = "AIzaSyAXkkcrrUBjPEgj93tZ9azy7zcS1wI1jUA"
|
34 |
msgs = StreamlitChatMessageHistory(key="special_app_key")
|
35 |
|
|
|
9 |
import time
|
10 |
import random
|
11 |
def text():
|
12 |
+
st.markdown("""
|
13 |
+
<style>
|
14 |
+
.anim-typewriter {
|
15 |
+
animation: typewriter 3s steps(40) 1s 1 normal both, blinkTextCursor 800ms steps(40) infinite normal;
|
16 |
+
overflow: hidden;
|
17 |
+
white-space: nowrap;
|
18 |
+
border-right: 3px solid;
|
19 |
+
font-family: serif;
|
20 |
+
font-size: 0.9em;
|
21 |
+
}
|
22 |
+
@keyframes typewriter {
|
23 |
+
from {
|
24 |
+
width: 0;
|
25 |
+
}
|
26 |
+
to {
|
27 |
+
width: 100%;
|
28 |
+
height: 100%
|
29 |
+
}
|
30 |
+
}
|
31 |
+
@keyframes blinkTextCursor {
|
32 |
+
from {
|
33 |
+
border-right-color: rgba(255, 255, 255, 0.75);
|
34 |
+
}
|
35 |
+
to {
|
36 |
+
border-right-color: transparent;
|
37 |
+
}
|
38 |
+
}
|
39 |
+
</style>
|
40 |
+
""", unsafe_allow_html=True)
|
41 |
+
text ="Hello 👋, how may I assist you today?"
|
42 |
+
animated_output = f'<div class="line-1 anim-typewriter">{text}</div>'
|
43 |
+
|
44 |
+
with st.chat_message("assistant").markdown(animated_output,unsafe_allow_html=True ):
|
45 |
+
st.markdown(animated_output,unsafe_allow_html=True)
|
46 |
apiKey = "AIzaSyAXkkcrrUBjPEgj93tZ9azy7zcS1wI1jUA"
|
47 |
msgs = StreamlitChatMessageHistory(key="special_app_key")
|
48 |
|