fix up some things

This commit is contained in:
2024-07-14 23:45:26 +02:00
parent 0649004e51
commit 0ef5d72275
6 changed files with 22 additions and 14 deletions
+1 -1
View File
@@ -13,4 +13,4 @@ jobs:
with: with:
username: 'YouHaveTrouble' username: 'YouHaveTrouble'
reponame: 'DiscipleOfLand' reponame: 'DiscipleOfLand'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
+1
View File
@@ -56,6 +56,7 @@ export default defineComponent({
} }
}, },
async mounted() { async mounted() {
this.eorzeaTime = new EorzeaTime();
setInterval(() => { setInterval(() => {
this.eorzeaTime = new EorzeaTime(); this.eorzeaTime = new EorzeaTime();
}, 500); }, 500);
+12 -1
View File
@@ -1,5 +1,5 @@
<template> <template>
<article class="node"> <article class="node" :class="{active: gatheringNode.isActive(eorzeaTime)}">
<div class="timer"> <div class="timer">
{{ {{
gatheringNode.isActive(eorzeaTime) ? 'Active' : prettyTimer(gatheringNode.getSecondsToNextActiveTime(eorzeaTime)) gatheringNode.isActive(eorzeaTime) ? 'Active' : prettyTimer(gatheringNode.getSecondsToNextActiveTime(eorzeaTime))
@@ -73,6 +73,13 @@ export default defineComponent({
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@keyframes pulsing {
0% {background-color: rgba(255,255,255, 0.05);}
50% {background-color: rgba(255,255,255, 0.075);}
100% {background-color: rgba(255,255,255, 0.05);}
}
.node { .node {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@@ -84,6 +91,10 @@ export default defineComponent({
padding: 0.5rem; padding: 0.5rem;
border-radius: 0.25rem; border-radius: 0.25rem;
&.active {
animation: infinite pulsing 6s;
}
.timer { .timer {
min-width: 7rem; min-width: 7rem;
font-size: 2rem; font-size: 2rem;
+7 -1
View File
@@ -42,6 +42,11 @@ export default defineComponent(
this.displayNodes = this.nodes; this.displayNodes = this.nodes;
} }
}, },
displayNodes: {
handler() {
this.sortListByTime();
}
},
eorzeaTime: { eorzeaTime: {
immediate: true, immediate: true,
handler(newValue, oldValue) { handler(newValue, oldValue) {
@@ -64,8 +69,9 @@ export default defineComponent(
}); });
}, },
}, },
mounted() { async mounted() {
this.displayNodes = this.nodes; this.displayNodes = this.nodes;
this.sortListByTime();
}, },
} }
); );
-11
View File
@@ -3,23 +3,12 @@ export default class Item {
readonly id: string; readonly id: string;
readonly name: string; readonly name: string;
readonly level: number; readonly level: number;
readonly scripType: ScripType | null;
constructor(id: string, data: {[key: string]: number | string | undefined}) { constructor(id: string, data: {[key: string]: number | string | undefined}) {
this.id = id; this.id = id;
this.name = data?.name as string; this.name = data?.name as string;
this.level = data?.level as number; this.level = data?.level as number;
const scripType: string | undefined = data?.scripType as string;
if (scripType != undefined) {
this.scripType = typeof data?.scripType === "string" ? scripType.toUpperCase() as ScripType : null;
} else {
this.scripType = null;
}
} }
} }
enum ScripType {
WHITE = 'white',
PURPLE = 'purple',
}
+1
View File
@@ -28,6 +28,7 @@ export default class Node {
this.times = times; this.times = times;
this.items = items; this.items = items;
this.nearestAetheryte = nearestAetheryte; this.nearestAetheryte = nearestAetheryte;
items.sort((a, b) => b.level - a.level);
} }
isActive(eorzeaTime: EorzeaTime): boolean { isActive(eorzeaTime: EorzeaTime): boolean {