ServerX commited on
Commit
1c18b0b
·
verified ·
1 Parent(s): b2d1a54

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +61 -35
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
- # Stile personalizzato per Smart TV
7
- st.markdown(
8
- """
9
  <style>
10
- .tv-button {
11
- font-size: 30px;
12
- padding: 20px;
13
- width: 100%;
14
- text-align: center;
15
- background-color: #4CAF50;
16
- color: white;
17
- border: none;
18
- border-radius: 10px;
19
- margin: 10px 0;
20
- cursor: pointer;
21
- }
22
- .tv-button:hover {
23
- background-color: #45a049;
24
- }
25
- iframe {
26
- border: none;
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  </style>
29
- """,
30
- unsafe_allow_html=True,
31
- )
32
 
33
  # Titolo principale
34
- st.title("🎬 Smart TV Browser")
35
 
36
- # Pulsante per accedere al sito di streaming
37
- if st.button("📺 Vai a StreamingCommunity"):
38
- st.markdown(
39
- """
40
- <iframe src="https://streamingcommunity.paris/" width="100%" height="800px"></iframe>
41
- """,
42
- unsafe_allow_html=True,
43
- )
 
 
 
 
 
 
 
 
 
44
  else:
45
- st.write("Premi il pulsante sopra per accedere al sito di StreamingCommunity.")
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