-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
54 lines (38 loc) · 1.44 KB
/
index.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
const toggleButton = document.getElementsByClassName('toggle-button')[0]
const navbarLinks = document.getElementsByClassName('navbar-links')[0]
toggleButton.addEventListener('click', () => {
navbarLinks.classList.toggle('active')
})
fetch("https://api.github.com/users/mojahmed/repos")
.then(function (response) {
return response.json()
})
.then(function (data) {
console.log(data);
let projects = data
let projectSection = document.getElementById("projects");
let projectList = projectSection.querySelector("ul");
for (let i = 0; i < projects.length; i++) {
let projectElement = document.createElement("a");
projectElement.href = `${projects[i].html_url}`
projectElement.innerText = `${projectElement.textContent = projects[i].name}`
projectList.appendChild(projectElement);
}
})
let today = new Date();
var thisYear = today.getFullYear();
let footer = document.querySelector("#copyright");
if (footer) {
let copyright = document.createElement("p")
copyright.innerHTML = `© Mohammed Ahmed ${thisYear}`;
footer.appendChild(copyright);
}
// document.getElementById("my-pic").addEventListener("click", function () {
// alert("Welcome to my website !");
// });
// var typed = new Typed(".user-img", {
// Strings: ["Mohammed Ahmed", "new"],
// TypeSpeed: 150,
// backSpeed: 150,
// loop: true
// })