diff --git a/src/widgets/WpPost/Projects.scss b/src/widgets/WpPost/Projects.scss index 260e184..e0ede72 100644 --- a/src/widgets/WpPost/Projects.scss +++ b/src/widgets/WpPost/Projects.scss @@ -31,6 +31,39 @@ $swiper-button-arrow-size: 20px; margin-bottom: 2em; } + .wp-block-video, + .wp-block-embed { + width: 100%; + max-width: 100%; + margin: 1em 0; + + video, + iframe { + width: 100%; + height: auto; + aspect-ratio: 16 / 9; // Стандартное соотношение сторон для видео + border-radius: $border-raduis; + background: $background-tape; + } + } + + // Для случаев, когда нужно фиксированное соотношение сторон + .fixed-aspect-video { + position: relative; + padding-bottom: 56.25%; /* 16:9 соотношение */ + height: 0; + overflow: hidden; + + iframe, + video { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } + } + .is-layout-flex { display: flex; justify-content: space-between; @@ -41,6 +74,7 @@ $swiper-button-arrow-size: 20px; max-width: 100%; height: auto; object-fit: contain !important; // Wordpress накидывает styles к элементу, приходится перебивать + pointer-events: none; } } @@ -207,7 +241,7 @@ $swiper-button-arrow-size: 20px; } } -@media (max-width: 768px) { +@media (max-width: 1200px) { .project .is-layout-flex { flex-direction: column !important; align-items: stretch !important;