-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
82 lines (64 loc) · 2.31 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
console.log("I am working! ");
const author = "Adarsh Maurya!";
console.log(`Developer ${author}`);
var typed = new Typed(".dynamic-txt", {
strings: ["Web Developer!", "Programmer!", "Entrepreneur!"],
typeSpeed: 100,
backSpeed: 100,
backDelay: 1e3,
loop: !0,
});
let menuBtnCond = !0,
checkLabel = document.getElementById("check-label");
const menuBtnChanger = function () {
menuBtnCond
? ((checkLabel.innerHTML = "<i class='bx bx-x'></i>"), (menuBtnCond = !1))
: ((checkLabel.innerHTML = "<i class='bx bx-menu'></i>"),
(menuBtnCond = !0));
};
let menuBtn = document.getElementById("check");
menuBtn.addEventListener("click", menuBtnChanger);
// project section ux js
document.addEventListener("DOMContentLoaded", function() {
const projectCards = document.querySelectorAll(".project-card");
// Add event listeners to project cards
projectCards.forEach(card => {
card.addEventListener("mouseenter", function() {
this.classList.add("hovered");
});
card.addEventListener("mouseleave", function() {
this.classList.remove("hovered");
});
});
});
// certifcates section ux js
document.addEventListener("DOMContentLoaded", function() {
const certificationCards = document.querySelectorAll(".certification-card");
// Add event listeners to certification cards
certificationCards.forEach(card => {
card.addEventListener("mouseenter", function() {
this.classList.add("hovered");
});
card.addEventListener("mouseleave", function() {
this.classList.remove("hovered");
});
});
});
document.addEventListener("DOMContentLoaded", function() {
const image = document.querySelector(".about-img img");
// Function to add bouncing class to the image
function startBouncing() {
image.classList.add("bouncing");
}
// Function to remove bouncing class from the image
function stopBouncing() {
image.classList.remove("bouncing");
}
// Start bouncing animation when the page loads
startBouncing();
// Continuously toggle bouncing animation
setInterval(function() {
stopBouncing();
setTimeout(startBouncing, 50); // Wait for a short delay before starting again
}, 2000); // Adjust the delay based on the duration of the animation (2s in this case)
});