anycoder-ae007d74 / index.html
Shaikhsarib's picture
Upload folder using huggingface_hub
3118eac verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Modern Portfolio - Frontend Application</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
:root {
--primary-color: #667eea;
--secondary-color: #764ba2;
--text-primary: #2d3748;
--text-secondary: #4a5568;
--bg-primary: #ffffff;
--bg-secondary: #f7fafc;
--bg-card: #ffffff;
--border-color: #e2e8f0;
--shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
--shadow-md: 0 4px 6px rgba(0,0,0,0.1);
--shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
--shadow-xl: 0 20px 40px rgba(0,0,0,0.2);
--gradient: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
--transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="dark"] {
--text-primary: #f7fafc;
--text-secondary: #e2e8f0;
--bg-primary: #1a202c;
--bg-secondary: #2d3748;
--bg-card: #2d3748;
--border-color: #4a5568;
--shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.4);
--shadow-md: 0 4px 6px rgba(0,0,0,0.3);
--shadow-lg: 0 10px 20px rgba(0,0,0,0.4);
--shadow-xl: 0 20px 40px rgba(0,0,0,0.5);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
scroll-behavior: smooth;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background-color: var(--bg-secondary);
color: var(--text-primary);
line-height: 1.6;
overflow-x: hidden;
transition: var(--transition);
}
/* Custom Scrollbar */
::-webkit-scrollbar {
width: 10px;
}
::-webkit-scrollbar-track {
background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
background: var(--primary-color);
border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--secondary-color);
}
/* Header */
header {
position: fixed;
top: 0;
width: 100%;
background: var(--bg-primary);
backdrop-filter: blur(10px);
box-shadow: var(--shadow-sm);
z-index: 1000;
transition: var(--transition);
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 5%;
max-width: 1400px;
margin: 0 auto;
}
.logo {
font-size: 1.5rem;
font-weight: 700;
background: var(--gradient);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
animation: gradientShift 3s ease infinite;
}
@keyframes gradientShift {
0%, 100% { filter: hue-rotate(0deg); }
50% { filter: hue-rotate(30deg); }
}
.nav-links {
display: flex;
list-style: none;
gap: 2rem;
align-items: center;
}
.nav-links a {
color: var(--text-primary);
text-decoration: none;
font-weight: 500;
position: relative;
transition: var(--transition);
}
.nav-links a::after {
content: '';
position: absolute;
bottom: -5px;
left: 0;
width: 0;
height: 2px;
background: var(--gradient);
transition: width 0.3s ease;
}
.nav-links a:hover::after {
width: 100%;
}
.theme-toggle {
background: none;
border: none;
cursor: pointer;
font-size: 1.2rem;
color: var(--text-primary);
transition: transform 0.3s ease;
}
.theme-toggle:hover {
transform: rotate(180deg);
}
.mobile-menu {
display: none;
flex-direction: column;
gap: 4px;
background: none;
border: none;
cursor: pointer;
}
.mobile-menu span {
width: 25px;
height: 3px;
background: var(--text-primary);
transition: var(--transition);
}
/* Hero Section */
.hero {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: var(--bg-primary);
position: relative;
overflow: hidden;
padding-top: 80px;
}
.hero-bg {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: var(--gradient);
opacity: 0.05;
animation: pulse 4s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { opacity: 0.05; }
50% { opacity: 0.1; }
}
.hero-content {
text-align: center;
z-index: 1;
animation: fadeInUp 1s ease;
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.hero h1 {
font-size: clamp(2rem, 5vw, 4rem);
margin-bottom: 1rem;
background: var(--gradient);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.hero .subtitle {
font-size: clamp(1rem, 2vw, 1.5rem);
color: var(--text-secondary);
margin-bottom: 2rem;
}
.hero-buttons {
display: flex;
gap: 1rem;
justify-content: center;
flex-wrap: wrap;
}
.btn {
padding: 0.75rem 2rem;
border: none;
border-radius: 50px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: var(--transition);
text-decoration: none;
display: inline-block;
}
.btn-primary {
background: var(--gradient);
color: white;
box-shadow: var(--shadow-md);
}
.btn-primary:hover {
transform: translateY(-3px);
box-shadow: var(--shadow-lg);
}
.btn-secondary {
background: transparent;
color: var(--text-primary);
border: 2px solid var(--primary-color);
}
.btn-secondary:hover {
background: var(--primary-color);
color: white;
transform: translateY(-3px);
}
/* Floating particles */
.particles {
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
}
.particle {
position: absolute;
width: 4px;
height: 4px;
background: var(--primary-color);
border-radius: 50%;
opacity: 0.3;
animation: float 20s infinite linear;
}
@keyframes float {
from {
transform: translateY(100vh) translateX(0);
}
to {
transform: translateY(-100px) translateX(100px);
}
}
/* Section Styles */
section {
padding: 5rem 5%;
max-width: 1400px;
margin: 0 auto;
}
.section-title {
text-align: center;
font-size: 2.5rem;
margin-bottom: 3rem;
position: relative;
}
.section-title::after {
content: '';
position: absolute;
bottom: -10px;
left: 50%;
transform: translateX(-50%);
width: 60px;
height: 4px;
background: var(--gradient);
border-radius: 2px;
}
/* About Section */
.about {
background: var(--bg-primary);
}
.about-content {
display: grid;
grid-template-columns: 1fr 2fr;
gap: 3rem;
align-items: center;
}
.about-image {
position: relative;
animation: slideInLeft 1s ease;
}
@keyframes slideInLeft {
from {
opacity: 0;
transform: translateX(-30px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
.about-image img {
width: 100%;
border-radius: 20px;
box-shadow: var(--shadow-xl);
}
.about-text {
animation: slideInRight 1s ease;
}
@keyframes slideInRight {
from {
opacity: 0;
transform: translateX(30px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
/* Skills Section */
.skills-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
}
.skill-card {
background: var(--bg-card);
padding: 2rem;
border-radius: 15px;
box-shadow: var(--shadow-md);
transition: var(--transition);
position: relative;
overflow: hidden;
}
.skill-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 4px;
background: var(--gradient);
}
.skill-card:hover {
transform: translateY(-5px);
box-shadow: var(--shadow-xl);
}
.skill-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
}
.skill-name {
font-weight: 600;
color: var(--text-primary);
}
.skill-percentage {
color: var(--primary-color);
font-weight: 700;
}
.skill-bar {
width: 100%;
height: 10px;
background: var(--border-color);
border-radius: 10px;
overflow: hidden;
position: relative;
}
.skill-progress {
height: 100%;
background: var(--gradient);
border-radius: 10px;
width: 0;
animation: fillBar 2s ease forwards;
}
@keyframes fillBar {
to { width: var(--skill-level); }
}
/* Projects Section */
.projects {
background: var(--bg-primary);
}
.projects-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
gap: 2rem;
}
.project-card {
background: var(--bg-card);
border-radius: 15px;
overflow: hidden;
box-shadow: var(--shadow-md);
transition: var(--transition);
cursor: pointer;
}
.project-card:hover {
transform: translateY(-10px) scale(1.02);
box-shadow: var(--shadow-xl);
}
.project-image {
width: 100%;
height: 200px;
background: var(--gradient);
position: relative;
overflow: hidden;
}
.project-image img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.5s ease;
}
.project-card:hover .project-image img {
transform: scale(1.1);
}
.project-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.7);
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
transition: opacity 0.3s ease;
}
.project-card:hover .project-overlay {
opacity: 1;
}
.project-links {
display: flex;
gap: 1rem;
}
.project-links a {
width: 40px;
height: 40px;
background: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: var(--primary-color);
text-decoration: none;
transition: var(--transition);
}
.project-links a:hover {
transform: scale(1.1);
background: var(--primary-color);
color: white;
}
.project-info {
padding: 1.5rem;
}
.project-title {
font-size: 1.25rem;
margin-bottom: 0.5rem;
color: var(--text-primary);
}
.project-description {
color: var(--text-secondary);
margin-bottom: 1rem;
}
.project-tags {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.tag {
padding: 0.25rem 0.75rem;
background: var(--gradient);
color: white;
border-radius: 20px;
font-size: 0.875rem;
}
/* Contact Section */
.contact {
background: var(--bg-primary);
}
.contact-container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 3rem;
max-width: 1000px;
margin: 0 auto;
}
.contact-info {
display: flex;
flex-direction: column;
gap: 2rem;
}
.contact-item {
display: flex;
align-items: center;
gap: 1rem;
}
.contact-icon {
width: 50px;
height: 50px;
background: var(--gradient);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 1.25rem;
}
.contact-form {
background: var(--bg-card);
padding: 2rem;
border-radius: 15px;
box-shadow: var(--shadow-md);
}
.form-group {
margin-bottom: 1.5rem;
}
.form-group label {
display: block;
margin-bottom: 0.5rem;
color: var(--text-primary);
font-weight: 500;
}
.form-group input,
.form-group textarea {
width: 100%;
padding: 0.75rem;
border: 2px solid var(--border-color);
border-radius: 10px;
background: var(--bg-primary);
color: var(--text-primary);
font-size: 1rem;
transition: var(--transition);
}
.form-group input:focus,
.form-group textarea:focus {
outline: none;
border-color: var(--primary-color);
}
.form-group textarea {
resize: vertical;
min-height: 120px;
}
/* Footer */
footer {
background: var(--bg-primary);
padding: 2rem 5%;
text-align: center;
border-top: 1px solid var(--border-color);
}
.social-links {
display: flex;
justify-content: center;
gap: 1rem;
margin-bottom: 1rem;
}
.social-links a {
width: 40px;
height: 40px;
background: var(--gradient);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: white;
text-decoration: none;
transition: var(--transition);
}
.social-links a:hover {
transform: translateY(-3px) rotate(360deg);
}
/* Toast Notification */
.toast {
position: fixed;
bottom: -100px;
left: 50%;
transform: translateX(-50%);
background: var(--gradient);
color: white;
padding: 1rem 2rem;
border-radius: 50px;
box-shadow: var(--shadow-xl);
transition: bottom 0.3s ease;
z-index: 2000;
}
.toast.show {
bottom: 30px;
}
/* Responsive Design */
@media (max-width: 768px) {
.nav-links {
display: none;
position: absolute;
top: 100%;
left: 0;
width: 100%;
background: var(--bg-primary);
flex-direction: column;
padding: 1rem;
box-shadow: var(--shadow-md);
}
.nav-links.active {
display: flex;
}
.mobile-menu {
display: flex;
}
.about-content {
grid-template-columns: 1fr;
}
.contact-container {
grid-template-columns: 1fr;
}
.hero-buttons {
flex-direction: column;
align-items: center;
}
.btn {
width: 200px;
}
}
/* Loading Animation */
.loader {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: var(--bg-primary);
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
transition: opacity 0.5s ease;
}
.loader.hidden {
opacity: 0;
pointer-events: none;
}
.loader-circle {
width: 50px;
height: 50px;
border: 4px solid var(--border-color);
border-top-color: var(--primary-color);
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
</style>
</head>
<body>
<!-- Loading Screen -->
<div class="loader" id="loader">
<div class="loader-circle"></div>
</div>
<!-- Header -->
<header>
<nav>
<div class="logo">Portfolio</div>
<ul class="nav-links" id="navLinks">
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#skills">Skills</a></li>
<li><a href="#projects">Projects</a></li>
<li><a href="#contact">Contact</a></li>
<li>
<button class="theme-toggle" id="themeToggle">
<i class="fas fa-moon"></i>
</button>
</li>
</ul>
<button class="mobile-menu" id="mobileMenu">
<span></span>
<span></span>
<span></span>
</button>
</nav>
<a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" style="position: absolute; right: 10px; top: 50px; font-size: 12px; color: var(--text-secondary); text-decoration: none;">Built with anycoder</a>
</header>
<!-- Hero Section -->
<section class="hero" id="home">
<div class="hero-bg"></div>
<div class="particles" id="particles"></div>
<div class="hero-content">
<h1>Welcome to My Portfolio</h1>
<p class="subtitle">Crafting Beautiful Digital Experiences</p>
<div class="hero-buttons">
<a href="#projects" class="btn btn-primary">View Projects</a>
<a href="#contact" class="btn btn-secondary">Get In Touch</a>
</div>
</div>
</section>
<!-- About Section -->
<section class="about" id="about">
<h2 class="section-title">About Me</h2>
<div class="about-content">
<div class="about-image">
<img src="https://picsum.photos/seed/portfolio/400/400" alt="Profile">
</div>
<div class="about-text">
<h3>Frontend Developer & UI/UX Enthusiast</h3>
<p style="margin: 1rem 0; color: var(--text-secondary);">
I'm passionate about creating beautiful, functional, and user-centered digital experiences.
With expertise in modern web technologies, I bring ideas to life through clean code and
thoughtful design.
</p>
<p style="margin: 1rem 0; color: var(--text-secondary);">
My journey in web development started with curiosity and has evolved into a career
driven by innovation and continuous learning. I specialize in building responsive,
performant applications that delight users.
</p>
<div style="margin-top: 2rem;">
<button class="btn btn-primary" onclick="downloadResume()">Download Resume</button>
</div>
</div>
</div>
</section>
<!-- Skills Section -->
<section class="skills" id="skills">
<h2 class="section-title">Technical Skills</h2>
<div class="skills-grid">
<div class="skill-card">
<div class="skill-header">
<span class="skill-name">HTML/CSS</span>
<span class="skill-percentage">95%</span>
</div>
<div class="skill-bar">
<div class="skill-progress" style="--skill-level: 95%"></div>
</div>
</div>
<div class="skill-card">
<div class="skill-header">
<span class="skill-name">JavaScript</span>
<span class="skill-percentage">90%</span>
</div>
<div class="skill-bar">
<div class="skill-progress" style="--skill-level: 90%"></div>
</div>
</div>
<div class="skill-card">
<div class="skill-header">
<span class="skill-name">React</span>
<span class="skill-percentage">85%</span>
</div>
<div class="skill-bar">
<div class="skill-progress" style="--skill-level: 85%"></div>
</div>
</div>
<div class="skill-card">
<div class="skill-header">
<span class="skill-name">Node.js</span>
<span class="skill-percentage">80%</span>
</div>
<div class="skill-bar">
<div class="skill-progress" style="--skill-level: 80%"></div>
</div>
</div>
<div class="skill-card">
<div class="skill-header">
<span class="skill-name">UI/UX Design</span>
<span class="skill-percentage">88%</span>
</div>
<div class="skill-bar">
<div class="skill-progress" style="--skill-level: 88%"></div>
</div>
</div>
<div class="skill-card">
<div class="skill-header">
<span class="skill-name">Database</span>
<span class="skill-percentage">75%</span>
</div>
<div class="skill-bar">
<div class="skill-progress" style="--skill-level: 75%"></div>
</div>
</div>
</div>
</section>
<!-- Projects Section -->
<section class="projects" id="projects">
<h2 class="section-title">Featured Projects</h2>
<div class="projects-grid">
<div class="project-card">
<div class="project-image">
<img src="https://picsum.photos/seed/project1/400/200" alt="Project 1">
<div class="project-overlay">
<div class="project-links">
<a href="#"><i class="fas fa-eye"></i></a>
<a href="#"><i class="fab fa-github"></i></a>
</div>
</div>
</div>
<div class="project-info">
<h3 class="project-title">E-Commerce Platform</h3>
<p class="project-description">A full-stack e-commerce solution with modern UI and seamless shopping experience.</p>
<div class="project-tags">
<span class="tag">React</span>
<span class="tag">Node.js</span>
<span class="tag">MongoDB</span>
</div>
</div>
</div>
<div class="project-card">
<div class="project-image">
<img src="https://picsum.photos/seed/project2/400/200" alt="Project 2">
<div class="project-overlay">
<div class="project-links">
<a href="#"><i class="fas fa-eye"></i></a>
<a href="#"><i class="fab fa-github"></i></a>
</div>
</div>
</div>
<div class="project-info">
<h3 class="project-title">Task Management App</h3>
<p class="project-description">Collaborative task management tool with real-time updates and team features.</p>
<div class="project-tags">
<span class="tag">Vue.js</span>
<span class="tag">Firebase</span>
<span class="tag">Tailwind</span>
</div>
</div>
</div>
<div class="project-card">
<div class="project-image">
<img src="https://picsum.photos/seed/project3/400/200" alt="Project 3">
<div class="project-overlay">
<div class="project-links">
<a href="#"><i class="fas fa-eye"></i></a>
<a href="#"><i class="fab fa-github"></i></a>
</div>
</div>
</div>
<div class="project-info">
<h3 class="project-title">Weather Dashboard</h3>
<p class="project-description">Beautiful weather application with forecasts, maps, and location-based services.</p>
<div class="project-tags">
<span class="tag">JavaScript</span>
<span class="tag">API</span>
<span class="tag">CSS3</span>
</div>
</div>
</div>
</div>
</section>
<!-- Contact Section -->
<section class="contact" id="contact">
<h2 class="section-title">Get In Touch</h2>
<div class="contact-container">
<div class="contact-info">
<div class="contact-item">
<div class="contact-icon">
<i class="fas fa-envelope"></i>
</div>
<div>
<h4>Email</h4>
<p style="color: var(--text-secondary);">hello@example.com</p>
</div>
</div>
<div class="contact-item">
<div class="contact-icon">
<i class="fas fa-phone"></i>
</div>
<div>
<h4>Phone</h4>
<p style="color: var(--text-secondary);">+1 (555) 123-4567</p>
</div>
</div>
<div class="contact-item">
<div class="contact-icon">
<i class="fas fa-map-marker-alt"></i>
</div>
<div>
<h4>Location</h4>
<p style="color: var(--text-secondary);">San Francisco, CA</p>
</div>
</div>
</div>
<form class="contact-form" id="contactForm">
<div class="form-group">
<label for="name">Name</label>
<input type="text" id="name" name="name" required>
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email" name="email" required>
</div>
<div class="form-group">
<label for="message">Message</label>
<textarea id="message" name="message" required></textarea>
</div>
<button type="submit" class="btn btn-primary" style="width: 100%;">Send Message</button>
</form>
</div>
</section>
<!-- Footer -->
<footer>
<div class="social-links">
<a href="#"><i class="fab fa-github"></i></a>
<a href="#"><i class="fab fa-linkedin"></i></a>
<a href="#"><i class="fab fa-twitter"></i></a>
<a href="#"><i class="fab fa-instagram"></i></a>
</div>
<p style="color: var(--text-secondary);">&copy; 2024 Portfolio. All rights reserved.</p>
</footer>
<!-- Toast Notification -->
<div class="toast" id="toast">Message sent successfully!</div>
<script>
// Loader
window.addEventListener('load', () => {
setTimeout(() => {
document.getElementById('loader').classList.add('hidden');
}, 1000);
});
// Theme Toggle
const themeToggle = document.getElementById('themeToggle');
const body = document.body;
const icon = themeToggle.querySelector('i');
// Check for saved theme preference
const savedTheme = localStorage.getItem('theme') || 'light';
body.setAttribute('data-theme', savedTheme);
icon.className = savedTheme === 'dark' ? 'fas fa-sun' : 'fas fa-moon';
themeToggle.addEventListener('click', () => {
const currentTheme = body.getAttribute('data-theme');
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
body.setAttribute('data-theme', newTheme);
localStorage.setItem('theme', newTheme);
icon.className = newTheme === 'dark' ? 'fas fa-sun' : 'fas fa-moon';
});
// Mobile Menu
const mobileMenu = document.getElementById('mobileMenu');
const navLinks = document.getElementById('navLinks');
mobileMenu.addEventListener('click', () => {
navLinks.classList.toggle('active');
});
// Close mobile menu when clicking a link
navLinks.querySelectorAll('a').forEach(link => {
link.addEventListener('click', () => {
navLinks.classList.remove('active');
});
});
// Particles Animation
function createParticles() {
const particlesContainer = document.getElementById('particles');
const particleCount = 30;
for (let i = 0; i < particleCount; i++) {
const particle = document.createElement('div');
particle.className = 'particle';
particle.style.left = Math.random() * 100 + '%';
particle.style.animationDelay = Math.random() * 20 + 's';
particle.style.animationDuration = (Math.random() * 20 + 10) + 's';
particlesContainer.appendChild(particle);
}
}
createParticles();
// Contact Form
const contactForm = document.getElementById('contactForm');
const toast = document.getElementById('toast');
contactForm.addEventListener('submit', (e) => {
e.preventDefault();
// Show toast notification
toast.classList.add('show');
// Reset form
contactForm.reset();
// Hide toast after 3 seconds
setTimeout(() => {
toast.classList.remove('show');
}, 3000);
});
// Smooth Scroll with Offset
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
const headerOffset = 80;
const elementPosition = target.getBoundingClientRect().top;
const offsetPosition = elementPosition + window.pageYOffset - headerOffset;
window.scrollTo({
top: offsetPosition,
behavior: 'smooth'
});
}
});
});
// Scroll Animations
const observerOptions = {
threshold: 0.1,
rootMargin: '0px 0px -100px 0px'
};
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.style.opacity = '1';
entry.target.style.transform = 'translateY(0)';
}
});
}, observerOptions);
// Observe elements for animation
document.querySelectorAll('.skill-card, .project-card, .about-text').forEach(el => {
el.style.opacity = '0';
el.style.transform = 'translateY(20px)';
el.style.transition = 'opacity 0.6s ease, transform 0.6s ease';
observer.observe(el);
});
// Dynamic Header Background on Scroll
window.addEventListener('scroll', () => {
const header = document.querySelector('header');
if (window.scrollY > 100) {
header.style.background = 'var(--bg-primary)';
header.style.boxShadow = 'var(--shadow-md)';
} else {
header.style.background = 'var(--bg-primary)';
header.style.boxShadow = 'var(--shadow-sm)';
}
});
// Download Resume Function
function downloadResume() {
// Create a dummy resume download
const link = document.createElement('a');
link.href = 'data:text/plain;charset=utf-8,' + encodeURIComponent('This is a sample resume file.');
link.download = 'resume.txt';
link.click();
// Show toast
toast.textContent = 'Resume downloaded!';
toast.classList.add('show');
setTimeout(() => {
toast.classList.remove('show');
}, 3000);
}
// Add hover effect to project cards
document.querySelectorAll('.project-card').forEach(card => {
card.addEventListener('click', function() {
// Simulate project view
toast.textContent = 'Opening project details...';
toast.classList.add('show');
setTimeout(() => {
toast.classList.remove('show');
}, 2000);
});
});
// Typing Effect for Hero Title
const heroTitle = document.querySelector('.hero h1');
const originalText = heroTitle.textContent;
heroTitle.textContent = '';
let charIndex = 0;
function typeWriter() {
if (charIndex < originalText.length) {
heroTitle.textContent += originalText.charAt(char