-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* implemented chartjs w example * IV chart * Static card height, better scrolling for encounter/stats card * Revert "Merge pull request #18 from Dan-Mizu/update" This reverts commit 8a7ea41, reversing changes made to e4564a9. * Make Extra Pokemon Data into a Modal * Fix IV Sum bar color * Cleanup * Revert "Revert "Merge pull request #18 from Dan-Mizu/update"" This reverts commit d5822a1.
- Loading branch information
Showing
15 changed files
with
979 additions
and
815 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
Large diffs are not rendered by default.
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
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,70 @@ | ||
<script setup lang="ts"> | ||
import { computed } from "@vue/reactivity"; | ||
const props = defineProps<{ | ||
IVSum: number; | ||
}>(); | ||
// max IV sum | ||
const IVSumMax = 186; | ||
// calculate progress of IV sum | ||
const progress = Math.ceil((props.IVSum / IVSumMax) * 100); | ||
// get color of bar | ||
const progressDetails = computed(() => { | ||
switch (true) { | ||
// Perfect | ||
case progress == 100: | ||
return { | ||
color: "blue", | ||
text: "Perfect IVs!", | ||
}; | ||
// Bad | ||
case progress < 50: | ||
return { | ||
color: "red", | ||
}; | ||
// Average | ||
case progress < 70: | ||
return { | ||
color: "yellow", | ||
}; | ||
// Great | ||
case progress < 100: | ||
return { | ||
color: "green", | ||
}; | ||
default: | ||
return { | ||
color: "red", | ||
}; | ||
} | ||
}); | ||
</script> | ||
|
||
<template> | ||
<!-- Bar --> | ||
<UProgress | ||
:ui="{ | ||
strategy: 'override', | ||
progress: { | ||
track: 'bg-light-tertiary dark:bg-dark-tertiary', | ||
}, | ||
}" | ||
:value="IVSum" | ||
:max="IVSumMax" | ||
:color="progressDetails.color" | ||
> | ||
<!-- Indicator --> | ||
<template #indicator> | ||
<div class="text-xs font-bold"> | ||
<span class="text-light-text dark:text-dark-text">{{ | ||
progressDetails?.text | ||
? progressDetails.text | ||
: "IV Sum: " + IVSum | ||
}}</span> | ||
</div> | ||
</template> | ||
</UProgress> | ||
</template> |
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
Oops, something went wrong.