Credits, Logs, Autocomplete by Last Name & Favicon

This commit is contained in:
ssyyhhrr
2022-06-18 19:15:46 +01:00
parent b1f5c18eba
commit a97ca717d0
7 changed files with 198 additions and 3 deletions

View File

@@ -156,6 +156,34 @@ input[type=text] {
font-family: "FormulaOne";
}
.credits {
color: white;
position: absolute;
text-align: center;
bottom: 1em;
font-family: "FormulaOne";
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%)
}
.credits p {
margin-bottom: 0.5em;
}
a {
color: #fff;
}
p a {
text-decoration: none;
color: #fd1706;
}
p a:hover {
text-decoration: underline;
}
.row {
display: flex;
flex-direction: row;

BIN
assets/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -17,13 +17,24 @@ function autocomplete(inp, arr) {
this.parentNode.appendChild(a);
/*for each item in the array...*/
for (i = 0; i < arr.length; i++) {
let s1 = arr[i].split(" ")[0]
let s2 = arr[i].split(" ")[1]
/*check if the item starts with the same letters as the text field value:*/
if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {
if (s1.substr(0, val.length).toUpperCase() == val.toUpperCase() || s2.substr(0, val.length).toUpperCase() == val.toUpperCase() || arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {
let first = s1.substr(0, val.length).toUpperCase() == val.toUpperCase()
let second = s2.substr(0, val.length).toUpperCase() == val.toUpperCase()
/*create a DIV element for each matching element:*/
b = document.createElement("DIV");
/*make the matching letters bold:*/
b.innerHTML = "<strong>" + arr[i].substr(0, val.length) + "</strong>";
b.innerHTML += arr[i].substr(val.length);
if (first) {
b.innerHTML = "<strong>" + s1.substr(0, val.length) + "</strong>" + s1.substr(val.length) + " " + s2;
} else if (second) {
b.innerHTML = s1 + " <strong>" + s2.substr(0, val.length) + "</strong>";
b.innerHTML += s2.substr(val.length);
} else {
b.innerHTML = "<strong>" + arr[i].substr(0, val.length) + "</strong>";
b.innerHTML += arr[i].substr(val.length);
}
/*insert a input field that will hold the current array item's value:*/
b.innerHTML += "<input type='hidden' value='" + arr[i] + "'>";
/*execute a function when someone clicks on the item value (DIV element):*/