<template>
  <div class="r-img">
    <div class="r-normal" @click="clickHandle">
      <img :src="cover[0]" alt>
    </div>
    <div class="rotate">
      <img :src="cover[1]" alt>
    </div>
  </div>
</template>

<script>
export default {
  props: ['imgs', 'cover'],
  methods: {
    clickHandle () {
      this.$emit('clickHandle')
    }
  }
}
</script>

<style scoped>
.r-img {
  position: relative;
}

.r-img div {
  width: 17vw;
  height: 18vw;
  position: absolute;
  top: 0;
  z-index: 99;
  border: 8px #fff solid;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.5);
}

.r-img div img {
  transition: transform 0.3s ease;
  width: 100%;
  height: 100%;
}
/* .r-img div:hover img {
  transform: scale(1.1);
  transition: transform 0.3s ease;
} */
.r-img .r-normal{
  transform: rotate(0);
  transition: transform 0.3s ease;
  transform-origin:right top;
  cursor: pointer;
}

.r-img .r-normal:hover{
  transform: rotate(-5deg);
}

.r-img .rotate {
  transform: rotate(17deg);
  z-index: 0;
}

@media screen and (max-width: 770px) {
  .r-img div {
    top: 18vw;
  }
}
</style>
