-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d88216b
commit db83c91
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<template> | ||
<section> | ||
<img | ||
v-if="!showPokemon" | ||
:src="pokemonImage" | ||
class="brightness-0 h-[200px]" | ||
/> | ||
<img | ||
v-else | ||
:src="pokemonImage" | ||
class="fade-in h-[200px]" | ||
alt="pokemon image" | ||
/> | ||
</section> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { computed } from 'vue'; | ||
interface Props { | ||
pokemonId: number; | ||
showPokemon?: boolean; | ||
} | ||
const props = withDefaults(defineProps<Props>(), { | ||
showPokemon: false, | ||
}); | ||
const pokemonImage = computed( | ||
() => | ||
`https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/dream-world/${props.pokemonId}.svg`, | ||
); | ||
</script> | ||
|
||
<style scoped> | ||
img { | ||
user-select: none; | ||
-moz-user-select: none; | ||
-ms-user-select: none; | ||
-webkit-user-drag: none; | ||
-webkit-user-select: none; | ||
} | ||
</style> |