@import './common/var.css';

.van-notice-bar {
  display: flex;
  color: $orange;
  padding: 9px 15px;
  font-size: 12px;
  line-height: 1.5;
  position: relative;
  background-color: #fff7cc;

  &--withicon {
    position: relative;
    padding-right: 30px;
  }

  &__left-icon {
    height: 18px;
    min-width: 20px;
    padding-top: 1px;
    box-sizing: border-box;

    img {
      width: 16px;
      height: 16px;
    }
  }

  &__right-icon {
    top: 10px;
    right: 10px;
    position: absolute;
    font-size: 15px;
    line-height: 1;
  }

  &__wrap {
    flex: 1;
    height: 18px;
    overflow: hidden;
    position: relative;
  }

  &__content {
    position: absolute;
    white-space: nowrap;
  }

  &__play {
    animation: van-notice-bar-play linear both;
  }

  &__play--infinite {
    animation: van-notice-bar-play-infinite linear infinite both;
  }
}

/**
 * Declare two same keyframes
 * In case that some mobile browsers can continue animation when className changed
 */
@keyframes van-notice-bar-play {
  to { transform: translate3d(-100%, 0, 0); }
}

@keyframes van-notice-bar-play-infinite {
  to { transform: translate3d(-100%, 0, 0); }
}
