<a class="card-04" href="#">
    <div class="card-04__head">
        <div class="card-04__img"><img src="https://picsum.photos/400/200" width="400" height="200" alt="" /></div>
        <h3 class="card-04__title">タイトルが入ります。タイトルが入ります。</h3>
    </div>
    <p class="card-04__text">テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。</p>
    <div class="card-04__arrow"><span></span><span></span><span></span><span></span><span></span><span></span></div>
</a>
a.card-04(href=link)
  .card-04__head
    .card-04__img
      img(src=img, width=width, height=height, alt='')
    h3.card-04__title #{ title }
  p.card-04__text #{ text }
  .card-04__arrow
    span
    span
    span
    span
    span
    span
{
  "link": "#",
  "img": "https://picsum.photos/400/200",
  "width": 400,
  "height": 200,
  "title": "タイトルが入ります。タイトルが入ります。",
  "text": "テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。"
}
  • Content:
    $BLOCK_NAME: '.card-04';
    
    // 変数
    $color_primary: #0a3da0;
    $color_border: #d7dbe3;
    $duration_default: 0.3s;
    $duration_dot: 0.15s;
    $easing_default: cubic-bezier(0.47, 0, 0.745, 0.715);
    $dot_positions: (
      1: (
        bottom: 0,
        right: 0,
      ),
      2: (
        bottom: 0,
        right: 6,
      ),
      3: (
        bottom: 0,
        right: 12,
      ),
      4: (
        bottom: 6,
        right: 0,
      ),
      5: (
        bottom: 6,
        right: 6,
      ),
      6: (
        bottom: 12,
        right: 0,
      ),
    );
    $dot_hover_positions: (
      1: (
        bottom: 0,
        right: 0,
      ),
      2: (
        bottom: 0,
        right: 0,
      ),
      3: (
        bottom: 0,
        right: 6,
      ),
      4: (
        bottom: 0,
        right: 0,
      ),
      5: (
        bottom: 0,
        right: 0,
      ),
      6: (
        bottom: 6,
        right: 0,
      ),
    );
    
    #{ $BLOCK_NAME } {
      position: relative;
      display: block;
      padding: 20px 0 48px;
      font-family: 'Sawarabi Gothic', sans-serif;
      border-top: 1px solid $color_border;
      @include Mq(md) {
        max-width: 360px;
        padding-top: 0;
        border-top: none;
      }
      &:first-of-type {
        border-top: none;
      }
      &__head {
        display: flex;
        justify-content: space-between;
        @include Mq(md) {
          display: block;
        }
      }
      &__img {
        width: calc(50% - 10px);
        overflow: hidden;
        @include Mq(md) {
          width: 100%;
        }
        & > img {
          width: 100%;
          transition: transform $duration_default $easing_default;
          @at-root #{ $BLOCK_NAME }:hover & {
            transform: scale(1.2);
          }
        }
      }
      &__title {
        width: calc(50% - 10px);
        font-weight: bold;
        line-height: 1.625;
        color: $color_primary;
        letter-spacing: 0.4px;
        @include Mq(md) {
          width: 100%;
          padding: 0 20px;
          margin-top: 15px;
        }
      }
      &__text {
        margin-top: 15px;
        font-size: 14px;
        line-height: 1.78;
        @include Mq(md) {
          padding: 0 20px;
          margin-top: 5px;
        }
      }
      &__arrow {
        position: absolute;
        right: 0;
        bottom: 20px;
        display: block;
        @include Mq(md) {
          right: 10px;
          bottom: 10px;
        }
        & > span {
          position: absolute;
          right: 0;
          bottom: 0;
          display: block;
          width: 3px;
          height: 3px;
          background: $color_primary;
          border-radius: 2px;
          transition: all $duration_dot $easing_default;
          @for $i from 1 through 6 {
            &:nth-child(#{$i}) {
              right: #{map-get(map-get($dot_positions, $i), right)}px;
              bottom: #{map-get(map-get($dot_positions, $i), bottom)}px;
            }
            @at-root #{ $BLOCK_NAME }:hover &:nth-child(#{$i}) {
              right: #{map-get(map-get($dot_hover_positions, $i), right)}px;
              bottom: #{map-get(map-get($dot_hover_positions, $i), bottom)}px;
            }
          }
        }
      }
    }
    
  • URL: /components/raw/card04/card04.scss
  • Filesystem Path: src/components/cards/1_20/card04/card04.scss
  • Size: 2.7 KB