williambr's picture
Update app.py
8473f8e
raw
history blame
1.42 kB
import streamlit as st
import requests
from streamlit_lottie import st_lottie
import pandas as pd
st.title('Plot and track your vacations!')
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")
city_name = st.text_input('Please Input your Desired City:')
lat = st.text_input('Please Input the Latitude:' )
long = st.text_input('Please Input the Longitude:' )
def add_bg_from_url():
st.markdown(
f"""
<style>
.stApp {{
background-image: url("https://www.researchgate.net/profile/Ahmed-Mohmed-2/post/Why_do_we_need_a_vacation_How_often_do_you_need_a_vacationWhat_are_the_benefits_of_vacationsDo_vacations_make_you_happier/attachment/5e079b76cfe4a777d4fedc26/AS%3A841148566339584%401577556854285/image/vacation-final.jpg");
background-attachment: fixed;
background-size: cover
}}
</style>
""",
unsafe_allow_html=True
)
add_bg_from_url()
cities_list = []
cities_list.append(city_name)
lat_list = []
lat_list.append(lat)
long_list = []
long_list.append(long)
places = pd.DataFrame({'cities:' : cities_list, 'lat:' : lat_list, 'lan:' : long_list})