@@ -87,14 +87,16 @@ def index():
87
87
88
88
89
89
90
- @rx .page (route = "/movieplayer/[movieid]" , on_load = State . on_load )
90
+ @rx .page (route = "/movieplayer/[movieid]" )
91
91
def movieplayer ():
92
92
return rx .box (
93
93
search (),
94
- rx .text ("Despicable Me 4" , font_size = "10.5vh" , font_weight = "800" ),
94
+ rx .text (State . current_movie [ "title" ] , font_size = "10.5vh" , font_weight = "800" ),
95
95
rx .hstack (
96
96
rx .html (
97
- State .movie_iframe
97
+ State .movie_iframe ,
98
+ width = "50vw" ,
99
+ height = "60vw"
98
100
),
99
101
#rx.box(width="960px", height="540px", bg="#D9D9D9"),
100
102
rx .vstack (
@@ -105,10 +107,7 @@ def movieplayer():
105
107
font_weight = "800"
106
108
),
107
109
rx .text (
108
- "Gru and Lucy and their girls---Margo, Edith and Agnes---welcome a new "
109
- "member to the Gru family, Gru Jr., who is intent on tormenting his dad. "
110
- "Gru also faces a new nemesis in Maxime Le Mal and his femme fatale "
111
- "girlfriend Valentina, forcing the family to go on the run." ,
110
+ State .current_movie ["description" ],
112
111
color = "white" ,
113
112
font_size = "3vh" ,
114
113
max_width = "28vw"
@@ -117,20 +116,47 @@ def movieplayer():
117
116
),
118
117
rx .desktop_only (
119
118
rx .vstack (
120
- movie_info_item ("2024-06-20" , "calendar" ),
121
- movie_info_item ("$100,000,000" , "dollar-sign" ),
122
- movie_info_item ("94min" , "clock" ),
123
- movie_info_item ("Site" , "globe" ),
124
- movie_info_item ("IMDB" , "clock" ),
125
- movie_info_item (State .movie_id , "clock" ),
119
+ movie_info_item (State .current_movie ["date" ], "calendar" ),
120
+ movie_info_item (State .current_movie ["revenue" ], "dollar-sign" ),
121
+ movie_info_item (State .current_movie ["runtime" ], "clock" ),
122
+
123
+ rx .cond (
124
+ State .current_movie ["site" ],
125
+ rx .link (
126
+ movie_info_item ("Site" , "globe" ),
127
+ href = State .current_movie ["site" ],
128
+ is_external = True
129
+ ),
130
+ ),
131
+ rx .cond (
132
+ State .current_movie ["tmdb_link" ],
133
+ rx .link (
134
+ movie_info_item ("TMDB" , "clock" ),
135
+ href = State .current_movie ["tmdb_link" ],
136
+ is_external = True
137
+ ),
138
+ ),
139
+ rx .cond (
140
+ State .current_movie ["imdb_link" ],
141
+ rx .link (
142
+ movie_info_item ("IMDB" , "clock" ),
143
+ href = State .current_movie ["imdb_link" ],
144
+ is_external = True
145
+ )
146
+ )
147
+
148
+
149
+
126
150
),
127
151
),
128
152
129
153
spacing = "2vw" ,
130
154
),
131
155
132
- width = "100%" ,
156
+
157
+ width = "100%" ,
133
158
padding = "5.5vh" ,
159
+ on_mount = State .on_load
134
160
)
135
161
136
162
def movie_info_item (text , icon ):
0 commit comments