-
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.
add game card component and update example env
- Loading branch information
1 parent
7c8b68a
commit 5decbe2
Showing
6 changed files
with
50 additions
and
6 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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
NUXT_APP_BASE_URL='/OPTIONAL_BASE_URL' | ||
|
||
EXTERNAL_API_KEY=YOUR_API_KEY | ||
API_BASE_URL=YOUR_BASE_URL |
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,34 @@ | ||
<template> | ||
<div class="h-128 w-64 border flex flex-col text-center"> | ||
<div class="mb-5 bg-transparent hover:bg-gray-200 inline-block"> | ||
<img | ||
:src="imgPath" | ||
alt="Game Artwork" | ||
class="transform hover:translate-x-6 hover:-translate-y-6 delay-50 duration-100 inline-block" | ||
/> | ||
</div> | ||
<div class="text-lg"> | ||
{{ game?.name }} | ||
</div> | ||
<p class="text-m text-gray-500 break-words text-wrap truncate overflow-hidden px-2"> | ||
{{ game?.summary }} | ||
</p> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import type { PropType } from 'vue'; | ||
import type { Game } from '../types/Game'; | ||
import { computed } from 'vue'; | ||
const props = defineProps({ | ||
game: { | ||
type: Object as PropType<Game> | ||
} | ||
}); | ||
const config = useRuntimeConfig(); | ||
const imgPath = computed(() => props.game?.image.original_url != null ? `${config.public.imgBaseUrl}${props.game.image.original_url}` : 'https://via.placeholder.com/300x500'); | ||
</script> |
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
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
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
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