mirror of
https://github.com/YouHaveTrouble/DiscipleOfLand.git
synced 2026-05-11 22:16:55 +00:00
fix up some things
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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();
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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',
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user