Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,31 @@
|
|
1 |
import streamlit as st
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
# Title for your Streamlit app
|
4 |
st.title('Web-Based Game Development Resources')
|
5 |
|
@@ -83,3 +109,20 @@ st.markdown('[Learn more about PixiJS](https://www.pixijs.com/)')
|
|
83 |
# 2. Save this script as `game_development_resources.py`.
|
84 |
# 3. Run the app by typing `streamlit run game_development_resources.py` in your terminal.
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
+
import time
|
3 |
|
4 |
+
# Custom HTML and CSS for the character animation
|
5 |
+
character_html = """
|
6 |
+
<style>
|
7 |
+
@keyframes moveAnimation {
|
8 |
+
0% {transform: translateX(0px);}
|
9 |
+
25% {transform: translateX(100px) translateY(100px);}
|
10 |
+
50% {transform: translateX(200px) translateY(0px);}
|
11 |
+
75% {transform: translateX(100px) translateY(-100px);}
|
12 |
+
100% {transform: translateX(0px) translateY(0px);}
|
13 |
+
}
|
14 |
+
|
15 |
+
.character {
|
16 |
+
width: 50px;
|
17 |
+
height: 50px;
|
18 |
+
background-color: red;
|
19 |
+
border-radius: 50%;
|
20 |
+
position: relative;
|
21 |
+
animation: moveAnimation 5s infinite;
|
22 |
+
}
|
23 |
+
</style>
|
24 |
+
<div class="character"></div>
|
25 |
+
"""
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
# Title for your Streamlit app
|
30 |
st.title('Web-Based Game Development Resources')
|
31 |
|
|
|
109 |
# 2. Save this script as `game_development_resources.py`.
|
110 |
# 3. Run the app by typing `streamlit run game_development_resources.py` in your terminal.
|
111 |
|
112 |
+
|
113 |
+
|
114 |
+
|
115 |
+
|
116 |
+
|
117 |
+
# Placeholder for animation
|
118 |
+
placeholder = st.empty()
|
119 |
+
|
120 |
+
# Display a message before starting the animation
|
121 |
+
st.write("Animation will start in 3 seconds...")
|
122 |
+
|
123 |
+
# Timer before starting the animation
|
124 |
+
time.sleep(3)
|
125 |
+
|
126 |
+
# Inject the custom HTML with animation into the Streamlit app
|
127 |
+
placeholder.markdown(character_html, unsafe_allow_html=True)
|
128 |
+
|