forbedrede SEO

This commit is contained in:
Frederik Palmø 2022-03-28 20:45:26 +02:00
parent dc6ca87883
commit 63751a1ac0
9 changed files with 363 additions and 102 deletions

34
sitemap.xml Normal file
View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>https://erdtree.palmoe.dk/</loc>
<lastmod>2022-03-28T13:52:48+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://erdtree.palmoe.dk/planner</loc>
<lastmod>2022-03-28T13:52:48+00:00</lastmod>
<priority>0.80</priority>
</url>
<url>
<loc>https://erdtree.palmoe.dk/class</loc>
<lastmod>2022-03-28T13:52:48+00:00</lastmod>
<priority>0.80</priority>
</url>
<url>
<loc>https://erdtree.palmoe.dk/armor</loc>
<lastmod>2022-03-28T13:52:48+00:00</lastmod>
<priority>0.80</priority>
</url>
<url>
<loc>https://erdtree.palmoe.dk/weapons</loc>
<lastmod>2022-03-28T13:52:48+00:00</lastmod>
<priority>0.64</priority>
</url>
</urlset>

View File

@ -2,15 +2,22 @@
<html>
<head>
<!-- metadata -->
<meta charset="utf-8">
<meta name="language" content="english">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style/main.css">
<!-- title and description -->
<title>Erdtree - Armor Optimizer</title>
<meta name="description" content="">
<meta name="description" content="Elden Ring build planner, armor optimizer, weapon finder and more!">
<meta property="og:title" content="Erdtree Build Planner">
<meta property="og:description"
content="Erdtree - Elden Ring build planner, armor optimizer, weapon finder and more!">
<meta property="og:url" content="https://erdtree.palmoe.dk">
<!-- scripts -->
<script src="/script/armor.js"></script>
</head>

View File

@ -2,15 +2,22 @@
<html>
<head>
<!-- metadata -->
<meta charset="utf-8">
<meta name="language" content="english">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style/main.css">
<!-- title and description -->
<title>Erdtree - Class Optimizer</title>
<meta name="description" content="">
<meta name="description" content="Elden Ring build planner, armor optimizer, weapon finder and more!">
<meta property="og:title" content="Erdtree Build Planner">
<meta property="og:description"
content="Erdtree - Elden Ring build planner, armor optimizer, weapon finder and more!">
<meta property="og:url" content="https://erdtree.palmoe.dk">
<!-- scripts -->
<script src="/script/class.js"></script>
</head>

View File

@ -1,5 +1,23 @@
{
"no-weapon": { "id": "no-weapons", "name": "None" },
"no-weapon": {
"id": "no-weapons",
"name": "None",
"requirements": [0, 0, 0, 0, 0],
"infusions": {
"standard": {
"damage": [0, 0, 0, 0, 0],
"scaling": [0.0, 0.0, 0.0, 0.0, 0.0],
"masks": [
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
"corrections": ["0", "0", "0", "0", "0"]
}
}
},
"academy-glintstone-staff": {
"id": "academy-glintstone-staff",
"name": "Academy Glintstone Staff",
@ -2954,6 +2972,25 @@
}
}
},
"bloody-helice": {
"id": "bloody-helice",
"name": "Bloody Helice",
"requirements": [16, 19, 0, 0, 17],
"infusions": {
"standard": {
"damage": [121, 0, 0, 0, 0],
"scaling": [0.1, 0.35, 0.0, 0.0, 0.5],
"masks": [
[1, 1, 0, 0, 1],
[0, 0, 1, 0, 0],
[0, 0, 0, 1, 0],
[0, 1, 0, 0, 0],
[0, 0, 0, 1, 0]
],
"corrections": ["7", "0", "0", "0", "0"]
}
}
},
"blue-crest-heater-shield": {
"id": "blue-crest-heater-shield",
"name": "Blue Crest Heater Shield",
@ -5236,6 +5273,18 @@
],
"corrections": ["0", "0", "4", "0", "0"]
},
"flame-art": {
"damage": [114, 0, 114, 0, 0],
"upgrade": [0.09, 0.06, 0.0, 0.34, 0.0],
"masks": [
[1, 1, 0, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 0, 1, 0],
[0, 1, 0, 0, 0],
[0, 0, 0, 1, 0]
],
"corrections": ["0", "0", "4", "0", "0"]
},
"lightning": {
"damage": [114, 0, 0, 114, 0],
"upgrade": [0.07, 0.3, 0.0, 0.0, 0.0],
@ -5322,25 +5371,6 @@
}
}
},
"celebrants-cleaver-blades": {
"id": "celebrants-cleaver-blades",
"name": "Celebrant's Cleaver Blades",
"requirements": [12, 8, 0, 0, 0],
"infusions": {
"flame-art": {
"damage": [114, 0, 114, 0, 0],
"scaling": [0.09, 0.06, 0.0, 0.34, 0.0],
"masks": [
[1, 1, 0, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 0, 1, 0],
[0, 1, 0, 0, 0],
[0, 0, 0, 1, 0]
],
"corrections": ["0", "0", "4", "0", "0"]
}
}
},
"celebrants-rib-rake": {
"id": "celebrants-rib-rake",
"name": "Celebrant's Rib-Rake",
@ -17117,25 +17147,6 @@
}
}
},
"helice": {
"id": "helice",
"name": "Helice",
"requirements": [16, 19, 0, 0, 17],
"infusions": {
"blood": {
"damage": [121, 0, 0, 0, 0],
"scaling": [0.1, 0.35, 0.0, 0.0, 0.5],
"masks": [
[1, 1, 0, 0, 1],
[0, 0, 1, 0, 0],
[0, 0, 0, 1, 0],
[0, 1, 0, 0, 0],
[0, 0, 0, 1, 0]
],
"corrections": ["7", "0", "0", "0", "0"]
}
}
},
"helphens-steeple": {
"id": "helphens-steeple",
"name": "Helphen's Steeple",
@ -22829,12 +22840,12 @@
}
}
},
"mohgwyns-spear": {
"id": "mohgwyns-spear",
"name": "Mohgwyn's Spear",
"mohgwyns-sacred-spear": {
"id": "mohgwyns-sacred-spear",
"name": "Mohgwyn's Sacred Spear",
"requirements": [24, 14, 0, 0, 27],
"infusions": {
"sacred": {
"standard": {
"damage": [96, 0, 62, 0, 0],
"scaling": [0.4, 0.15, 0.0, 0.0, 0.4],
"masks": [
@ -26701,25 +26712,6 @@
}
}
},
"relic-sword": {
"id": "relic-sword",
"name": "Relic Sword",
"requirements": [14, 24, 0, 22, 0],
"infusions": {
"sacred": {
"damage": [118, 0, 0, 0, 76],
"scaling": [0.15, 0.56, 0.0, 0.36, 0.0],
"masks": [
[1, 1, 0, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 0, 1, 0],
[0, 1, 0, 0, 0],
[0, 0, 0, 1, 0]
],
"corrections": ["0", "0", "0", "0", "4"]
}
}
},
"rickety-shield": {
"id": "rickety-shield",
"name": "Rickety Shield",
@ -28234,6 +28226,25 @@
}
}
},
"sacred-relic-sword": {
"id": "sacred-relic-sword",
"name": "Sacred Relic Sword",
"requirements": [14, 24, 0, 22, 0],
"infusions": {
"standard": {
"damage": [118, 0, 0, 0, 76],
"scaling": [0.15, 0.56, 0.0, 0.36, 0.0],
"masks": [
[1, 1, 0, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 0, 1, 0],
[0, 1, 0, 0, 0],
[0, 0, 0, 1, 0]
],
"corrections": ["0", "0", "0", "0", "4"]
}
}
},
"sacrificial-axe": {
"id": "sacrificial-axe",
"name": "Sacrificial Axe",

View File

@ -2,14 +2,20 @@
<html>
<head>
<!-- metadata -->
<meta charset="utf-8">
<meta name="language" content="english">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style/main.css">
<title>Erdtree</title>
<meta name="description" content="">
<!-- title and description -->
<title>Erdtree - Elden Ring Build Planner</title>
<meta name="description" content="Elden Ring build planner, armor optimizer, weapon finder and more!">
<meta property="og:title" content="Erdtree - Elden Ring Build Planner">
<meta property="og:description"
content="Erdtree - Elden Ring build planner, armor optimizer, weapon finder and more!">
<meta property="og:url" content="https://erdtree.palmoe.dk">
</head>
<body>
@ -50,14 +56,6 @@
</a>
</article>
<article>
<a href="/attack.html">
<h3>Attack Rating Calculator (todo)</h3>
<br>
<p>Calculate attack rating for a weapon.</p>
</a>
</article>
<article>
<a href="/censor.html">
<h3>Censor Checker (todo)</h3>
@ -67,7 +65,7 @@
</article>
<article>
<a href="/finder.html">
<a href="/weapons.html">
<h3>Weapon Finder (todo)</h3>
<br>
<p>Get suggestions for usable weapons.</p>

View File

@ -2,15 +2,22 @@
<html>
<head>
<!-- metadata -->
<meta charset="utf-8">
<meta name="language" content="english">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style/main.css">
<!-- title and description -->
<title>Erdtree - Build Planner</title>
<meta name="description" content="">
<meta property="og:title" content="Erdtree Build Planner">
<meta property="og:description"
content="Erdtree - Elden Ring build planner, armor optimizer, weapon finder and more!">
<meta property="og:url" content="https://erdtree.palmoe.dk">
<!-- scripts -->
<script src="script/planner.js"></script>
</head>

View File

@ -1,34 +1,80 @@
const fs = require("fs");
const WEAPONS = fetch("/data/weapons.json")
.then(response => response.json())
.catch(error => console.log(error));
const INFUSIONS = fetch("/data/infusions.json")
.then(response => response.json())
.catch(error => console.log(error));
const CORRECTIONS = fetch("/data/damage.json")
.then(response => response.json())
.catch(error => console.log(error));
let weapons;
let infusions;
let corrections;
const sum = (a, b) => a + b;
let weapons = JSON.parse(fs.readFileSync("./output/weapons.json"));
let corrections = JSON.parse(fs.readFileSync("./output/damage.json"));
let infusions = JSON.parse(fs.readFileSync("./output/infusions.json"));
async function init() {
weapons = await WEAPONS;
infusions = await INFUSIONS;
corrections = await CORRECTIONS;
function damage(weaponId, infusionId, stats, upgradeLevel) {
let weapon = weapons.find(weapon => weapon.id = weapon);
let infusion = infusions.find(infusion => infusion.id = infusionId);
weapon = weapon.infusions[infusionId];
let bases = infusion.damage.map((amount, ty) => weapon.damage[ty] * (amount + infusion.upgrade[ty] * upgradeLevel));
let extras = bases.map((amount, ty) => {
let calc = corrections.find(c => c.id == weapon.corrections[ty]);
let correction = modifiers(calc, stats, weapon.masks[ty]);
console.log(correction);
let scalings = weapon.scaling.map(itemScaling => {
return (itemScaling * infusion.scaling[ty] + itemScaling * infusion.scaling[ty] * infusion.growth[ty] * upgradeLevel);
})
let extras = scalings.map((statScaling, j) => amount * statScaling * correction[j] / 100.0)
return extras.reduce(sum);
});
return Math.floor(bases.reduce(sum) + extras.reduce(sum));
update();
}
function modifiers(calc, stats, masks) {
async function update() {
let infusionId = [...document.getElementsByName("infusion")].find(radio => radio.checked).id;
let upgradeLevel = 25;
let stats = [...document.getElementsByName("stat")].map(el => parseInt(el.value));
let sorted = sortWeapons(infusionId, upgradeLevel, stats);
console.log(sorted);
console.log(sorted.find(item => item.id == "royal-greatsword"))
}
function sortWeapons(infusionId, upgradeLevel, stats) {
return Object.values(weapons).sort((a, b) => damage(b, infusionId, upgradeLevel, stats) - damage(a, infusionId, upgradeLevel, stats));
}
function damage(weapon, infusionId, upgradeLevel, stats) {
if (weapon.total != undefined && weapon.total != null) {
return weapon.total;
}
let weaponInfusion = weapon.infusions[infusionId];
let infusion = infusions[infusionId];
let bases = infusion.damage.map((amount, ty) => weaponInfusion.damage[ty] * (amount + infusion.upgrade[ty] * upgradeLevel));
let extras;
if (stats.some((stat, i) => stat <= weapon.requirements[i])) {
extras = bases.map(dmg => dmg * -0.4);
} else {
extras = bases.map((amount, ty) => {
let calc = corrections[weaponInfusion.corrections[ty]];
let correction = typeCorrections(calc, stats, weaponInfusion.masks[ty]);
let scalings = weaponInfusion.scaling.map(itemScaling => {
return (itemScaling * infusion.scaling[ty] + itemScaling * infusion.scaling[ty] * infusion.growth[ty] * upgradeLevel);
})
let extras = scalings.map((statScaling, statIndex) => {
return amount * statScaling * correction[statIndex] / 100.0;
})
return extras.reduce(sum);
});
}
let total = Math.floor(bases.reduce(sum) + extras.reduce(sum));
weapon.bases = bases;
weapon.extras = extras;
weapon.total = total;
return total;
}
function typeCorrections(calc, stats, masks) {
return stats.map((stat, ty) => {
let mask = masks[ty];
if (mask == 0) {

View File

@ -198,12 +198,16 @@ button {
color: black;
}
label {
user-select: none;
}
/* cards */
.cards {
display: flex;
flex-flow: row wrap;
justify-content: space-between;
gap: 10px;
justify-content: center;
gap: 15px;
}
.cards article {

View File

@ -0,0 +1,147 @@
<!DOCTYPE html>
<html>
<head>
<!-- metadata -->
<meta charset="utf-8">
<meta name="language" content="english">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style/main.css">
<!-- title and description -->
<title>Erdtree - Weapon Finder</title>
<meta name="description" content="Erdtree - Elden Ring build planner, armor optimizer, weapon finder and more!">
<meta property="og:title" content="Erdtree Build Planner">
<meta property="og:description"
content="Erdtree - Elden Ring build planner, armor optimizer, weapon finder and more!">
<meta property="og:url" content="https://erdtree.palmoe.dk">
<!-- scripts -->
<script src="/script/weapons.js"></script>
</head>
<body onload="init();">
<nav>
<h1><a href="/">Elden Ring Build Planner</a></h1>
<ul>
<li><a href="/planner.html">Build Planner</a></li>
</ul>
</nav>
<header>
<h1>Weapon Finder<h1>
</header>
<main>
<div class="app">
<!-- parameters -->
<article style="flex-basis: 15%">
<ul>
<li><b>Parameters</b></li>
<hr>
<li>
<label for="strength">Strength</label>
<input id="strength" type="number" class="stat" name="stat" value=10 min=0 max=99>
</li>
<li>
<label for="dexterity">Dexterity</label>
<input id="dexterity" type="number" class="stat" name="stat" value=10 min=0 max=99>
</li>
<li>
<label for="intelligence">Intelligence</label>
<input id="intelligence" type="number" class="stat" name="stat" value=10 min=0 max=99>
</li>
<li>
<label for="faith">Faith</label>
<input id="faith" type="number" class="stat" name="stat" value=10 min=0 max=99>
</li>
<li>
<label for="arcane">Arcane</label>
<input id="arcane" type="number" class="stat" name="stat" value=10 min=0 max=99>
</li>
<li>
<div>
<input id="2hand" type="checkbox">
<label for="2hand">2-handing</label>
</div>
</li>
<hr>
<li><b>Damage Types</b></li>
<li>
<div>
<input id="physical" type="checkbox" checked>
<label for="physical">Physical Damage</label>
</div>
</li>
<li>
<div>
<input id="magic" type="checkbox" checked>
<label for="magic">Magic Damage</label>
</div>
</li>
<li>
<div>
<input id="fire" type="checkbox" checked>
<label for="fire">Fire Damage</label>
</div>
</li>
<li>
<div>
<input id="lightning" type="checkbox" checked>
<label for="lightning">Lightning Damage</label>
</div>
</li>
<li>
<div>
<input id="Holy" type="checkbox" checked>
<label for="Holy">Holy Damage</label>
</div>
</li>
</ul>
</article>
<!-- results -->
<article style="flex-basis: 60%">
</article>
<!-- infusions -->
<article style="flex-basis: 15%">
<ul>
<li><b>Infusions</b></li>
<hr>
<li>
<div>
<input id="standard" type="radio" name="infusion" checked>
<label for="standard">Standard</label>
</div>
</li>
<li>
<div>
<input id="heavy" type="radio" name="infusion">
<label for="heavy">Heavy</label>
</div>
</li>
</ul>
</article>
</div>
</main>
<footer>
<h5>Erdtree Planner (<a href="https://git.palmoe.dk/vodofrede/erdtree">available under BSD-3-Clause license</a>)
</h5>
<h5>Copyright 2022 vodofrede</h5>
</footer>
</body>
</html>