diff --git a/index.html b/index.html index fb2ca7b..8a8d343 100644 --- a/index.html +++ b/index.html @@ -138,7 +138,7 @@ Sexual orientation - + Asexual Regular @@ -158,7 +158,7 @@ Romantic orientation - + Aromantic Regular diff --git a/scripts/index.js b/scripts/index.js index ec91d85..abb8873 100644 --- a/scripts/index.js +++ b/scripts/index.js @@ -86,9 +86,11 @@ const descs = { components: { amount: [ (val) => `I do not experience any sexual attraction.`, + (val) => `I feel very little sexual attraction, ${val}.`, (val) => `I feel some sexual attraction, ${val}.`, (val) => `I feel an average amount of sexual attraction, ${val}.`, (val) => `I feel more sexual attraction than usual, ${val}.`, + (val) => `I feel a lot of sexual attraction, ${val}.`, (val) => `I feel extreme sexual attraction, ${val}.`, ], value: [ @@ -105,9 +107,11 @@ const descs = { components: { amount: [ (val) => `I do not experience any romantic attraction.`, + (val) => `I feel very little romantic attraction, ${val}.`, (val) => `I feel some romantic attraction, ${val}.`, (val) => `I feel an average amount of romantic attraction, ${val}.`, (val) => `I feel more romantic attraction than usual, ${val}.`, + (val) => `I feel a lot of romantic attraction, ${val}.`, (val) => `I feel extreme romantic attraction, ${val}.`, ], value: [ @@ -221,6 +225,56 @@ function encode() { } function extract_ecfBIN(parsed_string) { + enc_s_gia.value = parseInt(parsed_string.substring(0, 3), 2); + enc_s_gi.value = parseInt(parsed_string.substring(3, 7), 2); + enc_s_geo.checked = parseInt(parsed_string.substring(7, 8), 2); + enc_s_ge.value = parseInt(parsed_string.substring(8, 12), 2); + enc_s_so.value = parseInt(parsed_string.substring(15, 18), 2); + enc_s_ro.value = parseInt(parsed_string.substring(21, 24), 2); + enc_s_raa.value = parseInt(parsed_string.substring(24, 27), 2); + enc_s_ra.value = parseInt(parsed_string.substring(27, 30), 2); + + const sex_att = parseInt(parsed_string.substring(12, 15), 2); + const rom_att = parseInt(parsed_string.substring(18, 21), 2); + + switch (sex_att) { + case 0: + enc_s_soa.value = 0; + break; + case 1: + enc_s_soa.value = 2; + break; + case 2: + enc_s_soa.value = 3; + break; + case 3: + enc_s_soa.value = 4; + break; + case 4: + enc_s_soa.value = 6; + break; + } + + switch (rom_att) { + case 0: + enc_s_roa.value = 0; + break; + case 1: + enc_s_roa.value = 2; + break; + case 2: + enc_s_roa.value = 3; + break; + case 3: + enc_s_roa.value = 4; + break; + case 4: + enc_s_roa.value = 6; + break; + } +} + +function extract_ecfBINv2(parsed_string) { enc_s_gia.value = parseInt(parsed_string.substring(0, 3), 2); enc_s_gi.value = parseInt(parsed_string.substring(3, 7), 2); enc_s_geo.checked = parseInt(parsed_string.substring(7, 8), 2); @@ -245,13 +299,19 @@ function decodev2(string) { extract_ecfBIN(parsed_string); } +function decodev3(string) { + var parsed_string = parseInt(string, 36).toString(2).padStart(30, "0"); + + extract_ecfBINv2(parsed_string); +} + const s_share_link = document.getElementById("spec-share-link"); function createShareableURL() { const url = new URL(window.location.href); const code = encode(); - url.hash = "2-" + code; + url.hash = "3-" + code; s_share_link.innerHTML = url.toString(); s_share_link.href = url.toString(); @@ -265,6 +325,10 @@ function parseURL() { decodev2(hash.substring(2)); return lockSliders(); } + if (hash.startsWith("3-")) { + decodev3(hash.substring(2)); + return lockSliders(); + } } else if (urlParams.get("s") != null) { decodev1(urlParams.get("s")); return lockSliders();