A professional portfolio website showcasing work and skills. Built with vanilla HTML, CSS, and JavaScript.
Portfolio/
├── src/
│ ├── index.html (Homepage)
│ ├── projects.html (Project showcase)
│ ├── contact.html (Contact form)
│ ├── css/
│ │ ├── main.css (Global styles, resets, variables)
│ │ ├── components.css (Reusable UI components)
│ │ └── animations.css (Keyframes and transitions)
│ ├── js/
│ │ ├── main.js (App initialization, imports all modules)
│ │ ├── api.js (GitHub API fetching)
│ │ ├── nav.js (Navigation and page switching)
│ │ └── utils.js (Utility helper functions)
│ └── service-worker.js (PWA offline support)
├── assets/
│ ├── images/ (Portfolio project images)
│ ├── icons/ (SVG icons for tech stack)
│ └── fonts/ (Local fonts if needed)
├── public/
│ └── manifest.json (Web app manifest for PWA)
├── README.md (This file)
└── .gitignore
The stylesheet is split into three semantic files that are loaded in order:
Load order matters: main.css first (resets and variables), then components.css (uses variables), then animations.css (applies to components).
The JavaScript codebase uses ES6 modules for clean separation of concerns. All modules are imported by main.js, which runs on the DOMContentLoaded event.
DOMContentLoaded eventfetchProfile() functionsetupNavigation() functionModule pattern example:
// my-module.js
export function doSomething(param) {
return result;
}
// main.js
import { doSomething } from './my-module.js';
doSomething(value);
service-worker.js, project-image.png, src/, css/, js/.home-menu, .project-card, .navigation-bar, .skill-badgefetchProfile, setupNavigation, renderProjectCard, validateEmailuserProfile, projectList, isMenuOpen, selectedProjectAPI_BASE_URL, MAX_RETRIES, GITHUB_USERNAMEid="home", id="profile-image", id="project-list"src/ directory
blog.html, resume.html, etc.<nav> section from index.html or projects.html<head> section
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/components.css">
<link rel="stylesheet" href="css/animations.css">
<head> section
<script type="module" src="js/main.js"></script>
Add page content in the <main> or appropriate semantic element
components.cssmain.css or create new CSS file (optional)Example: To add a blog page:
# Create the HTML file
cp src/projects.html src/blog.html
# Edit src/blog.html:
# - Change page title and content
# - Keep <nav> section unchanged
# - Navigation will work automatically
src/js/ for your feature
# Example: creating a search feature
touch src/js/search.js
// src/js/search.js
export function initSearch() {
// Set up search UI and event listeners
}
export function searchProjects(query) {
// Search logic here
return results;
}
// src/js/main.js
import { initSearch, searchProjects } from './search.js';
document.addEventListener('DOMContentLoaded', () => {
initSearch();
});
components.css
/* src/css/components.css */
.search-box {
/* styles for search component */
}
.search-results {
/* styles for results display */
}
animations.css if the feature needs motion
/* src/css/animations.css */
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.search-results {
animation: fadeIn 0.3s ease-in;
}
main.css (or keep in component CSS).feature-name, .feature-name-active, .feature-name-iteminitFeatureName(), handleFeatureAction(), getFeatureData()id="feature-name", id="feature-container"feature-name.js, feature-name.cssaddEventListener (not inline onclick)Since this project uses vanilla JavaScript with ES6 modules, you need to serve files over HTTP (not file://).
Using Python (included on most systems):
# Python 3
python -m http.server 8000
# Then visit: http://localhost:8000/src/
Using Node.js:
# If you have Node installed
npx http-server src -p 8000
# Then visit: http://localhost:8000/
This project uses ES6 modules (import and export). This requires:
type="module" in the <script> tag: <script type="module" src="js/main.js"></script>file:// protocol)Version 1 of this portfolio intentionally uses vanilla HTML, CSS, and JavaScript with no build tool (Webpack, Vite, etc.). This keeps the codebase simple and demonstrates frontend fundamentals without framework complexity.
If you want to add a build step in the future, consider:
python -m http.server 8000http://localhost:8000/src/DOM Manipulation:
// Get element
const element = document.getElementById('my-id');
const elements = document.querySelectorAll('.my-class');
// Add class
element.classList.add('active');
// Remove class
element.classList.remove('active');
// Toggle class
element.classList.toggle('visible');
// Listen for events
element.addEventListener('click', () => {
console.log('Clicked!');
});
Fetching Data:
// Fetch data from API
fetch('https://api.example.com/data')
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Modules:
// Export
export const value = 42;
export function myFunction() { }
// Import
import { value, myFunction } from './module.js';
Questions? Review this README or check the code comments in the source files. The portfolio demonstrates clean, professional JavaScript patterns suitable for production codebases.