$loading-size: 70px;

@keyframes refresher-animation {
  0% {
    background-position-x: 0;
  }

  33% {
    background-position-x: -60px;
  }

  66% {
    background-position-x: -120px;
  }

  100% {
    background-position-x: -180px;
  }
}

.v-scroller {
  position: relative;
  height: 100%;
  overflow: hidden;
  @include nightMode('background', $--color-bg-gray);

  &__move {
    position: relative;
    width: 100%;
    height: 100%;
    will-change: transform;

    &.is-refresh-running,
    &.is-infinite-running {
      transition: 200ms transform ease-in;
    }
  }

  &__wrap {
    position: relative;
    height: 100%;
    z-index: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    @include nightMode('background', #fff);

    &.is-loading {
      overflow: hidden;
    }
  }

  &__body {
    position: relative;
  }

  &__pull {
    &__up {
      position: absolute;
      left: 0;
      right: 0;
      bottom: -$loading-size;
      height: $loading-size;
      line-height: $loading-size;
      z-index: 0;
      font-size: 14px;
      text-align: center;
      @include nightMode('color', #999999);
    }

    &__down {
      position: absolute;
      height: $loading-size;
      right: 0;
      left: 0;
      top: -$loading-size;

      &.is-default {
        left: 50%;
        right: auto;
        margin-left: -$loading-size / 2;
        width: $loading-size;
        height: $loading-size;
        background-repeat: no-repeat;
        background-image: url('../components/scroller/image.png');
        background-size: 240px;
        background-position: center;
        background-position-x: 0;

        &.is-loading {
          animation: refresher-animation 320ms steps(1) infinite alternate;
        }
      }
    }
  }

  &__shim {
    &__ref,
    &__top,
    &__btm,
    &__get {
      position: absolute;
      left: 0;
      right: 0;
      background-color: transparent;
      pointer-events: none;
    }

    &__ref {
      top: 0;
      height: 1px;
    }

    &__get {
      bottom: 0;
      height: 1px;
    }

    &__top {
      top: 0;
    }

    &__btm {
      bottom: 0;
    }
  }
}
