Improve CarouselSliders' responsivity

This commit is contained in:
Chigozirim Igweamaka 2024-05-25 14:34:10 +01:00
parent a8eab97b33
commit 511e3f8b1a
2 changed files with 20 additions and 6 deletions

View file

@ -1,9 +1,9 @@
import React, { useEffect, useRef } from "react";
import React, { useEffect, useRef, useState } from "react";
import YouTube from "react-youtube";
import styles from "./styles/CarouselSliders.module.css";
const CarouselSliders = (props) => {
const [activeVideoID, setActiveVideoID] = React.useState(null);
const [activeVideoID, setActiveVideoID] = useState(null);
const players = useRef({});
const activeVid = props.matches.length ? props.matches[0].YouTubeID : "";

View file

@ -32,20 +32,34 @@
.SlideItem {
height: 100%;
width: 100%;
margin-left: 20px;
scroll-snap-align: center;
}
.SlideItem:not(:first-child) {
margin-left: 15px;
}
.SlideItem:nth-child(1) { background-color: rebeccapurple;}
.SlideItem:nth-child(2) { background-color: dodgerblue;}
.SlideItem:nth-child(3) { background-color: greenyellow;}
.Iframe {
width: 450px;
height: 300px;
}
@media (min-width: 768px) {
@media (max-width: 868px) {
.Iframe {
width: 450px;
height: 300px;
width: 360px;
height: 230px;
}
}
@media (max-width: 690px) {
.Iframe {
width: 280px;
height: 150px;
}
}