Added a download CV button with language selection
This commit is contained in:
parent
3f1ec3056d
commit
91936e441f
3 changed files with 59 additions and 2 deletions
22
js/main.js
22
js/main.js
|
|
@ -234,7 +234,27 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
});
|
||||
});
|
||||
|
||||
// ── 12. DRAGGABLE GALLERY ─────────────────────────────────────────
|
||||
// ── 12. CV DOWNLOAD MODAL ───────────────────────────────────────
|
||||
const cvModal = document.getElementById('cv-modal');
|
||||
const cvClose = document.getElementById('cv-modal-close');
|
||||
const cvBackdrop = document.getElementById('cv-modal-backdrop');
|
||||
|
||||
function openCvModal() { cvModal.classList.add('is-open'); }
|
||||
function closeCvModal() { cvModal.classList.remove('is-open'); }
|
||||
|
||||
document.querySelectorAll('.cv-download-btn').forEach(btn => {
|
||||
btn.addEventListener('click', (e) => { e.preventDefault(); openCvModal(); });
|
||||
});
|
||||
if (cvClose) cvClose.addEventListener('click', closeCvModal);
|
||||
if (cvBackdrop) cvBackdrop.addEventListener('click', closeCvModal);
|
||||
document.addEventListener('keydown', (e) => { if (e.key === 'Escape') closeCvModal(); });
|
||||
|
||||
// Auto-close modal after a language link is clicked
|
||||
document.querySelectorAll('.cv-lang-btn').forEach(btn => {
|
||||
btn.addEventListener('click', () => setTimeout(closeCvModal, 400));
|
||||
});
|
||||
|
||||
// ── 13. DRAGGABLE GALLERY ─────────────────────────────────────────
|
||||
const gallery = document.getElementById('gallery');
|
||||
if (gallery) {
|
||||
let isDown = false, startX, scrollLeft;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue