<template>
  <span class="spot">
    <slot />
    <span class="box" :class="{ visible: spotsVisible }"></span>
  </span>
</template>

<script lang="ts" setup>
const spotsVisible = useSpotsVisible()
</script>

<style scoped>
.spot {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

:deep(img) {
  opacity: 0;
  transition: opacity 0.3s ease;
  transform: translate3d(0, 0, 0);
}

.spot:hover :deep(img) {
  opacity: 1;
}

.box {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  border: 1px solid rgb(0, 140, 255);
  background: rgba(0, 140, 255, 0.25);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.visible {
  opacity: 1;
}
</style>
