5 Commits

4 changed files with 52 additions and 18 deletions
+11
View File
@@ -5,8 +5,19 @@
<link rel="icon" href="/favicon.ico"> <link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Disciple of Land</title> <title>Disciple of Land</title>
<meta property="og-title" content="Disciple of Land">
<meta property="twitter:title" content="Disciple of Land">
<meta property="og-type" content="website">
<meta name="description" content="Track timed gathering nodes in Final Fantasy XIV.">
<meta property="og-description" content="Track timed gathering nodes in Final Fantasy XIV.">
<meta property="twitter:description" content="Track timed gathering nodes in Final Fantasy XIV.">
<meta property="og-url" content="https://dol.yht.one">
<meta property="twitter:url" content="https://dol.yht.one">
</head> </head>
<body> <body>
<noscript>
<strong>We're sorry but Disciple of Land doesn't work without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div> <div id="app"></div>
<script type="module" src="/src/main.js"></script> <script type="module" src="/src/main.js"></script>
</body> </body>
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "discipleofland", "name": "discipleofland",
"version": "0.0.2", "version": "0.0.5",
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
+4 -4
View File
@@ -67,18 +67,18 @@ export default defineComponent({
methods: { methods: {
findNearestAetheryte(zone: string, x: number, y: number): Aetheryte | null { findNearestAetheryte(zone: string, x: number, y: number): Aetheryte | null {
let result = null; let result = null;
let distance = Number.MAX_SAFE_INTEGER;
for (const aetheryte of this.aetherytes) { for (const aetheryte of this.aetherytes) {
let distance = Number.MAX_VALUE; if (aetheryte.position.zone !== zone) continue;
if (aetheryte.position.zone === zone) {
const a = aetheryte.position.x - x; const a = aetheryte.position.x - x;
const b = aetheryte.position.y - y; const b = aetheryte.position.y - y;
const distanceToAetheryte = Math.sqrt((a * a) + (b * b)); const distanceToAetheryte = Math.hypot(a, b);
if (distanceToAetheryte < distance) { if (distanceToAetheryte < distance) {
`Aetheryte ${aetheryte.name.en} (${distance}) is new nearest aetheryte`;
distance = distanceToAetheryte; distance = distanceToAetheryte;
result = aetheryte; result = aetheryte;
} }
} }
}
return result; return result;
} }
}, },
+25 -2
View File
@@ -129,14 +129,37 @@ section {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1rem; gap: 1rem;
padding: 1rem; padding-block: 1rem;
details { details {
background-color: #1f1f1f; background-color: #1f1f1f;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 0.5rem; border-radius: 0.25rem;
padding: 1rem;
gap: 0.5rem; gap: 0.5rem;
position: relative;
&:before {
position: absolute;
right: 1rem;
top: 1rem;
width: 1.5rem;
height: 1.5rem;
display: flex;
justify-content: center;
align-content: center;
content: "▶";
pointer-events: none;
rotate: 90deg;
transition: rotate 0.25s;
}
&[open] {
&:before {
rotate: 270deg;
}
}
summary { summary {
cursor: pointer; cursor: pointer;