Skip to content

Commit 4b7bea9

Browse files
authored
fix(website): make YT iframe responsive (#6667)
* fix(website): make YT iframe responsive * Redesign
1 parent e42f57e commit 4b7bea9

File tree

2 files changed

+53
-29
lines changed

2 files changed

+53
-29
lines changed

website/src/pages/index.tsx

+34-29
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,26 @@ function TweetsSection() {
109109
);
110110
}
111111

112-
function ELIVideo() {
112+
function VideoContainer() {
113113
return (
114-
<div className="container">
115-
<div className="margin-top--md">
116-
<iframe
117-
width="560"
118-
height="315"
119-
src="https://www.youtube.com/embed/_An9EsKPhp0"
120-
title="Explain Like I'm 5: Docusaurus"
121-
frameBorder="0"
122-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
123-
allowFullScreen
124-
/>
114+
<div className="container text--center margin-bottom--xl">
115+
<div className="row">
116+
<div className="col">
117+
<h2>
118+
<Translate>Check it out in the intro video</Translate>
119+
</h2>
120+
<div className={styles.ytVideo}>
121+
<iframe
122+
width="560"
123+
height="315"
124+
src="https://www.youtube.com/embed/_An9EsKPhp0"
125+
title="Explain Like I'm 5: Docusaurus"
126+
frameBorder="0"
127+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
128+
allowFullScreen
129+
/>
130+
</div>
131+
</div>
125132
</div>
126133
</div>
127134
);
@@ -199,7 +206,12 @@ function Home(): JSX.Element {
199206
</div>
200207
</div>
201208
<div className={styles.section}>
209+
<VideoContainer />
210+
202211
<div className="container text--center margin-bottom--xl">
212+
<h2>
213+
<Translate>Main features</Translate>
214+
</h2>
203215
<div className="row">
204216
<div className="col">
205217
<img
@@ -209,9 +221,9 @@ function Home(): JSX.Element {
209221
width="1009.54"
210222
height="717.96"
211223
/>
212-
<h2 className={clsx(styles.featureHeading)}>
224+
<h3 className={clsx(styles.featureHeading)}>
213225
<Translate>Powered by Markdown</Translate>
214-
</h2>
226+
</h3>
215227
<p className="padding-horiz--md">
216228
<Translate>
217229
Save time and focus on your project&apos;s documentation.
@@ -230,9 +242,9 @@ function Home(): JSX.Element {
230242
width="1108"
231243
height="731.18"
232244
/>
233-
<h2 className={clsx(styles.featureHeading)}>
245+
<h3 className={clsx(styles.featureHeading)}>
234246
<Translate>Built Using React</Translate>
235-
</h2>
247+
</h3>
236248
<p className="padding-horiz--md">
237249
<Translate>
238250
Extend or customize your project&apos;s layout by reusing
@@ -249,9 +261,9 @@ function Home(): JSX.Element {
249261
width="1137"
250262
height="776.59"
251263
/>
252-
<h2 className={clsx(styles.featureHeading)}>
264+
<h3 className={clsx(styles.featureHeading)}>
253265
<Translate>Ready for Translations</Translate>
254-
</h2>
266+
</h3>
255267
<p className="padding-horiz--md">
256268
<Translate>
257269
Localization comes pre-configured. Use Crowdin to translate
@@ -271,9 +283,9 @@ function Home(): JSX.Element {
271283
width="1038.23"
272284
height="693.31"
273285
/>
274-
<h2 className={clsx(styles.featureHeading)}>
286+
<h3 className={clsx(styles.featureHeading)}>
275287
<Translate>Document Versioning</Translate>
276-
</h2>
288+
</h3>
277289
<p className="padding-horiz--md">
278290
<Translate>
279291
Support users on all versions of your project. Document
@@ -290,9 +302,9 @@ function Home(): JSX.Element {
290302
width="1137.97"
291303
height="736.21"
292304
/>
293-
<h2 className={clsx(styles.featureHeading)}>
305+
<h3 className={clsx(styles.featureHeading)}>
294306
<Translate>Content Search</Translate>
295-
</h2>
307+
</h3>
296308
<p className="padding-horiz--md">
297309
<Translate>
298310
Make it easy for your community to find what they need in
@@ -303,13 +315,6 @@ function Home(): JSX.Element {
303315
</div>
304316
</div>
305317
</div>
306-
<div className="container text--center">
307-
<div className="row">
308-
<div className="col">
309-
<ELIVideo />
310-
</div>
311-
</div>
312-
</div>
313318
</div>
314319
<TweetsSection />
315320
<div className={clsx(styles.section)}>

website/src/pages/styles.module.css

+19
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,22 @@
179179
.test-marker-site-index-page {
180180
content: 'site-index-page';
181181
}
182+
183+
@media only screen and (max-width: 996px) {
184+
.ytVideo {
185+
position: relative;
186+
overflow: hidden;
187+
width: 100%;
188+
max-width: 560px;
189+
margin: 0 auto;
190+
padding-top: 56.25%;
191+
}
192+
193+
.ytVideo iframe {
194+
position: absolute;
195+
top: 0;
196+
left: 0;
197+
width: 100%;
198+
height: 100%;
199+
}
200+
}

0 commit comments

Comments
 (0)