Web Design Guide 2024-10-28 08:44:01 | 2.0.0
<div class=" media ">
    <iframe class="media__item" src="" frameborder="0" allowfullscreen></iframe>
</div>
<div class="{{mixes}} media {{modifiers}}">
  <iframe class="media__item" src="{{{src}}}" frameborder="0" allowfullscreen></iframe>
</div>
{
  "src": null,
  "alt": "Imaginary video"
}
  • Content:
    /* Responsive Media */
    
    .media {
      $self: &;
    
      $aspect-ratio: map-get($aspect-ratios, $base-aspect-ratio);
    
      @include aspect-ratio($aspect-ratio);
    
      position: relative;
      display: block;
      overflow: hidden;
    
      &.-loading {
        //background: transparent url('../images/loader-gif.gif') 50% 50% no-repeat; // css animation? with svg
      }
    
      &.-stretch {
        height: 100%;
    
        // stylelint-disable-next-line scss/selector-no-redundant-nesting-selector
        p:has(&) {
          display: block;
          height: 100%;
        }
      }
    
      &__item {
        position: absolute;
        top: 0;
        left: 0;
        display: block;
        width: 100%;
        height: 100%;
    
        @at-root {
          img#{&},
          video#{&} {
            object-fit: cover;
            object-position: 50% 50%;
          }
    
          img#{&} {
            font-family: 'object-fit: cover; object-position: 50% 50%;';
          }
        }
    
        .cmplazypreviewiframe:not([style*='display: none']) + & {
          z-index: -1;
        }
      }
    
      &.lightbox.-lightboxed {
        @include height-by-aspect-ratio($aspect-ratio);
    
        position: relative;
        margin: auto;
      }
    
      &.lightbox:not(.-lightboxed) {
        @include breakpoint(medium) {
          cursor: pointer;
    
          &::after {
            $symbol-zoom: map-get($icons, 'search');
            @include icon-content-extended($symbol-zoom);
    
            position: absolute;
            right: 0;
            bottom: 0;
            font-size: 3.2rem;
            color: $gray-light;
            text-decoration: none;
            pointer-events: none;
    
            @each $breakpoint, $gutter in $grid-gutters {
              @include breakpoint($breakpoint) {
                $gutter: rem-calc($gutter);
                padding: $gutter / 2;
              }
            }
          }
    
          &:hover::after {
            color: $primary;
          }
        }
      }
    
      .cmplazypreviewiframe {
        position: absolute;
        top: 0;
        left: 0;
      }
    }
    
    .-youtube {
      z-index: 1;
    
      + .-loader {
        position: absolute;
        top: 50%;
        right: 50%;
        z-index: 0;
        transform: translateY(-50%);
    
        .cmplazypreviewiframe:not([style*='display: none']) + & {
          display: none;
        }
      }
    }
    
    .loading-dots {
      position: relative;
      left: -9999px;
      width: 10px;
      height: 10px;
      border-radius: 5px;
      background-color: $secondary;
      box-shadow: 9984px 0 0 0 $secondary, 9999px 0 0 0 $secondary, 10014px 0 0 0 $secondary;
      color: $secondary;
      animation: dotTyping 1.5s infinite linear;
    }
    
    .backdrop {
      position: fixed;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      z-index: 9999;
      display: flex;
      flex-flow: column;
      justify-content: center;
      width: auto;
      max-width: 100%;
      padding: 2.4rem;
      overflow: hidden;
      overflow-y: auto;
      opacity: 0;
      visibility: hidden;
      transform: none;
      background-color: rgba(0, 0, 0, 0.1);
    
      .-loader {
        position: absolute;
        top: 50%;
        right: 50%;
        z-index: 0;
        transform: translateY(-50%);
      }
    
      &.-active {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.25s;
      }
    
      &.-deactivate {
        visibility: hidden;
        transition: opacity 0.25s, visibility 0s 0.25s;
      }
    }
    
    @keyframes dotTyping {
      0% {
        box-shadow: 9984px 0 0 0 $secondary, 9999px 0 0 0 $secondary, 10014px 0 0 0 $secondary;
      }
    
      16.667% {
        box-shadow: 9984px -10px 0 0 $secondary, 9999px 0 0 0 $secondary, 10014px 0 0 0 $secondary;
      }
    
      33.333% {
        box-shadow: 9984px 0 0 0 $secondary, 9999px 0 0 0 $secondary, 10014px 0 0 0 $secondary;
      }
    
      50% {
        box-shadow: 9984px 0 0 0 $secondary, 9999px -10px 0 0 $secondary, 10014px 0 0 0 $secondary;
      }
    
      66.667% {
        box-shadow: 9984px 0 0 0 $secondary, 9999px 0 0 0 $secondary, 10014px 0 0 0 $secondary;
      }
    
      83.333% {
        box-shadow: 9984px 0 0 0 $secondary, 9999px 0 0 0 $secondary, 10014px -10px 0 0 $secondary;
      }
    
      100% {
        box-shadow: 9984px 0 0 0 $secondary, 9999px 0 0 0 $secondary, 10014px 0 0 0 $secondary;
      }
    }
    
  • URL: /components/raw/atoms-media/_media.scss
  • Filesystem Path: src/components/02-ui-components/01-atoms/02-media/_media.scss
  • Size: 3.8 KB

There are no notes for this item.