/*Downloaded from https://www.codeseek.co/0xFFD700/lemmata-JRaNxQ */
body {
background-color: #111111;
color: white;
font-size: 3.0em;
font-family: Georgia, 'Times New Roman', serif;
}
@media all and (max-width: 1800px) {
body {
font-size: 2.5em;
}
}
@media all and (max-width: 1200px) {
body {
font-size: 2.0em;
}
}
@media all and (max-width: 1000px) {
body {
font-size: 1.5em;
}
}
@media all and (max-width: 500px) {
body {
font-size: 1.0em;
}
}
a {
text-decoration: none;
color: #009900;
}
a:hover,
a:focus {
color: #009900;
}
.nodisplay {
color: #009900;
display: none;
}
.install,
.lemmata {
color: white;
display: none;
}
.logo {
background-color: #111111;
border: none;
}
.element3,
.element5,
.result-text {
display: inline;
}
#name-input,
#search-input,
#error-input {
background-color: #111111;
border: none;
color: white;
display: none;
}
input,
input:focus {
outline: none;
border: none !important;
border-color: #111111 !important;
animation: blink-empty 1s infinite;
border-left: transparent solid 1px;
margin: 5px;
}
@keyframes blink-empty {
50% {
border-left: 1px solid white;
}
}
/*Downloaded from https://www.codeseek.co/0xFFD700/lemmata-JRaNxQ */
//typanimation with type.js
setTimeout(function() {
$(".element0").typed({
strings: ["sudo apt-get install Lemmata"],
typeSpeed: 30, // speed 0 fastest
backDelay: 750, // backspacing
loop: false, // loop
loopCount: false, // number of loops, false = infinite
callback: function() {}
});
}, 0);
setTimeout(function() {
$(".password").css("display", "inline");
down();
$(".element1").typed({
strings: ["**********"],
typeSpeed: 100,
backDelay: 750,
loop: false,
loopCount: false,
callback: function() {}
});
}, 3000);
//timeout for install
setTimeout(
function() {
$(".inst0").css("display", "inline");
down();
}, 6000);
setTimeout(
function() {
$(".inst1").css("display", "inline");
down();
}, 7000);
setTimeout(
function() {
$(".inst2").css("display", "inline");
down();
}, 8500);
setTimeout(
function() {
$(".inst3").css("display", "inline");
down();
}, 10000);
setTimeout(
function() {
$(".ins4").css("display", "inline");
down();
}, 1200);
setTimeout(
function() {
$(".inst5").css("display", "inline");
down();
}, 13500);
setTimeout(
function() {
$(".inst6").css("display", "inline");
down();
}, 15000);
setTimeout(function() {
$(".whoami").css("display", "inline");
down();
$(".element2").typed({
strings: ["Lemmata"],
typeSpeed: 100,
backDelay: 750,
loop: false,
loopCount: false,
callback: function() {}
});
}, 17000);
setTimeout(function() {
$(".logo").css("display", "inline");
$("#name-input").css("display", "inline").focus();
down();
$(".element3").typed({
strings: ["> Who are you? "],
typeSpeed: 20,
backDelay: 750,
loop: false,
loopCount: false,
callback: function() {}
});
}, 20000);
//input name event
function userIn(inputName) {
var intro = "> Hello " + inputName + ", nice meeting you. My name is Lemmata, I´m your personal Wikipedia Assistant. It´s simple just enter the search term regarding your desired researchefield or RANDOM to get a random wikipage, I´ll do the rest.";
$(".intro-text").html(intro).css("display", "inline");
down();
$("#search-input").val('').css("display", "inline").focus();
$(".element4").typed({
strings: ["> What can I do for you today?"],
typeSpeed: 20,
backDelay: 750,
loop: false,
loopCount: false,
callback: function() {}
});
}
//random wikipage
function randomIn() {
$("input").attr('disabled', 'disabled');
$("#results").prepend("<a href='https://en.wikipedia.org/wiki/Special:Random'>Random Wikipage</a>");
down();
}
//input searchTerm error event
function errorIn() {
var output = ">'" + searchTerm + "': command not found<br>Enter valid searchterm: ";
$(".element5").html(output).css("display", "inline");
$("#error-input").val('').css("display", "inline").focus();
down();
}
//input searchTerm event
function searchIn(searchTerm) {
if (searchTerm == "RANDOM") {
randomIn();
} else {
var url = "https://en.wikipedia.org/w/api.php?action=opensearch&search=" + searchTerm + "&format=json&callback=?";
$.ajax({
url: url,
type: 'GET',
contentType: "application/json; charset=utf-8",
async: false,
dataType: "json",
success: function(data, status, jqXHR) {
if (data[1].length == 0) {
errorIn();
} else {
$('#error-input').css("animation", "none");
$("input").attr('disabled', 'disabled');
var output = "> That´s everything I found regarding the search term: '" + searchTerm + "'<br>";
$(".result-text").append(output).css("display", "inline");
for (var j = 0; j < data[1].length; j++) {
var wikiLink = "<a href='" + data[3][j] + "'>";
$("#results").append(wikiLink + "> " + data[1][j] + "<br><small>" + data[2][j] + "...</small></a><br><br>");
}
}
down();
}
})
}
}
//input triggers (enterkey 13)
$(function() {
$("#name-input").keyup(function(event) {
if (event.which == 13) {
inputName = document.getElementById('name-input').value;
userIn(inputName);
$('#name-input').css("animation", "none");
down();
}
});
});
$(function() {
$("#search-input").keyup(function(event) {
if (event.which == 13) {
searchTerm = document.getElementById('search-input').value;
$('#search-input').css("animation", "none");
searchIn(searchTerm);
}
});
});
$(function() {
$("#error-input").keyup(function(event) {
if (event.which == 13) {
searchTerm = document.getElementById('error-input').value;
searchIn(searchTerm);
}
});
});
//autoscroll
function down() {
document.getElementById('results').scrollIntoView();
};