Compare commits

..

No commits in common. "a035ea3201193b579b67871281d922ffc475108d" and "a2e7559f5d34aec44da208b541c4e2b6352559e3" have entirely different histories.

6 changed files with 15 additions and 84 deletions

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "heonian-ime"]
path = heonian-ime
url = https://git.succubi.services/heonian.org/heonian-ime

@ -1 +0,0 @@
Subproject commit 76bc6baf11f2b21f365e6f2ef36c05b00ea04c84

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html>
<head>
<meta charset="utf-8">
<title>heonian web dictionary</title>
@ -37,7 +37,6 @@
</main>
<script src="./heonian-ime/ime.js"></script>
<script src="./main.js"></script>
</body>
</html>

View File

@ -32,33 +32,19 @@
:root {
--font: "Helvetica Neue", Helvetica, Arial, sans-serif;
--font-h: "heonian", "Helvatica Neue", Helvetica, Arial, sans-serif;
--fg: rgb(0,0,0);
--bg: rgb(255,255,255);
--grey: rgb(152, 152, 152);
--darkgrey: rgb(100, 100, 100);
--link: rgb(27 120 151);
}
@media (prefers-color-scheme: dark) {
:root {
--fg: rgb(255,255,255);
--bg: rgb(0,0,0);
--nice-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
--grey: rgb(226, 226, 226);
--darkgrey: rgb(215, 215, 215);
--link: rgb(27 120 151);
}
--darkgrey: rgb(150, 150, 150);
}
body {
margin: 0;
padding: 0;
font-family: var(--font);
color: var(--fg);
background-color: var(--bg);
}
a {
color: var(--link);
color: rgb(119, 205, 233);
text-decoration: none;
}
@ -101,9 +87,6 @@ header #search button {
text-align: center;
height: 2rem;
border-left: 1px solid var(--grey);
color: var(--grey);
transition: 0.3s color ease;
cursor: pointer;
}
header input {
@ -117,8 +100,6 @@ header input {
font-weight: 100;
transition: border-color 0.3s;
width: calc(100% - 52px - 24px);
background-color: var(--bg);
color: var(--fg);
}
header input:focus {
@ -164,9 +145,7 @@ main {
opacity: 0;
max-width: 600px;
margin: auto;
margin-top: calc(1rem + 24px);
padding-left: 1rem;
padding-right: 1rem;
margin-top: 1rem;
}
.main-animation {
@ -187,10 +166,6 @@ main {
border-bottom: 1px solid var(--darkgrey);
}
.result:first-child {
padding-top: 0;
}
.result-meaning {
padding-bottom: 8px;
}
@ -217,22 +192,13 @@ 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 */

40
main.js
View File

@ -5,19 +5,6 @@ let searchDictionary = {};
let header = null;
let main = null;
let ime = null;
function toggleIME() {
if (ime == null) {
ime = new HeonianIME(header.querySelector("input"));
header.querySelector("#search button").style.color = "var(--fg)";
} else {
ime.imeDetach();
ime = null;
header.querySelector("#search button").style.color = "var(--grey)";
}
}
function animateHeader(inout = false) {
//todo: debounce this
if (inout) {
@ -60,14 +47,10 @@ document.addEventListener("keydown", (e) => {
if (!header.querySelector("input").matches(":focus") && !header.classList.contains("fullscreen")) {
e.preventDefault();
animateHeader(true);
} else if (header.querySelector("input").matches(":focus") && ime != null) {
toggleIME();
} else if (header.querySelector("input").matches(":focus")) {
header.querySelector("input").value = "";
}
}
if (e.keyCode === 13) {
if (header.querySelector("input").matches(":focus") && ime == null) {
if (header.querySelector("input").matches(":focus")) {
//search
e.preventDefault();
if (header.classList.contains("fullscreen")) {
@ -79,7 +62,7 @@ document.addEventListener("keydown", (e) => {
});
function stripWord(word) {
return word.replace(/[^a-zA-Z-]/gu, "").toLowerCase();
return word.replace(/[^a-zA-Z-]/gu, "");
}
heonianVowels = {
@ -248,26 +231,14 @@ function doSearch() {
meaning.innerHTML += "<br><details><summary>Translation</summary><p>"+json[results[i]][o]["translation"]+"</p></details>";
}
//example
if (json[results[i]][o]["examples"] != undefined) {
let temp = ""
temp += "<details><summary>Examples</summary><p>";
for (let e in json[results[i]][o]["examples"]) {
temp += "<span class='heonian'>"+e+"</span> - "+json[results[i]][o]["examples"][e];
}
temp += "</p></details>";
meaning.innerHTML += temp;
if (json[results[i]][o]["example"] != undefined) {
//todo
}
//notes
if (json[results[i]][o]["notes"] != undefined) {
meaning.innerHTML += "<p class='result-notes'>"+json[results[i]][o]["notes"]+"</p>";
meaning.innerHTML += "<br><p class='result-notes'>"+json[results[i]][o]["notes"]+"</p>";
}
//(source, etc)
if (json[results[i]][o]["canon-etymology"] != undefined) {
meaning.innerHTML += "<details><summary>Canon Etymology</summary><p>"+json[results[i]][o]["canon-etymology"]+"</p></details>";
}
if (json[results[i]][o]["meta-etymology"] != undefined) {
meaning.innerHTML += "<details><summary>Meta Etymology</summary><p>"+json[results[i]][o]["meta-etymology"]+"</p></details>";
}
//todo
result.appendChild(meaning); //y, yeah.
}
@ -279,6 +250,5 @@ function doSearch() {
window.onload = () => {
header = document.querySelector("header");
main = document.querySelector("main");
header.querySelector("#search button").onclick = () => {toggleIME();};
loadDictionary();
}

View File

@ -227,7 +227,7 @@
{
"type": "modifier",
"meaning": "Existing in plentiful supply.",
"translation": "Abundant"
"translation": "Abundant",
},
{
"type": "pronoun",
@ -262,12 +262,12 @@
{
"type": "verb",
"meaning": "To deprive of life.",
"translation": "To kill"
"translation": "To kill",
},
{
"type": "verb",
"meaning": "To destroy a vitally essential quality in.",
"translation": "To kill"
"translation": "To kill",
}
],
"" : [
@ -295,7 +295,7 @@
{
"type": "modifier",
"meaning": "Being such that every part of the surface or the circumference is equidistant from the center.",
"translation": "Round"
"translation": "Round",
}
],
"" : [