Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Leuthra committed Feb 24, 2024
1 parent 2cd1fc3 commit efb07fb
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 20 deletions.
6 changes: 5 additions & 1 deletion .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@

RewriteRule ^$ /index.html [R,L]

</IfModule>
</IfModule>

<filesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|svg|js|css|swf)$">
Header set Cache-Control "max-age=84600, public"
</filesMatch>
2 changes: 0 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,5 @@
</div>
</div>
</body>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script language="JavaScript" type="text/javascript" src="static/js/script.js"></script>
</html>
46 changes: 29 additions & 17 deletions static/js/script.js
Original file line number Diff line number Diff line change
@@ -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('<i class="fas fa-spinner fa-spin"></i> 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);
});

0 comments on commit efb07fb

Please sign in to comment.