-
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.
refactor(pages): splitting component and page. some were doing both l…
…ogic
- Loading branch information
Showing
23 changed files
with
417 additions
and
326 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
b2b66add8c5579eb021ae243c0424edd | ||
4a7c841e55cbdbc32f4fa1d10eb002ec |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<script setup lang="ts"> | ||
import Dialog from 'primevue/dialog'; | ||
import InlineMessage from 'primevue/inlinemessage'; | ||
import FloatLabel from 'primevue/floatlabel'; | ||
import { reactive } from 'vue'; | ||
const props = defineProps<{ | ||
visible: boolean; | ||
prompt?: string; | ||
answer?: number; | ||
}>() | ||
const dialogState = reactive<{ | ||
user?: string, | ||
err ?: string, | ||
}>({}) | ||
const emit = defineEmits<{ | ||
userCreated: [username: string] | ||
}>() | ||
function gameOver(){ | ||
if (dialogState.user && dialogState.user?.length > 0 && dialogState.user?.length <=3) { | ||
emit("userCreated", dialogState.user) | ||
}else if (dialogState.user && dialogState.user?.length > 3){ | ||
dialogState.err = "username should contains max 3 characters" | ||
}else { | ||
dialogState.err = "username is required" | ||
} | ||
} | ||
</script> | ||
<template> | ||
<Dialog v-model:visible="props.visible" :content-style="{padding: '0 1em', height: '100%'}" modal header="Game Over" :closable="false" v-on:hide="gameOver"> | ||
<div class="flex flex-column w-full"> | ||
<span class="p-text-secondary block ">The answer to {{ props.prompt }} was : {{ props.answer }}</span> | ||
<div class="flex flex-column m-2 flex-wrap"> | ||
<span class="m-2">Register your score !</span> | ||
<FloatLabel class="m-2"> | ||
<InputText id="username" v-model="dialogState.user" mask="aaa" placeholder="aaa" aria-describedby="username-help"/> | ||
<label for="username">Username</label> | ||
</FloatLabel> | ||
<small id="username-help">Can't contain more than 3 characters.</small> | ||
<InlineMessage class="m-1" v-if="dialogState.err" severity="error">{{ dialogState.err }}</InlineMessage> | ||
</div> | ||
</div> | ||
<template #footer> | ||
<div class="flex flex-row justify-content-center w-full" > | ||
<Button label="Submit" class="m-2" severity="success" @click="gameOver"/> | ||
</div> | ||
</template> | ||
</Dialog> | ||
</template> |
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
<script setup lang="ts"> | ||
const props = defineProps<{ | ||
maxHealth: number; | ||
current: number; | ||
}>() | ||
</script> | ||
<template> | ||
<div> | ||
<i class="pi pi-heart-fill text-red-700 text-2xl" :key="n" v-for="n in props.current"></i> | ||
<i class="pi pi-heart text-red-700 text-2xl" :key="n" v-for="n in (props.maxHealth -props.current)"></i> | ||
</div> | ||
</template> |
Oops, something went wrong.