Sakuna's picture
Create a simple portfolio website (beautiful) that provides a summary of my self and allow the visitors to download my CV and direct them to my linked in, medium, and google scholar profiles
c5ded71 verified
Raw History Blame Contribute Delete
2.59 kB
// User profile data - replace with your actual information
const userData = {
name: "Your Name",
title: "Your Profession",
cvUrl: "#", // Replace with your CV download link
linkedin: "#", // Replace with your LinkedIn profile URL
medium: "#", // Replace with your Medium profile URL
scholar: "#" // Replace with your Google Scholar profile URL
};
// Set user data on page load
document.addEventListener('DOMContentLoaded', () => {
document.getElementById('userName').textContent = userData.name;
document.getElementById('userTitle').textContent = userData.title;
const cvDownload = document.getElementById('cvDownload');
const linkedinLink = document.getElementById('linkedinLink');
const mediumLink = document.getElementById('mediumLink');
const scholarLink = document.getElementById('scholarLink');
if (cvDownload) cvDownload.href = userData.cvUrl;
if (linkedinLink) linkedinLink.href = userData.linkedin;
if (mediumLink) mediumLink.href = userData.medium;
if (scholarLink) scholarLink.href = userData.scholar;
});
// Intersection Observer for section animations
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('visible');
}
});
}, {
threshold: 0.1
});
document.querySelectorAll('section').forEach(section => {
observer.observe(section);
});
// Smooth scroll for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function(e) {
e.preventDefault();
const targetId = this.getAttribute('href');
const targetElement = document.querySelector(targetId);
if (targetElement) {
targetElement.scrollIntoView({
behavior: 'smooth'
});
}
});
});
// Close mobile menu when clicking a link
document.addEventListener('click', function(e) {
if (e.target.matches('a[href^="#"]')) {
const mobileMenu = document.querySelector('custom-navbar').shadowRoot.getElementById('mobileMenu');
if (mobileMenu && !mobileMenu.classList.contains('hidden')) {
mobileMenu.classList.add('hidden');
const menuButton = document.querySelector('custom-navbar').shadowRoot.getElementById('mobileMenuButton');
if (menuButton) {
const icon = menuButton.querySelector('i');
icon.setAttribute('data-feather', 'menu');
feather.replace();
}
}
}
});