Skip to content

Commit b763caf

Browse files
committed
carousel
1 parent 6675a08 commit b763caf

File tree

2 files changed

+32
-11
lines changed

2 files changed

+32
-11
lines changed

movie_streaming_site/movie_streaming_site.py

+28-10
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,42 @@
99
from movie_streaming_site.pages.search import search_page
1010
from reflex_motion import motion
1111

12+
1213
class slider(rx.Component):
1314
library = "nuka-carousel"
1415
tag = "Carousel"
1516
autoplay:rx.Var[bool]
1617
showDots:rx.Var[bool]
18+
wrapMode:rx.Var[str]
1719
autoplayInterval:rx.Var[int]
18-
19-
20-
Slider = slider.create
20+
scrollDistance:rx.Var[str]
2121

2222

2323
@rx.page(on_load=State.on_load)
2424
def index():
2525
return rx.box(
2626

2727
rx.box(
28-
rx.image(src="https://cloud-6t0bvxvfn-hack-club-bot.vercel.app/8torndado.jpg", width="100vw", height="108vh"),
28+
Slider(
29+
rx.image(src="https://media.themoviedb.org/t/p/w1920_and_h800_multi_faces/stKGOm8UyhuLPR9sZLjs5AkmncA.jpg", width="110vw", height="108vh"),
30+
rx.image(src="https://media.themoviedb.org/t/p/w1920_and_h800_multi_faces/qGQf2OHIkoh89K8XeKQzhxczf96.jpg", width="110vw", height="108vh"),
31+
rx.image(src="https://media.themoviedb.org/t/p/w1920_and_h800_multi_faces/eHz61dRrYZB16glXDttV0CnJf6j.jpg", width="110vw", height="108vh"),
32+
rx.image(src="https://media.themoviedb.org/t/p/w1920_and_h800_multi_faces/mabuNsGJgRuCTuGqjFkWe1xdu19.jpg", width="110vw", height="108vh"),
33+
autoplay=True,
34+
showDots=False,
35+
autoplayInterval=3000,
36+
scrollDistance="slide",
37+
wrapMode="wrap",
38+
),
39+
2940

3041
rx.box(
3142
width="100vw",
3243
height="108vh",
3344
position="absolute",
3445
left="0",
3546
top="0",
36-
bg="linear-gradient(180deg, rgba(18, 18, 18, 0) 0%, rgba(18, 18, 18, 0.25) 37%, rgba(18, 18, 18, 0.77) 67%, rgba(18, 18, 18, 0.90) 77%, #121212 93%)",
47+
bg="linear-gradient(180deg,rgba(18, 18, 18, 0.25) 0%, rgba(18, 18, 18, 0.77) 50%, rgba(18, 18, 18, 0.90) 77%, #121212 93%)",
3748
),
3849
motion(
3950

@@ -61,14 +72,14 @@ def index():
6172
),
6273

6374
rx.heading(
64-
"TORNADO MOVIE OR SOMETHING",
75+
"Thousands of movies, right at your fingertips",
6576
font_size="14vh",
6677
font_weight="900",
6778
color="white",
6879
position="absolute",
6980
left="7vw",
7081
top="20vh",
71-
width="43vw",
82+
width="50vw",
7283
height="30vh",
7384
line_height="14vh"
7485
),
@@ -123,20 +134,27 @@ def index():
123134

124135

125136

137+
138+
139+
140+
141+
Slider = slider.create
126142
def testpage():
127143
return rx.box(
128144
Slider(
129145
rx.image(src="https://commerce.nearform.com/open-source/nuka-carousel/img/pexels-01.jpg"),
130-
rx.image(src="https://commerce.nearform.com/open-source/nuka-carousel/img/pexels-01.jpg"),
146+
rx.image(src="https://commerce.nearform.com/open-source/nuka-carousel/img/pexels-02.jpg"),
147+
rx.image(src="https://commerce.nearform.com/open-source/nuka-carousel/img/pexels-03.jpg"),
148+
rx.image(src="https://commerce.nearform.com/open-source/nuka-carousel/img/pexels-04.jpg"),
131149
autoplay=True,
132150
showDots=True,
133-
autoplayInterval=3000
151+
autoplayInterval=3000,
152+
wrapMode="wrap",
134153
)
135154
)
136155

137156

138157

139-
140158
style = {
141159
"body":{
142160
"background-color":"#121212"

requirements.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
reflex==0.5.9
1+
python-dotenv==1.0.1
2+
reflex-image-zoom==0.0.2
3+
reflex-lottiefiles==0.0.2
4+
reflex-motion==0.0.1

0 commit comments

Comments
 (0)