-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
25 lines (19 loc) · 752 Bytes
/
script.js
File metadata and controls
25 lines (19 loc) · 752 Bytes
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
"use strict";
const pdImage = document.querySelector(".author__image");
const pdImageOriginal = document.createElement("img");
const projectList = document.querySelector(".mini-projects");
const projectCount = document.querySelector(".mini-project-count");
pdImageOriginal.src = "img/danuka prasad.png";
pdImageOriginal.addEventListener("load", function (e) {
pdImage.src = "img/danuka prasad.png";
pdImage.classList.remove("lazy-load");
});
projectCount.textContent = projectList.querySelectorAll("li").length;
document.querySelectorAll(".mini-project").forEach(function (item) {
item.addEventListener("click", function () {
const link = this.querySelector("a");
if (link) {
window.location.href = link.href;
}
});
});