Skip to content

Commit 0f3bd9f

Browse files
committed
fixed inconsistent width in home page
Signed-off-by: krVatsal <[email protected]>
1 parent cd964d6 commit 0f3bd9f

File tree

2 files changed

+61
-50
lines changed

2 files changed

+61
-50
lines changed

src/sections/Home/Banner-4/banner4.style.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ const Banner1SectionWrapper = styled.section`
4040
/* Video container with fixed aspect ratio to prevent layout shifts */
4141
.video-wrapper {
4242
position: relative;
43-
width: 90%;
43+
width: 95%;
44+
max-width: 600px;
4445
margin: auto;
4546
height: 0;
46-
padding-bottom: 50.625%; /* 16:9 aspect ratio (9/16 = 0.5625) */
47+
padding-bottom: 56.25%; /* 16:9 aspect ratio */
4748
overflow: hidden;
4849
border-radius: 8px;
4950
background: ${props => props.theme.DarkTheme ? "rgba(0, 0, 0, 0.2)" : "rgba(0, 0, 0, 0.05)"};
@@ -227,6 +228,9 @@ const Banner1SectionWrapper = styled.section`
227228
.video-col{
228229
display: none;
229230
}
231+
.text-col {
232+
width: 100%;
233+
}
230234
.section-title {
231235
h1 {
232236
margin: 0rem;
@@ -248,7 +252,14 @@ const Banner1SectionWrapper = styled.section`
248252
}
249253
.kanvasVideo {
250254
top: 1rem;
255+
}
251256
}
257+
258+
@media only screen and (max-width: 992px) and (min-width: 768px) {
259+
.video-wrapper {
260+
width: 100%;
261+
max-width: 500px;
262+
}
252263
}
253264
@media only screen and (max-width: 480px) {
254265
padding: 2rem 0;

src/sections/Home/Banner-4/index.js

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ const Banner1 = (props) => {
8282
return (
8383
<Banner1SectionWrapper {...props}>
8484
<BGImg title="heroImage" image={pluginImage}>
85-
<Row style={{ marginRight: 0 }}>
86-
<Col $sm={4} $lg={6} className="section-title-wrapper text-col">
87-
<Container $fullWidthSM>
85+
<Container>
86+
<Row style={{ marginRight: 0 }}>
87+
<Col $sm={4} $lg={6} className="section-title-wrapper text-col">
8888
<SectionTitle
8989
className="section-title"
9090
$leftAlign={true}
@@ -105,52 +105,52 @@ const Banner1 = (props) => {
105105
</Button>
106106
</VintageBox>
107107
</span>
108-
</Container>
109-
</Col>
110-
{hasMounted && window.innerWidth > 760 && (
111-
<Col $sm={4} $lg={6} className="section-title-wrapper video-col">
112-
<div
113-
className={`video-wrapper ${videoReady ? "video-loaded" : ""}`}
114-
ref={thumbnailRef}
115-
onClick={handleThumbnailClick}
116-
>
117-
<ReactPlayer
118-
url="https://youtu.be/034nVaQUyME?si=Yya8m6i7JUoSdZm4"
119-
playing
120-
controls
121-
light={videoThumbnail}
122-
playIcon={
123-
<img
124-
src={playIcon}
125-
className="playBtn"
126-
loading="eager"
127-
alt="Play"
128-
role="button"
129-
aria-label="Play"
130-
style={{ fontSize: "24px" }}
131-
/>
132-
}
133-
width="100%"
134-
height="100%"
135-
className="embedVideo"
136-
onReady={handleVideoReady}
137-
onStart={handleVideoReady}
138-
onPlay={handleVideoReady}
139-
onBufferEnd={handleVideoReady}
140-
onClickPreview={handleVideoReady}
141-
config={{
142-
youtube: {
143-
playerVars: {
144-
rel: 0,
145-
modestbranding: 1,
146-
}
147-
}
148-
}}
149-
/>
150-
</div>
151108
</Col>
152-
)}
153-
</Row>
109+
{hasMounted && window.innerWidth > 760 && (
110+
<Col $sm={4} $lg={6} className="section-title-wrapper video-col">
111+
<div
112+
className={`video-wrapper ${videoReady ? "video-loaded" : ""}`}
113+
ref={thumbnailRef}
114+
onClick={handleThumbnailClick}
115+
>
116+
<ReactPlayer
117+
url="https://youtu.be/034nVaQUyME?si=Yya8m6i7JUoSdZm4"
118+
playing
119+
controls
120+
light={videoThumbnail}
121+
playIcon={
122+
<img
123+
src={playIcon}
124+
className="playBtn"
125+
loading="eager"
126+
alt="Play"
127+
role="button"
128+
aria-label="Play"
129+
style={{ fontSize: "24px" }}
130+
/>
131+
}
132+
width="100%"
133+
height="100%"
134+
className="embedVideo"
135+
onReady={handleVideoReady}
136+
onStart={handleVideoReady}
137+
onPlay={handleVideoReady}
138+
onBufferEnd={handleVideoReady}
139+
onClickPreview={handleVideoReady}
140+
config={{
141+
youtube: {
142+
playerVars: {
143+
rel: 0,
144+
modestbranding: 1,
145+
}
146+
}
147+
}}
148+
/>
149+
</div>
150+
</Col>
151+
)}
152+
</Row>
153+
</Container>
154154
</BGImg>
155155
</Banner1SectionWrapper>
156156
);

0 commit comments

Comments
 (0)