Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
chore: automatic eslint fix
Browse files Browse the repository at this point in the history
Signed-off-by: Fernando Fernández <[email protected]>
  • Loading branch information
ferferga committed Feb 29, 2024
1 parent 746cb54 commit c7aee33
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 24 deletions.
31 changes: 19 additions & 12 deletions src/components/Pin.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
<template>
<div class="pin-container"
@mouseover="isHovered = true"
@mouseout="isHovered = false"
@click="changeImage">
<img :src="pinImgs[pinImgsIndex]" alt="Pin" class="pin-image" :class="{ 'scaled': isHovered }">
<div
class="pin-container"
@mouseover="isHovered = true"
@mouseout="isHovered = false"
@click="changeImage">
<img
:src="pinImgs[pinImgsIndex]"
alt="Pin"
class="pin-image"
:class="{ 'scaled': isHovered }" />
</div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import Azul from '@/assets/pin/Pin_Azul.png';
import Verde from '@/assets/pin/Pin_Verde.png';
import Amarillo from '@/assets/pin/Pin_Amarillo.png';
import Marron from '@/assets/pin/Pin_Marron.png';
import Morado from '@/assets/pin/Pin_Morado.png';
import Verde from '@/assets/pin/Pin_Verde.png';
import Amarillo from '@/assets/pin/Pin_Amarillo.png';
import Marron from '@/assets/pin/Pin_Marron.png';
import Morado from '@/assets/pin/Pin_Morado.png';
import Rojo from '@/assets/pin/Pin_Rojo.png';
const pinImgs = [Azul, Amarillo, Verde, Marron, Morado, Rojo];
const pinImgsIndex = ref(0);
/**
* Cambia la imagen del Pin de forma cíclica, basándose en
* el índice de la imagen
*/
function changeImage(): void {
pinImgsIndex.value = (pinImgsIndex.value + 1) % pinImgs.length;
};
Expand All @@ -28,7 +37,7 @@ const isHovered = ref(false);

<style scoped>
.pin-container {
width: 50vw;
width: 50vw;
height: 50vh;
overflow: hidden;
}
Expand All @@ -41,5 +50,3 @@ const isHovered = ref(false);
transition: transform 0.3s ease;
}
</style>


24 changes: 12 additions & 12 deletions src/pages/pinPrueba.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<div class="centered-image">
<slot />
<Pin />
</div>
</template>
<script setup lang="ts">
</script>
<div class="centered-image">
<slot />
<Pin />
</div>
</template>

<script setup lang="ts">
</script>


<style scoped>
.centered-image {
display: flex;
Expand All @@ -17,5 +17,5 @@
width: 100vw;
height: 100vh;
}
</style>
</style>

0 comments on commit c7aee33

Please sign in to comment.