build items OGP test
This commit is contained in:
parent
a5bc9017d0
commit
14b6836ee7
3 changed files with 24 additions and 3 deletions
|
@ -9,9 +9,12 @@
|
||||||
|
|
||||||
<!--OGP suite-->
|
<!--OGP suite-->
|
||||||
<meta property="og:title" content="Wynnbuilder" />
|
<meta property="og:title" content="Wynnbuilder" />
|
||||||
<meta property="og:type" content="image" />
|
<meta property="og:type" content="website" />
|
||||||
|
<meta property="og:image:type" content="https://wynnbuilder.github.io/media/icons/new/builder.png" />
|
||||||
|
<meta property="og:image:width" content="420" />
|
||||||
|
<meta property="og:image:height" content="420" />
|
||||||
|
<meta property="og:description" id = "ogp-build-list" content = "">
|
||||||
<meta property="og:url" id = "ogp-url" content="" />
|
<meta property="og:url" id = "ogp-url" content="" />
|
||||||
<meta property="og:image" content="https://wynnbuilder.github.io/media/icons/new/builder.png" />
|
|
||||||
|
|
||||||
<!-- nunito font, copying wynndata -->
|
<!-- nunito font, copying wynndata -->
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||||
|
|
|
@ -861,6 +861,7 @@ function calculateBuildStats() {
|
||||||
|
|
||||||
location.hash = encodeBuild();
|
location.hash = encodeBuild();
|
||||||
clear_highlights();
|
clear_highlights();
|
||||||
|
updateOGP();
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyBuild() {
|
function copyBuild() {
|
||||||
|
|
19
js/utils.js
19
js/utils.js
|
@ -5,9 +5,26 @@ const zip = (a, b) => a.map((k, i) => [k, b[i]]);
|
||||||
|
|
||||||
//updates all the OGP tags for a webpage. Should be called when build changes
|
//updates all the OGP tags for a webpage. Should be called when build changes
|
||||||
function updateOGP() {
|
function updateOGP() {
|
||||||
|
//update the embed URL
|
||||||
let url_elem = document.getElementById("ogp-url");
|
let url_elem = document.getElementById("ogp-url");
|
||||||
if (url_elem) {
|
if (url_elem) {
|
||||||
url_elem.content = url_base + getUrl;
|
url_elem.content = url_base+location.hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
//update the embed text content
|
||||||
|
let build_elem = document.getElementById("ogp-build-list");
|
||||||
|
if (build_elem && player_build) {
|
||||||
|
"WynnBuilder build:\n"+
|
||||||
|
"> "+player_build.helmet.get("displayName")+"\n"+
|
||||||
|
"> "+player_build.chestplate.get("displayName")+"\n"+
|
||||||
|
"> "+player_build.leggings.get("displayName")+"\n"+
|
||||||
|
"> "+player_build.boots.get("displayName")+"\n"+
|
||||||
|
"> "+player_build.ring1.get("displayName")+"\n"+
|
||||||
|
"> "+player_build.ring2.get("displayName")+"\n"+
|
||||||
|
"> "+player_build.bracelet.get("displayName")+"\n"+
|
||||||
|
"> "+player_build.necklace.get("displayName")+"\n"+
|
||||||
|
"> "+player_build.weapon.get("displayName")+" ["+player_build.weapon.get("powders").map(x => powderNames.get(x)).join("")+"]";
|
||||||
|
build_elem.content = text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue