diff --git a/index.html b/index.html index 959dffc..139f5ff 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - + heonian web dictionary diff --git a/main.css b/main.css index 2779bb1..9ab2844 100644 --- a/main.css +++ b/main.css @@ -44,7 +44,7 @@ body { } a { - color: rgb(119, 205, 233); + color: rgb(27 120 151); text-decoration: none; } @@ -146,6 +146,8 @@ main { max-width: 600px; margin: auto; margin-top: 1rem; + padding-left: 1rem; + padding-right: 1rem; } .main-animation { @@ -192,13 +194,22 @@ main { content: ". "; } +.result-notes { + font-size: 0.85rem; + color: var(--darkgrey); + margin-top: 6px; + margin-bottom: 6px; +} + .result summary { + margin-top: 4px; color: grey; } .result details p { margin-top: 4px; margin-bottom: 4px; + font-size: 1.25rem; } /* todo. organize this file better. this is a fucking mess */ \ No newline at end of file diff --git a/main.js b/main.js index 352fc62..400e0ca 100644 --- a/main.js +++ b/main.js @@ -62,7 +62,7 @@ document.addEventListener("keydown", (e) => { }); function stripWord(word) { - return word.replace(/[^a-zA-Z-]/gu, ""); + return word.replace(/[^a-zA-Z-]/gu, "").toLowerCase(); } heonianVowels = { @@ -231,14 +231,26 @@ function doSearch() { meaning.innerHTML += "
Translation

"+json[results[i]][o]["translation"]+"

"; } //example - if (json[results[i]][o]["example"] != undefined) { - //todo + if (json[results[i]][o]["examples"] != undefined) { + let temp = "" + temp += "
Examples

"; + for (let e in json[results[i]][o]["examples"]) { + temp += ""+e+" - "+json[results[i]][o]["examples"][e]; + } + temp += "

"; + meaning.innerHTML += temp; } //notes if (json[results[i]][o]["notes"] != undefined) { - meaning.innerHTML += "

"+json[results[i]][o]["notes"]+"

"; + meaning.innerHTML += "

"+json[results[i]][o]["notes"]+"

"; } //(source, etc) + if (json[results[i]][o]["canon-etymology"] != undefined) { + meaning.innerHTML += "
Canon Etymology

"+json[results[i]][o]["canon-etymology"]+"

"; + } + if (json[results[i]][o]["meta-etymology"] != undefined) { + meaning.innerHTML += "
Meta Etymology

"+json[results[i]][o]["meta-etymology"]+"

"; + } //todo result.appendChild(meaning); //y, yeah. } diff --git a/wordlist.json b/wordlist.json index 0ec7c54..9950167 100644 --- a/wordlist.json +++ b/wordlist.json @@ -130,7 +130,7 @@ "type": "noun", "meaning": "snow", "translation": "snow", - "notes": "", + "notes": "this is where notes go", "meta-etymology": "I want one my names to mean something pretty - Ari.", "examples": { "     ": "i hope ari can see snow"