williambr's picture
Update app.py
edd57ab
raw
history blame
1.22 kB
import streamlit as st
import requests
from streamlit_lottie import st_lottie
import pandas as pd
st.title('Plot and track your vacations!')
# Loads animation of the Earth
def load_lottie_url(url: str):
r = requests.get(url)
if r.status_code != 200:
return None
return r.json()
def ShowAnimation(name, URL):
anim=load_lottie_url(URL)
st_lottie(anim, key = name)
ShowAnimation("Badge1","https://assets2.lottiefiles.com/packages/lf20_jte9hafx.json")
#Loads Background Image
def add_bg_from_url():
st.markdown(
f"""
<style>
.stApp {{
background-image: url("https://static.vecteezy.com/system/resources/thumbnails/000/201/219/small/Beach_Vacation.jpg");
background-attachment: fixed;
background-size: cover
}}
</style>
""",
unsafe_allow_html=True
)
add_bg_from_url()
city_name = st.text_input('Please input your city')
lat = st.text_input('Please Input your Lat')
int(lat)
long = st.text_input('Please Input your Long')
int(long)
if city_name != "" and lat != "" and long != "":
st.map(pd.DataFrame({'cities' : [city_name], 'lat' : [lat], 'lon' : [long]}))