Skip to content

Commit

Permalink
🕹️ Refactor: Remove unnecessary codes/comments
Browse files Browse the repository at this point in the history
This commit optimizes the code to enhance performance and improve maintainability

Contributor: @divyanshudhruv 
Closes: none
  • Loading branch information
divyanshudhruv authored Feb 2, 2025
1 parent dc74c0f commit 3c6370b
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 41 deletions.
2 changes: 1 addition & 1 deletion css/404.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ body{
#error_text span {
color: #272341;
background-color: none;
font-family: Montserrat;
font-family: Montserrat,sans-serif;
font-weight: 700;
}

Expand Down
2 changes: 1 addition & 1 deletion css/navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
background-color: #ffffff70;
width: 100%;

font-family: Montserrat;
font-family: Montserrat,sans-serif;
padding: 1em;
transition: 0.3s;
}
Expand Down
31 changes: 13 additions & 18 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ a:visited {
background-color: none;
color: #272341;
font-size: 56px;
font-family: Montserrat;
font-family: Montserrat,sans-serif;
font-weight: 700;
align-items: center;
justify-content: center;
Expand Down Expand Up @@ -180,7 +180,7 @@ a:visited {
border: 2px solid #01b3af;
color: #01b3af;
font-size: 24px;
font-family: Montserrat;
font-family: Montserrat,sans-serif;
font-weight: 700;
cursor: pointer;
background: linear-gradient(to right, #01b3af 50%, #fff 50%);
Expand Down Expand Up @@ -283,7 +283,7 @@ a:visited {
height: 75px;
align-items: center;
justify-content: center;
font-family: Montserrat;
font-family: Montserrat,sans-serif;
font-weight: bold;
font-size: 55px;
background-color: none;
Expand Down Expand Up @@ -626,7 +626,7 @@ a:visited {
position: relative;
width: 100%;
height: fit-content;
font-family: "Montserrat";
font-family: "Montserrat",sans-serif;
font-weight: 500;
font-size: 18px;
color: #01b3af;
Expand All @@ -637,7 +637,7 @@ a:visited {
color: #6b7280;
margin-top: 5px;
display: flex;
font-family: "Montserrat";
font-family: "Montserrat",sans-serif;
font-weight: 500;
font-size: 13px;
}
Expand Down Expand Up @@ -692,7 +692,7 @@ a:visited {
height: 75px;
align-items: center;
justify-content: center;
font-family: Montserrat;
font-family: Montserrat,sans-serif;
font-weight: bold;
font-size: 55px;
background-color: none;
Expand Down Expand Up @@ -789,7 +789,7 @@ a:visited {
height: 75px;
align-items: center;
justify-content: center;
font-family: Montserrat;
font-family: Montserrat,sans-serif;
font-weight: bold;
font-size: 55px;
background-color: none;
Expand Down Expand Up @@ -827,8 +827,6 @@ a:visited {
background: #f8f8f8;
padding: 20px;
border-radius: 10px;
transition: transform 0.3s;
/* border: 1.4px solid #f0f0f0; */
cursor: pointer;
transition: 0.3s;
}
Expand Down Expand Up @@ -871,13 +869,12 @@ a:visited {
color: #777;
justify-content: center;
align-items: center;
font-family: "Montserrat" !important;
font-family: "Montserrat",sans-serif !important;
}

@media screen and (max-width: 915px) {
.servicesC .title {
font-size: 43px;
left: 0;
margin: auto;
left: -10px !important;
width: 100%;
Expand Down Expand Up @@ -914,7 +911,7 @@ a:visited {
height: 75px;
align-items: center;
justify-content: center;
font-family: Montserrat;
font-family: Montserrat,sans-serif;
font-weight: bold;
font-size: 55px;
background-color: none;
Expand Down Expand Up @@ -958,7 +955,6 @@ a:visited {

background-color: #f8f8f8;

transition: transform 0.3s;
/* border: 1.4px solid #f0f0f0; */
cursor: pointer;
transition: 0.3s;
Expand Down Expand Up @@ -997,7 +993,6 @@ a:visited {
color: #6b7280;
font-size: 11px;
font-weight: bold;
display: flex;
}

.skillsC .container .boxes .right {
Expand All @@ -1010,7 +1005,7 @@ a:visited {
justify-content: start;
font-size: 15px;
padding-left: 10px;
font-family: "Montserrat";
font-family: "Montserrat",sans-serif;
font-weight: normal;
letter-spacing: 0px;
color: #6b7280;
Expand Down Expand Up @@ -1325,7 +1320,7 @@ a:visited {
font-size: 14px;
font-weight: bold;
color: #3a3947;
font-family: Montserrat;
font-family: Montserrat,sans-serif;
letter-spacing: 0px;
margin-bottom: 8px;
}
Expand All @@ -1334,7 +1329,7 @@ a:visited {
position: relative;
display: flex;
font-size: 14px;
font-family: Montserrat;
font-family: Montserrat,sans-serif;
font-weight: normal;
color: #96989b;
letter-spacing: 0px;
Expand Down Expand Up @@ -1406,7 +1401,7 @@ a:visited {
align-items: start;
justify-content: start;
font-size: 14px;
font-family: Montserrat !important;
font-family: Montserrat,sans-serif !important;
font-weight: normal !important;
color: #96989b !important;
letter-spacing: 0px;
Expand Down
84 changes: 64 additions & 20 deletions js/404.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,67 @@
'use strict';
var e, t;
new function (e) {
const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=+<>,./?[{()}]!@#$%^&*~`|".split(""),
n = e.querySelector(".source"),
o = e.querySelector(".target");
let r, i, l, s = 0;

(function (e) {
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=+<>,./?[{()}]!@#$%^&*~`|".split("");
const source = e.querySelector(".source");
const target = e.querySelector(".target");

let interval, timeout, incrementInterval;
let index = 0;
let self = this;

this.start = function () {
n.style.display = "none", o.style.display = "block", r = window.setInterval((() => {
s <= n.innerText.length && (o.innerText = n.innerText.substring(0, s) + function (e) {
let n = "";
for (let o = 0; o < e; o++) n += t[Math.floor(Math.random() * t.length)];
return n
}(n.innerText.length - s))
}), 15), i = window.setTimeout((() => {
l = window.setInterval((() => {
s > n.innerText.length - 1 && this.stop(), s++
}), 70)
}), 350)
}, this.stop = function () {
n.style.display = "block", o.style.display = "none", o.innerText = "", s = 0, void 0 !== r && (window.clearInterval(r), r = void 0), void 0 !== l && (window.clearInterval(l), l = void 0), void 0 !== i && (window.clearInterval(i), i = void 0)
source.style.display = "none";
target.style.display = "block";

// Random character substitution effect
interval = setInterval(() => {
if (index <= source.innerText.length) {
target.innerText = source.innerText.substring(0, index) + getRandomString(source.innerText.length - index);
}
}, 15);

// Delayed start of revealing the original text
timeout = setTimeout(() => {
incrementInterval = setInterval(() => {
if (index > source.innerText.length - 1) {
self.stop();
}
index++;
}, 70);
}, 350);
};

this.stop = function () {
source.style.display = "block";
target.style.display = "none";
target.innerText = "";
index = 0;

if (interval !== undefined) clearInterval(interval);
if (incrementInterval !== undefined) clearInterval(incrementInterval);
if (timeout !== undefined) clearTimeout(timeout);
};

function getRandomString(length) {
let str = "";
for (let i = 0; i < length; i++) {
str += chars[Math.floor(Math.random() * chars.length)];
}
return str;
}
}(document.getElementById("error_text")).start(), "en" !== navigator.language.substring(0, 2).toLowerCase() && (e = document.createElement("script"), t = document.body, e.src = "", e.async = e.defer = !0, e.addEventListener("load", (() => t.removeChild(e))), t.appendChild(e));

this.start();
})(document.getElementById("error_text"));

// Handle different language settings
if (navigator.language.substring(0, 2).toLowerCase() !== "en") {
let script = document.createElement("script");
let body = document.body;

script.src = ""; // Add the correct script source URL here
script.async = true;
script.defer = true;

script.addEventListener("load", () => body.removeChild(script));
body.appendChild(script);
}
2 changes: 1 addition & 1 deletion js/typingAnimation.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Custom the typed strings array based on your roles
var typed = new Typed("#role", {
let typed = new Typed("#role", {
strings: ["the Unknown Developer", "a UI/UX Designer", "a Youtuber"],
typeSpeed: 210,
backSpeed: 40,
Expand Down

0 comments on commit 3c6370b

Please sign in to comment.