Skip to content

Commit 243ccd8

Browse files
Update cv.html
1 parent 0bef179 commit 243ccd8

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

cv.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,40 @@
2929
],
3030
"url": "https://hariprashad-ravikumar.github.io"
3131
}
32+
</script>
33+
<script>
34+
// Function to update the date based on the last modified date of the PDF file
35+
window.onload = function() {
36+
const pdfFilePath = 'cv/CV_HARI.pdf';
37+
const dateText = document.getElementById('cv-date-text');
38+
39+
fetch(pdfFilePath, { method: 'HEAD' })
40+
.then(response => {
41+
const lastModified = response.headers.get('last-modified');
42+
if (lastModified) {
43+
const date = new Date(lastModified);
44+
const options = { year: 'numeric', month: 'long' };
45+
const formattedDate = date.toLocaleDateString('en-US', options);
46+
dateText.textContent = formattedDate;
47+
}
48+
})
49+
.catch(error => {
50+
console.error("Error fetching PDF file:", error);
51+
});
52+
53+
// Toggle info box visibility
54+
const infoIcon = document.getElementById('info-icon');
55+
const infoBox = document.getElementById('info-box');
56+
const closeInfoBtn = document.getElementById('close-info');
57+
58+
infoIcon.onclick = function() {
59+
infoBox.style.display = infoBox.style.display === 'block' ? 'none' : 'block';
60+
};
61+
62+
closeInfoBtn.onclick = function() {
63+
infoBox.style.display = 'none';
64+
};
65+
};
3266
</script>
3367

3468
<script type="text/x-mathjax-config">

0 commit comments

Comments
 (0)