forked from Sven-Bo/personal-website-streamlit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
114 lines (99 loc) · 4.12 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import requests
import streamlit as st
from streamlit_lottie import st_lottie
from PIL import Image
# Find more emojis here: https://www.webfx.com/tools/emoji-cheat-sheet/
st.set_page_config(page_title="My Webpage", page_icon=":tada:", layout="wide")
def load_lottieurl(url):
r = requests.get(url)
if r.status_code != 200:
return None
return r.json()
# Use local CSS
def local_css(file_name):
with open(file_name) as f:
st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html=True)
local_css("style/style.css")
# ---- LOAD ASSETS ----
lottie_coding = load_lottieurl("https://assets5.lottiefiles.com/packages/lf20_fcfjwiyb.json")
img_contact_form = Image.open("images/yt_contact_form.png")
img_lottie_animation = Image.open("images/yt_lottie_animation.png")
# ---- HEADER SECTION ----
with st.container():
st.subheader("Hi, I am Sven :wave:")
st.title("A Data Analyst From Germany")
st.write(
"I am passionate about finding ways to use Python and VBA to be more efficient and effective in business settings."
)
st.write("[Learn More >](https://pythonandvba.com)")
# ---- WHAT I DO ----
with st.container():
st.write("---")
left_column, right_column = st.columns(2)
with left_column:
st.header("What I do")
st.write("##")
st.write(
"""
On my YouTube channel I am creating tutorials for people who:
- are looking for a way to leverage the power of Python in their day-to-day work.
- are struggling with repetitive tasks in Excel and are looking for a way to use Python and VBA.
- want to learn Data Analysis & Data Science to perform meaningful and impactful analyses.
- are working with Excel and found themselves thinking - "there has to be a better way."
If this sounds interesting to you, consider subscribing and turning on the notifications, so you don’t miss any content.
"""
)
st.write("[YouTube Channel >](https://youtube.com/c/CodingIsFun)")
with right_column:
st_lottie(lottie_coding, height=300, key="coding")
# ---- PROJECTS ----
with st.container():
st.write("---")
st.header("My Projects")
st.write("##")
image_column, text_column = st.columns((1, 2))
with image_column:
st.image(img_lottie_animation)
with text_column:
st.subheader("Integrate Lottie Animations Inside Your Streamlit App")
st.write(
"""
Learn how to use Lottie Files in Streamlit!
Animations make our web app more engaging and fun, and Lottie Files are the easiest way to do it!
In this tutorial, I'll show you exactly how to do it
"""
)
st.markdown("[Watch Video...](https://youtu.be/TXSOitGoINE)")
with st.container():
image_column, text_column = st.columns((1, 2))
with image_column:
st.image(img_contact_form)
with text_column:
st.subheader("How To Add A Contact Form To Your Streamlit App")
st.write(
"""
Want to add a contact form to your Streamlit website?
In this video, I'm going to show you how to implement a contact form in your Streamlit app using the free service ‘Form Submit’.
"""
)
st.markdown("[Watch Video...](https://youtu.be/FOULV9Xij_8)")
# ---- CONTACT ----
with st.container():
st.write("---")
st.header("Get In Touch With Me!")
st.write("##")
# Documention: https://formsubmit.co/ !!! CHANGE EMAIL ADDRESS !!!
contact_form = """
<form action="https://formsubmit.co/[email protected]" method="POST">
<input type="hidden" name="_captcha" value="false">
<input type="text" name="name" placeholder="Your name" required>
<input type="email" name="email" placeholder="Your email" required>
<textarea name="message" placeholder="Your message here" required></textarea>
<button type="submit">Send</button>
</form>
"""
left_column, right_column = st.columns(2)
with left_column:
st.markdown(contact_form, unsafe_allow_html=True)
with right_column:
st.empty()