Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,46 +1,72 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
|
| 3 |
# Configurazione della pagina
|
| 4 |
-
st.set_page_config(page_title="Smart TV Browser", layout="wide")
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
st.markdown(
|
| 8 |
-
"""
|
| 9 |
<style>
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
</style>
|
| 29 |
-
|
| 30 |
-
unsafe_allow_html=True,
|
| 31 |
-
)
|
| 32 |
|
| 33 |
# Titolo principale
|
| 34 |
-
st.
|
| 35 |
|
| 36 |
-
#
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
""
|
| 42 |
-
|
| 43 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
else:
|
| 45 |
-
st.write("
|
| 46 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from streamlit.components.v1 import html
|
| 3 |
|
| 4 |
# Configurazione della pagina
|
| 5 |
+
st.set_page_config(page_title="Smart TV Browser", layout="wide", initial_sidebar_state="collapsed")
|
| 6 |
|
| 7 |
+
# CSS per personalizzare lo stile Smart TV
|
| 8 |
+
st.markdown("""
|
|
|
|
| 9 |
<style>
|
| 10 |
+
.title {
|
| 11 |
+
font-size: 50px;
|
| 12 |
+
font-weight: bold;
|
| 13 |
+
color: #FFFFFF;
|
| 14 |
+
text-align: center;
|
| 15 |
+
margin-bottom: 30px;
|
| 16 |
+
}
|
| 17 |
+
.button-container {
|
| 18 |
+
display: flex;
|
| 19 |
+
justify-content: center;
|
| 20 |
+
gap: 20px;
|
| 21 |
+
margin-top: 20px;
|
| 22 |
+
}
|
| 23 |
+
.button {
|
| 24 |
+
background-color: #1E90FF;
|
| 25 |
+
border: none;
|
| 26 |
+
color: white;
|
| 27 |
+
padding: 20px 40px;
|
| 28 |
+
font-size: 24px;
|
| 29 |
+
font-weight: bold;
|
| 30 |
+
text-align: center;
|
| 31 |
+
border-radius: 10px;
|
| 32 |
+
cursor: pointer;
|
| 33 |
+
}
|
| 34 |
+
.button:hover {
|
| 35 |
+
background-color: #00BFFF;
|
| 36 |
+
}
|
| 37 |
+
.iframe-container {
|
| 38 |
+
display: flex;
|
| 39 |
+
justify-content: center;
|
| 40 |
+
margin-top: 20px;
|
| 41 |
+
}
|
| 42 |
+
iframe {
|
| 43 |
+
width: 100%;
|
| 44 |
+
height: 600px;
|
| 45 |
+
border: none;
|
| 46 |
+
}
|
| 47 |
</style>
|
| 48 |
+
""", unsafe_allow_html=True)
|
|
|
|
|
|
|
| 49 |
|
| 50 |
# Titolo principale
|
| 51 |
+
st.markdown('<div class="title">Smart TV Streaming Interface</div>', unsafe_allow_html=True)
|
| 52 |
|
| 53 |
+
# Pulsanti per selezionare contenuti
|
| 54 |
+
st.markdown('<div class="button-container">', unsafe_allow_html=True)
|
| 55 |
+
col1, col2, col3 = st.columns(3)
|
| 56 |
+
with col1:
|
| 57 |
+
if st.button("Sito Ufficiale"):
|
| 58 |
+
url = "https://streamingcommunity.paris/"
|
| 59 |
+
with col2:
|
| 60 |
+
if st.button("YouTube"):
|
| 61 |
+
url = "https://www.youtube.com"
|
| 62 |
+
with col3:
|
| 63 |
+
if st.button("Netflix"):
|
| 64 |
+
url = "https://www.netflix.com"
|
| 65 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
| 66 |
+
|
| 67 |
+
# Contenitore iframe per il sito selezionato
|
| 68 |
+
if 'url' in locals():
|
| 69 |
+
st.markdown(f'<div class="iframe-container"><iframe src="{url}"></iframe></div>', unsafe_allow_html=True)
|
| 70 |
else:
|
| 71 |
+
st.write("Seleziona un contenuto sopra per visualizzarlo.")
|
| 72 |
|