in da beginning
This commit is contained in:
79
resources/css/main.css
Normal file
79
resources/css/main.css
Normal file
@@ -0,0 +1,79 @@
|
||||
* {
|
||||
font-family: "Noto Sans";
|
||||
}
|
||||
|
||||
.navbar {
|
||||
background-color: black;
|
||||
position: relative;
|
||||
display: block;
|
||||
text-align: center;
|
||||
margin:auto;
|
||||
height: 50px;
|
||||
width: 90%;
|
||||
border-style: solid;
|
||||
border-color: black;
|
||||
}
|
||||
|
||||
.navcontent {
|
||||
color: orange;
|
||||
align-self: center;
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.page {
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
.content {
|
||||
color: white;
|
||||
position: relative;
|
||||
left: 5%;
|
||||
top: 10px;
|
||||
right: 5%;
|
||||
}
|
||||
/*.main {
|
||||
|
||||
}*/
|
||||
.navcontent ul {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.navcontent ul li {
|
||||
float: left;
|
||||
}
|
||||
.navcontent ul li a {
|
||||
display: block;
|
||||
color: orange;
|
||||
text-align: center;
|
||||
padding: 10px 20px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.navcontent ul li a:before {
|
||||
display: block;
|
||||
content: '';
|
||||
width: 100%;
|
||||
height: 8px;
|
||||
translate: 0 15px;
|
||||
filter: blur(16px);
|
||||
background: orangered;
|
||||
}
|
||||
.navcontent ul li a:hover {
|
||||
color: rgb(255, 225, 168);
|
||||
background-color: orange;
|
||||
}
|
||||
a:link {
|
||||
color: aqua;
|
||||
}
|
||||
a:visited {
|
||||
color: rgb(255, 32, 32);
|
||||
}
|
||||
.lang {
|
||||
display: block;
|
||||
position: absolute;
|
||||
right:0px;
|
||||
appearance: base-select;
|
||||
}
|
||||
12
resources/lang/getlang.js
Normal file
12
resources/lang/getlang.js
Normal file
@@ -0,0 +1,12 @@
|
||||
// get the language
|
||||
|
||||
function getlang() {
|
||||
// i can type
|
||||
lang = localStorage.getItem("lang");
|
||||
|
||||
document.getElementById("language").value = lang;
|
||||
console.log("the language is set to " + lang)
|
||||
}
|
||||
|
||||
document.getElementById("language").addEventListener('change', function(e){localStorage.setItem("lang", e.eventTarget.value);})
|
||||
getlang()
|
||||
47
resources/lang/lang.js
Normal file
47
resources/lang/lang.js
Normal file
@@ -0,0 +1,47 @@
|
||||
// languaging ???
|
||||
|
||||
async function localize(params) {
|
||||
let lang = document.getElementById("language");
|
||||
|
||||
if (lang == null) {
|
||||
console.log("lang doesn't exist waaahhh");
|
||||
let temp1 = document.getElementById('naviframe');
|
||||
let temp2 = temp1.contentDocument || temp1.contentWindow.document;
|
||||
console.log(temp2)
|
||||
lang = temp2.getElementById('language')
|
||||
console.log(lang)
|
||||
}
|
||||
lang = lang.value;
|
||||
//localStorage.setItem("lang", lang);
|
||||
thing = document.querySelectorAll("*");
|
||||
file = await fetch("/resources/lang/lang.json");
|
||||
console.log("EXISTANCE !!!")
|
||||
if (file.ok) {
|
||||
contents = await file.json();
|
||||
// contents.<lang>.<key>
|
||||
thing.forEach(element => {
|
||||
key = element.getAttribute("key");
|
||||
if (key != null) {
|
||||
console.log(contents[lang][key]);
|
||||
element.innerHTML = contents[lang][key];
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log("oopsie !!!")
|
||||
}
|
||||
}
|
||||
|
||||
if (lang_element != null) {
|
||||
localize()
|
||||
lang_element.addEventListener('change', localize)
|
||||
}
|
||||
|
||||
function onFrameLoad(frame) {
|
||||
let frame_doc = frame.contentDocument || frame.contentWindow.document;
|
||||
let frame_lang_element = frame_doc.getElementById('language');
|
||||
|
||||
frame_lang_element .addEventListener('change', localize);
|
||||
localize()
|
||||
}
|
||||
|
||||
|
||||
64
resources/lang/lang.json
Normal file
64
resources/lang/lang.json
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"eng":{
|
||||
"lang-info":{
|
||||
"numbers":{
|
||||
"numberbase":10,
|
||||
"digits": {
|
||||
"0": "0",
|
||||
"1": "1",
|
||||
"2": "2",
|
||||
"3": "3",
|
||||
"4": "4",
|
||||
"5": "5",
|
||||
"6": "6",
|
||||
"7": "7",
|
||||
"8": "8",
|
||||
"9": "9"
|
||||
},
|
||||
"frac": ".",
|
||||
"neg-pref": "-",
|
||||
"neg-sufx": ""
|
||||
}
|
||||
},
|
||||
|
||||
"index":"Home",
|
||||
"conlangs":"Conlanging",
|
||||
"coding":"Coding",
|
||||
"poetry-stories":"Poetry & Stories",
|
||||
"about":"About Tavyza",
|
||||
"dx1":"Hello. This website is under construction. Feel free to give suggestions in <a href=\"//git.tavyza.org/Theros/tavyza-website\">the git repository</a>. Please expect issues with formatting, translation errors, the like.",
|
||||
"dx2":"This website was proudly built without AI assistance.",
|
||||
"tp1":"This is a template page."
|
||||
|
||||
},
|
||||
"isl":{
|
||||
"lang-info":{
|
||||
"numbers":{
|
||||
"numberbase":10,
|
||||
"digits": {
|
||||
"0": "0",
|
||||
"1": "1",
|
||||
"2": "2",
|
||||
"3": "3",
|
||||
"4": "4",
|
||||
"5": "5",
|
||||
"6": "6",
|
||||
"7": "7",
|
||||
"8": "8",
|
||||
"9": "9"
|
||||
},
|
||||
"frac": ".",
|
||||
"neg-pref": "-",
|
||||
"neg-sufx": ""
|
||||
}
|
||||
},
|
||||
|
||||
"index":"Heim",
|
||||
"conlangs":"Conlanging",
|
||||
"coding":"Coding",
|
||||
"poetry-stories":"Poetry & Stories",
|
||||
"about":"About Tavyza",
|
||||
"dx1":"Halló. This website is under construction. Feel free to give suggestions in <a href=\"//git.tavyza.org/Theros/tavyza-website\">the git repository</a>. Please expect issues with formatting, translation errors, the like.",
|
||||
"dx2":"This website was proudly built without AI assistance."
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user