カード17

300 × 150
<div class="bg-gray"></div>
<div class="card-17">
    <div class="card-17__img"><img src="https://picsum.photos/id/1000/400/400" /></div>
    <div class="card-17__content">
        <div class="card-17__text">
            <p class="card-17__date">2021-00-00</p>
            <h3 class="card-17__title">テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。</h3>
        </div>
        <div class="card-17__foot">
            <div class="card-17__tags"><span class="card-17__tag">CATEGORY</span></div><a class="card-17__button" href="#"><span>VIEW MORE</span></a>
        </div>
    </div>
</div>
.bg-gray
.card-17
  .card-17__img
    img(src=img)
  .card-17__content
    .card-17__text
      p.card-17__date #{ date }
      h3.card-17__title #{ title }
    .card-17__foot
      .card-17__tags
        span.card-17__tag #{ tag }
      a.card-17__button(href=link)
        span VIEW MORE
{
  "link": "#",
  "img": "https://picsum.photos/id/1000/400/400",
  "date": "2021-00-00",
  "title": "テキストが入ります。テキストが入ります。テキストが入ります。テキストが入ります。",
  "tag": "CATEGORY"
}
  • Content:
    $BLOCK_NAME: '.card-17';
    
    // 変数
    $color_primary: #e87518;
    $color_white: #fff;
    $color_gray: #7d7d7d;
    $color_border: #e7e7e7;
    $color_tag_border: #bababa;
    $radius_default: 12px;
    $duration_default: 0.6s;
    $easing_default: cubic-bezier(0.075, 0.82, 0.165, 1);
    
    #{ $BLOCK_NAME } {
      display: flex;
      overflow: hidden;
      background: $color_white;
      border-radius: $radius_default;
    
      &__img {
        flex-shrink: 0;
        width: 160px;
        & > img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          object-position: center;
        }
      }
    
      &__content {
        display: flex;
        flex-direction: column;
        flex-grow: 1;
        height: 100%;
      }
    
      &__text {
        flex-grow: 1;
        padding: 32px;
      }
    
      &__date {
        font-family: 'Barlow', sans-serif;
        font-size: 14px;
        color: $color_gray;
      }
    
      &__title {
        margin-top: 16px;
      }
    
      &__foot {
        display: flex;
        justify-content: space-between;
        height: 60px;
        border-top: 1px solid $color_border;
      }
    
      &__tags {
        display: flex;
        align-items: center;
        padding: 0 32px;
      }
    
      &__tag {
        width: 140px;
        height: 28px;
        font-family: 'Barlow', sans-serif;
        font-size: 11px;
        line-height: 24px;
        color: $color_gray;
        text-align: center;
        border: 1px solid $color_tag_border;
        border-radius: 9999px;
      }
    
      &__button {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 160px;
        height: 100%;
        font-family: 'Barlow', sans-serif;
        font-size: 14px;
        color: $color_primary;
        border-left: 1px solid $color_border;
        transition: color $duration_default $easing_default;
        &::before {
          position: absolute;
          top: 0;
          right: 0;
          bottom: 0;
          left: 0;
          content: '';
          background: $color_primary;
          transition: transform $duration_default $easing_default;
          transform: scaleX(0);
          transform-origin: right;
        }
        & > span {
          position: relative;
          z-index: 1;
        }
        &:hover {
          color: $color_white;
          &::before {
            transform: scaleX(1);
            transform-origin: left;
          }
        }
      }
    }
    
    .bg-gray {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      z-index: -1;
      background: #faf9f7;
    }
    
  • URL: /components/raw/card17/card17.scss
  • Filesystem Path: src/components/cards/1_20/card17/card17.scss
  • Size: 2.3 KB