Анимированная инфо карта

Разработка Анимированная инфо карта

Нет прав для скачивания
Анимированная инфо карта.
Пишем нашу разметку:
HTML:
<div id='wrap'>
  <input type='checkbox'>
  <div class='back'>
    <b>&larr;</b>
  </div>
  <div class='frame'>
    <input checked='checked' id='rad1' name='rad' type='radio'>
    <input id='rad2' name='rad' type='radio'>
    <input id='rad3' name='rad' type='radio'>
    <div class='nav'></div>
    <div class='nav'></div>
    <div class='nav'></div>
    <div class='indicator'></div>
    <div class='inner'>
      <div class='content'>
        <h1 data-splitting='chars'>Nulla facilisi maecenas malesuada</h1>
        <p>Donec orci lectus, aliquam ut, faucibus non, euismod id, nulla. Integer tincidunt. Praesent turpis. Nulla neque dolor, sagittis eget, iaculis quis, molestie non, velit.</p>
      </div>
      <div class='content'>
        <h1 data-splitting='chars'>Pellentesque commodo eros</h1>
        <p>Morbi ac felis. Sed aliquam ultrices mauris. Quisque id odio. Cras sagittis. Fusce vulputate eleifend sapien.</p>
      </div>
      <div class='content'>
        <h1 data-splitting='chars'>Fusce risus nisl viverra</h1>
        <p>Vestibulum rutrum, mi nec elementum vehicula, eros quam gravida nisl, id fringilla neque ante vel mi. Quisque id odio. Fusce fermentum.</p>
      </div>
      <div class='more'>
        <b>&rarr;</b>
        <b>&rarr;</b>
        <b>&rarr;</b>
      </div>
      <div class='images'>
        <div>
          <div class='image'></div>
        </div>
        <div>
          <div class='image'></div>
        </div>
        <div>
          <div class='image'></div>
        </div>
      </div>
    </div>
    <div class='box'>
      <div class='internal'>
        <p>Sed mollis, eros et ultrices tempus, mauris ipsum aliquam libero, non adipiscing dolor urna a orci. Cras varius. Vivamus laoreet. Donec vitae sapien ut libero venenatis faucibus. Vestibulum turpis sem, aliquet eget, lobortis pellentesque, rutrum eu, nisl.</p>
        <div class='image'></div>
      </div>
      <div class='internal'>
        <p>Phasellus viverra nulla ut metus varius laoreet. Vestibulum turpis sem, aliquet eget, lobortis pellentesque, rutrum eu, nisl. Duis lobortis massa imperdiet quam. Aenean vulputate eleifend tellus. Morbi mollis tellus ac sapien.</p>
        <div class='image'></div>
      </div>
      <div class='internal'>
        <p>Praesent metus tellus, elementum eu, semper a, adipiscing nec, purus. Aenean commodo ligula eget dolor. Vestibulum fringilla pede sit amet augue. Fusce convallis metus id felis luctus adipiscing. Ut id nisl quis enim dignissim sagittis.</p>
        <div class='image'></div>
      </div>
    </div>
  </div>
</div>
Пишем стиль:
SCSS:
$r: #ff3432;
$b: #1161a4;
$o: #feb339;
$g: #10c8b3;
$y: #ffca58;

body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
  font-family: 'Josefin Sans';
  * {
    box-sizing: border-box;
  }
  #wrap {
    position: absolute;
    width: 500px;
    height: 600px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    background: $b;
    input {
      &:hover {
        cursor: pointer;
      }
    }
    input[type='checkbox'] {
      position: absolute;
      width: 150px;
      height: 70px;
      bottom: 0;
      z-index: 999;
      right: 0;
      opacity: 0;
      &:hover ~ .frame {
        .more {
          b {
            &:after {
              background: #fff;
            }
          }
        }
      }
      &:hover ~ .back {
        b {
          &:after {
            transition-delay: 0;
            background: $g;
          }
        }
      }
      &:checked {
        right: auto;
        left: 0;
        & ~ .back {
          b {
            transition-delay: 1.1s;
            transform: scale(1);
            color: #fff;
            &:after {
              border-color: #fff;
            }
            &:before {
              transition-delay: 1.3s;
              border-color: #fff;
              transform: scale(1);
            }
          }
        }
      }
      &:checked ~ .frame {
        transform: translateX(-150%);
        transition-delay: 0.4s;
        .more {
          transform: scale(0);
        }
        .images {
          transition: all 400ms cubic-bezier(1, 0.885, 0.72, 1);
          transition-delay: 0.1s;
          transform: translateY(-100%);
        }
        h1 {
          transition: 0.3s ease-in-out;
          transform: translateX(-100vw);
        }
        input {
          @for $i from 1 through 3 {
            &:nth-of-type(#{$i}) {
              &:checked {
                & ~ .box {
                  .internal {
                    .image {
                      transition-delay: 0.25s;
                      transform: scale(1.25);
                      &:before {
                        transform: translateY(-50%);
                      }
                    }
                    &:nth-of-type(#{$i}) {
                      p {
                        transition-delay: 1s;
                        transform: translateX(0) skewX(0deg);
                        &:before {
                          transform: scale(1);
                          opacity: 1;
                          transition-delay: 1.6s;
                        }
                      }
                    }
                  }
                }
                & ~ .indicator {
                  transition: 0.3s ease-in-out;
                  height: 100%;
                  transform: translateY(0);
                  background: $b;
                }
                & ~ .inner .content {
                  &:nth-of-type(#{$i}) {
                    p {
                      transition: padding-top
                        300ms
                        cubic-bezier(1, 0.885, 0.72, 1);
                      transition-delay: 0s;
                      padding-top: 300px;
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    .frame {
      position: absolute;
      width: 100%;
      height: 100%;
      top: 0;
      left: 0;
      transition: transform 400ms cubic-bezier(1, 0.385, 0.42, 1);
      background: linear-gradient(to right, #fff 10%, $y 10%);
      &:after {
        content: '';
        position: absolute;
        width: 50%;
        height: 100%;
        background: linear-gradient(to right, $o 50%, $r 50%);
        left: 100%;
        transition: transform 400ms cubic-bezier(1, 0.385, 0.42, 1);
      }
      .box {
        position: absolute;
        width: 100%;
        height: 100%;
        z-index: 999;
        left: 150%;
        color: #fff;
        overflow: hidden;
        .internal {
          position: absolute;
          width: 100%;
          height: 100%;
          top: 0;
          left: 0;
          padding: 10% 20%;
          .image {
            position: absolute;
            width: 100%;
            height: 50%;
            background-image: url('https://puu.sh/Ddl4B/c78b869b7a.jpg');
            bottom: 0;
            left: 0;
            background-size: cover;
            background-position:bottom;
            z-index: -1;
            transition: 4s ease-in-out;
            &:before {
              content: '';
              position: absolute;
              width: 100%;
              height: 200%;
              left: 0;
              top: 0;
              background: linear-gradient(
                to bottom,
                $b 50%,
                rgba(255, 255, 255, 0.001) 150%
              );
              transition: 4s ease-in-out;
            }
          }
        }
        p {
          transform: translateX(500px) skewX(-30deg);
          transition: transform 400ms cubic-bezier(1, 0.385, 0.82, 1);
          font-size: 18px;
          line-height: 1.5;
          &:before {
            content: '';
            position: absolute;
            width: 120%;
            height: 120%;
            top: -10%;
            left: -10%;
            box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15),
              0 10px 20px -5px darken($b, 2.5%);
            opacity: 0;
            transform: scale(1.5);
            transition: 0.75s ease-in-out;
          }
        }
      }
    }
    input {
      opacity: 0;
      z-index: 999;
      @for $i from 1 through 3 {
        &:nth-of-type(#{$i}) {
          &:hover {
            & ~ .nav {
              &:nth-of-type(#{$i}) {
                &:before {
                  color: $r;
                }
              }
            }
          }
          &:checked {
            & ~ .nav {
              &:nth-of-type(#{$i}) {
                &:before {
                  color: #fff;
                  transform: translate(-50%, -50%) rotate(-90deg) scale(1.2);
                  transition-delay: 0.1s;
                }
              }
            }
            & ~ .indicator {
              transform: translateY(#{($i - 1) * 100%});
            }
            & ~ .inner {
              input {
                pointer-events: all;
              }
              .more {
                b {
                  &:nth-of-type(#{$i}) {
                    transition-delay: 2.2s;
                    transform: scale(1);
                    &:before {
                      transition-delay: 2.4s;
                      transform: scale(1);
                    }
                  }
                }
              }
              .images {
                div:not(.image) {
                  &:nth-of-type(#{$i}) {
                    z-index: 1;
                    &:before {
                      transition: transform
                        2000ms
                        cubic-bezier(1, 0.885, 0.82, 0.5);
                      transform: translateY(-200%);
                      opacity: 1;
                    }
                    .image {
                      opacity: 1;
                      transform: scale(1);
                    }
                  }
                }
              }
              .content {
                &:nth-of-type(#{$i}) {
                  p {
                    transition: transform 500ms cubic-bezier(1, 0.885, 0.72, 1);
                    transition-delay: 1.5s;
                    transform: rotate(0deg) translateY(0);
                  }
                  h1 {
                    opacity: 1;
                    .word {
                      @for $i from 1 through 10 {
                        &:nth-of-type(#{$i}) {
                          span {
                            @for $j from 1 through 15 {
                              &:nth-of-type(#{$j}) {
                                transition: transform
                                  200ms
                                  cubic-bezier(0.175, 0.885, 0.32, 1.275);
                                transition-delay: #{(($i + ($j/2.5)) / 20) +
                                  1.5}s;
                                transform: scale(1) rotate(0deg);
                              }
                            }
                          }
                        }
                      }
                    }
                    &:after,
                    &:before {
                      transition-delay: 1s;
                      transform: scaleX(1);
                    }
                    &:before {
                      transition-delay: 1.3s;
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    input[type='radio'],
    .nav,
    .indicator {
      height: 33.33%;
      position: absolute;
      width: 10%;
      left: 0;
      box-shadow: inset 0 0 0 2px $b;
      @for $i from 1 through 3 {
        &:nth-of-type(#{$i}) {
          top: #{($i - 1) * 33.33%};
        }
      }
    }
    .nav {
      z-index: 2;
      &:nth-of-type(2) {
        box-shadow: inset -2px 0 0 $b, inset 2px 0 0 $b;
        &:before {
          content: 'TWO';
        }
      }
      &:nth-of-type(3) {
        &:before {
          content: 'THREE';
        }
      }
      &:before {
        content: 'ONE';
        position: absolute;
        display: inline-block;
        color: $b;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(-90deg);
        transition: all 200ms cubic-bezier(1, 0.885, 0.32, 1);
      }
    }
    .indicator {
      background: $g;
      transition: all 200ms cubic-bezier(1, 0.885, 0.32, 1);
      z-index: 0;
      box-shadow: none;
    }
    .inner {
      position: absolute;
      width: 90%;
      left: 10%;
      top: 0;
      overflow: hidden;
      height: 100%;
      .images {
        position: absolute;
        width: 100%;
        height: 100%;
        bottom: 50%;
        overflow: hidden;
        transition: all 300ms cubic-bezier(1, 0.885, 0.72, 1);
        div:not(.image) {
          position: absolute;
          width: 100%;
          height: 100%;
          z-index: 0;
          &:before {
            content: '';
            position: absolute;
            width: 100%;
            height: 200%;
            left: 0;
            top: 100%;
            background: $o;
            transform: translateY(100%);
            z-index: 2;
            opacity: 0;
          }
          &:nth-of-type(2) {
            .image {
              background-image: url('https://puu.sh/DdcJi/a10cb7ffc1.jpg');
            }
          }
          &:nth-of-type(3) {
            .image {
              background-image: url('https://puu.sh/DdcOe/281086cd16.jpg');
            }
          }
          .image {
            width: 100%;
            height: 50%;
            position: absolute;
            bottom: 0;
            left: 0;
            z-index: -1;
            background-image: url('https://puu.sh/DdbZq/8577c8d00c.jpg');
            opacity: 0;
            transform: scale(1.5) rotate(-15deg);
            transition: opacity 1s ease-in-out, transform 2s ease-in-out;
            transition-delay: 1s, 1s;
            background-size: cover;
            background-position: center;
          }
        }
      }
      .content {
        position: absolute;
        width: 100%;
        height: 50%;
        left: 0;
        top: 50%;
        overflow: hidden;
        z-index: 2;
        transition: all 300ms cubic-bezier(1, 0.885, 0.72, 1);
      }
      h1 {
        display: inline-block;
        position: relative;
        width: auto;
        color: #fff;
        z-index: 1;
        width: 100%;
        opacity: 1;
        margin: 0;
        padding: 5%;
        overflow: hidden;
        font-family: 'Lora';
        font-weight: 100;
        &:after {
          content: '';
          position: absolute;
          box-shadow: inset 0 -2px $r, inset 0 2px $r;
          width: 140%;
          height: 100%;
          left: -20%;
          top: 0%;
          z-index: -1;
          transition: all 500ms cubic-bezier(1, 0.885, 0.32, 1);
          transform: scaleX(0);
          transform-origin: right;
        }
        &:before {
          content: '';
          position: absolute;
          width: 140%;
          height: 100%;
          left: -20%;
          top: 0%;
          background: $r;
          z-index: -1;
          transition: all 300ms cubic-bezier(1, 0.885, 0.32, 1);
          transform: scaleX(0);
          transform-origin: left;
        }
        span {
          display: inline-block;
          position: relative;
          &.char {
            transform: scale(0) rotate(-30deg);
          }
          &.whitespace {
            width: 10px;
          }
        }
      }
      .content p {
        transform: rotate(20deg) translateY(300px);
        transition: transform 200ms cubic-bezier(1, 0.885, 0.72, 1);
        transform-origin: left;
        display: inline-block;
        max-width: 90%;
        margin: 2.5% 5%;
        line-height: 1.5;
        color: #333;
        font-size: 18px;
      }
    }
  }

  .more,
  .back {
    position: absolute;
    z-index: 5;
    bottom: 10px;
    right: 10px;
    height: 50px;
    width: 50px;
    display: inline-block;
    b {
      position: absolute;
      font-family: 'Lora';
      font-size: 30px;
      color: $r;
      left: 0;
      top: 0;
      transform: scale(0);
      transition: transform 100ms cubic-bezier(1, 0.885, 0.72, 1.25);
      &:before,
      &:after {
        content: '';
        position: absolute;
        width: 35px;
        height: 35px;
        border: 2px solid $r;
        border-radius: 100%;
        z-index: -1;
        left: calc(50% - 20px);
        top: calc(50% - 20px);
        transition: 0.2s ease-in-out;
        transform: scale(1.2);
      }
    }
  }
  .back {
    right: auto;
    left: 5%;
    &:before,
    &:after {
      border-color: #fff;
    }
  }
}
Короткий код jquery:
JavaScript:
Splitting();
Смотрим наш результат:
dr12.gif
Автор
baltun
Скачиваний
0
Просмотры
538
Первый выпуск
Обновление
Рейтинг
0.00 звёзд Оценок: 0

Ещё ресурсы от baltun

Назад
Верх Низ