-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
37 lines (32 loc) · 1.35 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
// Function to update the clock
function updateClock() {
const now = new Date();
const options = { timeZone: 'Europe/Istanbul', hour: '2-digit', minute: '2-digit', second: '2-digit' };
const timeString = now.toLocaleTimeString('en-US', options);
document.getElementById('clock').textContent = `Istanbul Time: ${timeString}`;
}
// Update the clock every second
setInterval(updateClock, 1000);
// Function to fetch GitHub repositories
async function fetchGitHubRepos() {
const username = 'mbudak21';
const response = await fetch(`https://api.github.com/users/${username}/repos`);
const repos = await response.json();
const reposContainer = document.getElementById('github-repos');
repos.forEach(repo => {
const repoCard = document.createElement('div');
repoCard.classList.add('repo-card');
repoCard.innerHTML = `
<h3>${repo.name}</h3>
<p>${repo.description || 'No description available'}</p>
<a href="${repo.html_url}" target="_blank">View on GitHub</a>
`;
reposContainer.appendChild(repoCard);
});
}
// Fetch GitHub repos when the page loads
window.addEventListener('load', fetchGitHubRepos);
// Handle CV download
document.getElementById('download-cv').addEventListener('click', function() {
window.open('docs/MehmetMuratBudak_CV_14-11-24.pdf', '_blank');
});