diff --git a/.htaccess b/.htaccess index 1a0a3e7..c88600a 100644 --- a/.htaccess +++ b/.htaccess @@ -4,4 +4,8 @@ RewriteRule ^$ /index.html [R,L] - \ No newline at end of file + + + + Header set Cache-Control "max-age=84600, public" + \ No newline at end of file diff --git a/index.html b/index.html index f79d205..57fc41e 100644 --- a/index.html +++ b/index.html @@ -34,7 +34,5 @@ - - diff --git a/static/js/script.js b/static/js/script.js index df4c215..d0c8eb2 100644 --- a/static/js/script.js +++ b/static/js/script.js @@ -1,20 +1,32 @@ -const typedTextSpan = document.querySelector(".typed-text"), - textArray = ["Javascript", "IT Enthusiast","Cyber Security"], - typingDelay = 200, - erasingDelay = 100, - newTextDelay = 2e3; -let textArrayIndex = 0, - charIndex = 0; +const typedTextSpan = document.querySelector(".typed-text"); +const textArray = ["Javascript", "IT Enthusiast", "Cyber Security"]; +const typingDelay = 200; +const erasingDelay = 100; +const newTextDelay = 2000; +let textArrayIndex = 0; +let charIndex = 0; -function type() { charIndex < textArray[textArrayIndex].length ? (typedTextSpan.textContent += textArray[textArrayIndex].charAt(charIndex), charIndex++, setTimeout(type, 200)) : setTimeout(erase, 2e3) } +function type() { + if (charIndex < textArray[textArrayIndex].length) { + typedTextSpan.textContent += textArray[textArrayIndex].charAt(charIndex); + charIndex++; + setTimeout(type, typingDelay); + } else { + setTimeout(erase, newTextDelay); + } +} -function erase() { charIndex > 0 ? (typedTextSpan.textContent = textArray[textArrayIndex].substring(0, charIndex - 1), charIndex--, setTimeout(erase, 100)) : (textArrayIndex++, textArrayIndex >= textArray.length && (textArrayIndex = 0), setTimeout(type, 1300)) } -document.addEventListener("DOMContentLoaded", (function() { setTimeout(type, 2250) })); +function erase() { + if (charIndex > 0) { + typedTextSpan.textContent = textArray[textArrayIndex].substring(0, charIndex - 1); + charIndex--; + setTimeout(erase, erasingDelay); + } else { + textArrayIndex = (textArrayIndex + 1) % textArray.length; + setTimeout(type, typingDelay); + } +} -$(document).ready((function() { - $(".changeprofile").submit((function(e) { - var formObj, formURL = $(this).attr("action"), - formData = new FormData(this); - $.ajax({ url: formURL, type: "POST", data: formData, contentType: !1, cache: !1, processData: !1, beforeSend: function() { $("button").attr("disabled", "disabled"), $("input").attr("disabled", "disabled"), $("a").attr("disabled", "disabled"), $(".inibutton").html(' Wait') }, success: function(data) { data.includes("Success") ? ($("button").removeAttr("disabled", "disabled"), $("a").removeAttr("disabled", "disabled"), $("input").removeAttr("disabled", "disabled"), $(".inibutton").html("Save"), $.notify({ icon: "tim-icons icon-check-2", message: data }, { type: "success", timer: 3e3, placement: { from: "top", align: "right" } }), window.location = window.location) : ($("button").removeAttr("disabled", "disabled"), $("a").removeAttr("disabled", "disabled"), $("input").removeAttr("disabled", "disabled"), $(".inibutton").html("Save"), $.notify({ icon: "tim-icons icon-simple-remove", message: data }, { type: "danger", timer: 3e3, placement: { from: "top", align: "right" } })) } }), e.preventDefault() - })) -})) +document.addEventListener("DOMContentLoaded", function() { + setTimeout(type, newTextDelay); +}); \ No newline at end of file