gpt-4.1-2025-04-14· OpenAI
LMArena Human Preference 140K
Design a personal portfolio website with interactive project showcases and a contact form.
- User
Design a personal portfolio website with interactive project showcases and a contact form.
- Assistant
Absolutely! Here’s a complete design outline for a personal portfolio website with interactive project showcases and a contact form. I’ll provide a site structure, feature descriptions, and a sample code implementation using HTML, CSS, and JavaScript (with a touch of modern design). You can adapt this to frameworks like React or Vue if you wish.
1. Site Structure
- Header: Name, logo, navigation links (Home, Projects, About, Contact)
- Hero Section: Brief intro, tagline, call-to-action button
- Projects Section: Interactive project cards (hover effects, modal popups or sliders)
- About Section: Short bio, skills, maybe a photo
- Contact Section: Contact form (name, email, message)
- Footer: Social links, copyright
2. Feature Descriptions
Interactive Project Showcases
- Each project is a card with an image, title, and short description.
- On hover: card lifts, shows more info or a “View Details” button.
- On click: modal popup with more details, images, and links (e.g., live demo, GitHub).
Contact Form
- Fields: Name, Email, Message
- Simple validation (required fields, email format)
- Success/failure message after submission (can use a service like Formspree or EmailJS for real submissions).
3. Sample Code Implementation
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <title>Your Name | Portfolio</title> <link rel="stylesheet" href="styles.css"/> </head> <body> <header> <div class="logo">YourName</div> <nav> <a href="#projects">Projects</a> <a href="#about">About</a> <a href="#contact">Contact</a> </nav> </header> <section class="hero"> <h1>Hello, I'm <span>Your Name</span></h1> <p>Creative Developer | Designer | Problem Solver</p> <a href="#projects" class="cta-btn">View My Work</a> </section> <section id="projects" class="projects"> <h2>Projects</h2> <div class="project-grid"> <!-- Project Card Example --> <div class="project-card" data-project="1"> <img src="project1.jpg" alt="Project 1"/> <div class="project-info"> <h3>Project One</h3> <p>Short description of the project.</p> </div> </div> <!-- Add more project cards as needed --> </div> </section> <!-- Modal for Project Details --> <div id="project-modal" class="modal"> <div class="modal-content"> <span class="close-btn">×</span> <div id="modal-body"></div> </div> </div> <section id="about" class="about"> <h2>About Me</h2> <div class="about-content"> <img src="yourphoto.jpg" alt="Your Photo"/> <div> <p>Short bio about you, your skills, and your passion.</p> <ul> <li>JavaScript, HTML, CSS</li> <li>React, Node.js</li> <li>UI/UX Design</li> </ul> </div> </div> </section> <section id="contact" class="contact"> <h2>Contact Me</h2> <form id="contact-form"> <input type="text" name="name" placeholder="Your Name" required/> <input type="email" name="email" placeholder="Your Email" required/> <textarea name="message" placeholder="Your Message" required></textarea> <button type="submit">Send Message</button> <div id="form-message"></div> </form> </section> <footer> <p>© 2025 Your Name. All rights reserved.</p> <div class="social-links"> <a href="#">LinkedIn</a> <a href="#">GitHub</a> <a href="#">Twitter</a> </div> </footer> <script src="script.js"></script> </body> </html>
CSS (styles.css)
body { font-family: 'Segoe UI', sans-serif; margin: 0; background: #f8f9fa; color: #222; } header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 3rem; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 100; } .logo { font-weight: bold; font-size: 1.5rem; color: #0077ff; } nav a { margin-left: 2rem; text-decoration: none; color: #222; font-weight: 500; transition: color 0.2s; } nav a:hover { color: #0077ff; } .hero { text-align: center; padding: 5rem 2rem 3rem 2rem; background: linear-gradient(120deg, #0077ff 0%, #00c6ff 100%); color: #fff; } .hero span { color: #ffe066; } .cta-btn { display: inline-block; margin-top: 2rem; padding: 0.75rem 2rem; background: #ffe066; color: #222; border-radius: 30px; text-decoration: none; font-weight: bold; transition: background 0.2s; } .cta-btn:hover { background: #fff; color: #0077ff; } .projects { padding: 4rem 2rem; background: #f1f3f6; } .projects h2 { text-align: center; margin-bottom: 2rem; } .project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; max-width: 1000px; margin: 0 auto; } .project-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,0.07); overflow: hidden; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; position: relative; } .project-card:hover { transform: translateY(-8px) scale(1.03); box-shadow: 0 8px 24px rgba(0,0,0,0.12); } .project-card img { width: 100%; height: 180px; object-fit: cover; } .project-info { padding: 1rem; } .modal { display: none; position: fixed; z-index: 200; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); justify-content: center; align-items: center; } .modal-content { background: #fff; border-radius: 10px; padding: 2rem; max-width: 500px; width: 90%; position: relative; } .close-btn { position: absolute; top: 1rem; right: 1rem; font-size: 1.5rem; cursor: pointer; } .about { padding: 4rem 2rem; background: #fff; } .about-content { display: flex; align-items: center; max-width: 800px; margin: 0 auto; gap: 2rem; } .about-content img { width: 120px; border-radius: 50%; border: 4px solid #0077ff; } .contact { padding: 4rem 2rem; background: #f1f3f6; } .contact form { max-width: 400px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; } .contact input, .contact textarea { padding: 0.75rem; border: 1px solid #ccc; border-radius: 6px; font-size: 1rem; } .contact button { padding: 0.75rem; background: #0077ff; color: #fff; border: none; border-radius: 6px; font-size: 1rem; cursor: pointer; transition: background 0.2s; } .contact button:hover { background: #005bb5; } #form-message { margin-top: 0.5rem; font-size: 0.95rem; } footer { text-align: center; padding: 2rem 1rem; background: #222; color: #fff; } .social-links a { margin: 0 0.5rem; color: #ffe066; text-decoration: none; font-weight: bold; } .social-links a:hover { color: #fff; } @media (max-width: 700px) { .about-content { flex-direction: column; text-align: center; } header { flex-direction: column; gap: 1rem; } }
JavaScript (script.js)
// Project modal data const projects = [ { id: 1, title: "Project One", image: "project1.jpg", description: "Detailed description of Project One. What you built, technologies used, challenges, and links.", links: [ { label: "Live Demo", url: "https://yourproject1.com" }, { label: "GitHub", url: "https://github.com/yourusername/project1" } ] }, // Add more projects as needed ]; // Modal logic const projectCards = document.querySelectorAll('.project-card'); const modal = document.getElementById('project-modal'); const modalBody = document.getElementById('modal-body'); const closeBtn = document.querySelector('.close-btn'); projectCards.forEach(card => { card.addEventListener('click', () => { const projectId = card.getAttribute('data-project'); const project = projects.find(p => p.id == projectId); if (project) { modalBody.innerHTML = ` <h2>${project.title}</h2> <img src="${project.image}" alt="${project.title}" style="width:100%;border-radius:8px;margin-bottom:1rem;"/> <p>${project.description}</p> <div> ${project.links.map(link => `<a href="${link.url}" target="_blank" style="margin-right:1rem;color:#0077ff;">${link.label}</a>`).join('')} </div> `; modal.style.display = 'flex'; } }); }); closeBtn.onclick = () => { modal.style.display = 'none'; }; window.onclick = (e) => { if (e.target == modal) modal.style.display = 'none'; }; // Contact form logic (demo only) const form = document.getElementById('contact-form'); const formMessage = document.getElementById('form-message'); form.addEventListener('submit', function(e) { e.preventDefault(); // Simple validation const name = form.name.value.trim(); const email = form.email.value.trim(); const message = form.message.value.trim(); if (!name || !email || !message) { formMessage.textContent = "Please fill in all fields."; formMessage.style.color = "red"; return; } // Simulate sending formMessage.textContent = "Sending..."; formMessage.style.color = "#0077ff"; setTimeout(() => { formMessage.textContent = "Thank you! Your message has been sent."; formMessage.style.color = "green"; form.reset(); }, 1200); });
4. How to Use/Customize
- Replace placeholder images, text, and links with your own.
- Add more projects to the
projectsarray inscript.jsand corresponding cards in HTML. - For a real contact form, use a backend or a service like Formspree or EmailJS.
- For more advanced interactivity, consider using React or Vue.
Let me know if you want a React or Vue version, or if you’d like to see a live demo!
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.