Skip to content

Commit 29cb6d9

Browse files
committed
Adjustment with video
1 parent c07d84b commit 29cb6d9

File tree

1 file changed

+71
-18
lines changed

1 file changed

+71
-18
lines changed

src/pages/index.astro

Lines changed: 71 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const description = "Product designer in Lisbon, Portugal. Wants to design inter
4545
</header>
4646
<section class="init">
4747
<div class="reel">
48-
<div class="description card showreel">
48+
<div class="showreel card">
4949
<video width="1920" height="1080" autoplay muted loop src="videos/showreel.mp4">
5050
Showcase of examples of my work.
5151
</video>
@@ -220,19 +220,41 @@ section.gallery {
220220

221221
/* Showreel */
222222

223-
.showreel {
223+
.showreel.card {
224224
position: relative;
225+
width: var(--slideDescWidth);
226+
max-width: var(--slideDescContentWidth);
227+
height: fit-content;
228+
aspect-ratio: 16 / 9;
229+
padding: var(--slidePadding);
230+
margin-left: var(--slideMargin);
231+
border-radius: var(--slidePadding);
232+
clip-path: var(--clipBevel);
225233
background-color: white;
226234
}
227-
.showreel video {
235+
@supports not (aspect-ratio: 16 / 9) {
236+
.showreel.card::before {
237+
float: left;
238+
padding-top: 56.25%;
239+
content: "";
240+
}
241+
.showreel.card::after {
242+
display: block;
243+
content: "";
244+
clear: both;
245+
}
246+
}
247+
.showreel.card video {
228248
position: absolute;
229249
display: block;
230-
top: 50%;
231-
left: 50%;
232-
height: 100%;
250+
top: 0;
251+
right: 0;
252+
bottom: 0;
253+
left: 0;
233254
width: 100%;
234-
transform: translate(-50%, -50%);
255+
height: 100%;
235256
object-fit: cover;
257+
transform: scale(0.875);
236258
}
237259

238260
/* Link Card */
@@ -250,7 +272,7 @@ section.gallery {
250272
@supports not (aspect-ratio: 3 / 4) {
251273
.link.card::before {
252274
float: left;
253-
padding-top: 100%;
275+
padding-top: 75%;
254276
content: "";
255277
}
256278
.link.card::after {
@@ -394,6 +416,7 @@ section.gallery {
394416
.link.card {
395417
width: calc(var(--slideLinkWidth) / 2);
396418
}
419+
397420
}
398421
@media (pointer: coarse) and (max-width: 50em) {
399422
.gallery .nav {
@@ -403,6 +426,46 @@ section.gallery {
403426
display: inline;
404427
}
405428
}
429+
@media (max-width: 50em) {
430+
.showreel.card {
431+
aspect-ratio: 4 / 3;
432+
}
433+
@supports not (aspect-ratio: 4 / 3) {
434+
.showreel.card::before {
435+
float: left;
436+
padding-top: 75%;
437+
content: "";
438+
}
439+
.showreel.card::after {
440+
display: block;
441+
content: "";
442+
clear: both;
443+
}
444+
}
445+
.showreel.card video {
446+
transform: scale(0.9375);
447+
}
448+
}
449+
@media (max-width: 30em) {
450+
.showreel.card {
451+
aspect-ratio: 1 / 1;
452+
}
453+
@supports not (aspect-ratio: 1 / 1) {
454+
.showreel.card::before {
455+
float: left;
456+
padding-top: 100%;
457+
content: "";
458+
}
459+
.showreel.card::after {
460+
display: block;
461+
content: "";
462+
clear: both;
463+
}
464+
}
465+
.showreel.card video {
466+
transform: scale(1);
467+
}
468+
}
406469
@media (max-width: 30em) and (min-height: 40em) {
407470
.description.card {
408471
min-height: calc(70vh - var(--slideMarginTotal) - var(--slidePaddingTotal));
@@ -414,16 +477,6 @@ section.gallery {
414477
min-height: calc((70vh - var(--slideMarginTotal) - var(--slidePaddingTotal)) / 2);
415478
}
416479
}
417-
@media (max-width: 40em) {
418-
.showreel video {
419-
height: 80%;
420-
}
421-
}
422-
@media (max-width: 30em) {
423-
.showreel video {
424-
height: 75%;
425-
}
426-
}
427480

428481
</style>
429482

0 commit comments

Comments
 (0)