Skip to main content

Get Started in 3 Steps

The Klef Sonatta Website is a static site that requires no build process. You can have it running locally in minutes.
1

Clone the Repository

Clone the project from GitHub to your local machine:
git clone https://github.com/klefagency/klef-sonatta-website.git
cd klef-sonatta-website
The repository includes all assets, components, and documentation you need to get started.
2

Open in Browser

For basic viewing, simply open index.html in any modern web browser:
# On macOS
open index.html

# On Linux
xdg-open index.html

# On Windows
start index.html
Some features like search and portfolio loading may require a local server due to CORS restrictions.
3

Run a Local Server (Recommended)

For the best development experience, use a local server:
# Using Python 3
python -m http.server 8000

# Using Python 2
python -m SimpleHTTPServer 8000

# Using Node.js (if you have http-server installed)
npx http-server -p 8000

# Using PHP
php -S localhost:8000
Then open your browser to:
http://localhost:8000

Project Structure Explained

Understanding the project structure will help you navigate and customize the site effectively:

Root Level Files

klef-sonatta-website/
├── index.html              # Main entry point - the complete homepage
├── favicon.ico             # Site favicon
├── README.md               # Project overview and instructions
└── test-load-basics.html   # Testing file for component loading
The index.html file contains the entire homepage structure. All interactivity and styling are loaded from separate component files.

Assets Directory

The /assets folder contains all static resources:
assets/fonts/
├── Inter/              # Inter variable font family
│   ├── Inter-Variable.ttf
│   └── README.txt
└── Google_Sans/        # Google Sans font family
    ├── GoogleSans-Regular.ttf
    ├── GoogleSans-Bold.ttf
    └── README.txt
Both fonts are hosted locally for optimal performance and privacy.
assets/images/
├── favicons/           # Various favicon sizes
│   ├── favicon-32x32.png
│   ├── favicon-192x192.png
│   └── favicon-180x180.png
└── portfolio/          # Portfolio project images
    └── [project-images]
assets/scripts/
├── mega-menu-spa.js    # SPA navigation and mega menu logic
├── clean-urls.js       # URL management
└── scroll-lock.js      # Scroll behavior control
Example from mega-menu-spa.js:
// Initialize SPA routing
document.addEventListener('DOMContentLoaded', () => {
  initRouter();
  handleNavigationLinks();
});
assets/styles/
├── design-system.css   # CSS variables and global styles
├── mega-menu-spa.css   # Navigation styles
└── css-short.css       # Utility classes
The design system uses CSS custom properties:
:root {
  --k-blue: #0066cc;
  --k-purple: #6e6eff;
  --k-max: 1000px;
  --k-gap: 40px;
}

Shared Components

The /shared/components directory contains modular, reusable components:
shared/components/
├── mega-menu/
│   ├── mega-menu.js        # Desktop navigation logic
│   └── mega-menu.css       # Navigation styles
├── search/
│   ├── search-system.js    # Search functionality
│   ├── filter-config.js    # Filter configuration
│   ├── query-parser.js     # Search query parsing
│   └── match.js            # Result matching logic
├── portfolio/
│   ├── portfolio-grid.js   # Grid layout and rendering
│   ├── portfolio-loader.js # Data fetching
│   ├── cover-hydrator.js   # Image loading optimization
│   └── tabs-navigation.js  # Portfolio filtering tabs
├── adaptive-sheet/
│   └── adaptive-sheet.js   # Bottom sheet (mobile) / side panel (desktop)
├── dynamic-island/
│   ├── dynamic-island.js   # Notification system
│   └── dynamic-island.css  # Island styles
└── hero/
    └── hero-animation.js   # Hero section animations
Each component is self-contained with its own JavaScript and CSS. This modular approach makes it easy to customize or replace individual components.

Using the Components

Example: Search System

The search system provides real-time results across all content:
// From search-system.js
class SearchSystem {
  constructor() {
    this.initializeSearch();
    this.bindEvents();
  }
  
  async search(query) {
    const results = await this.filterContent(query);
    this.displayResults(results);
  }
}
To customize search behavior, edit /shared/components/search/filter-config.js:
// Configure which fields to search
export const searchConfig = {
  fields: ['title', 'excerpt', 'content'],
  minLength: 3,
  maxResults: 20
};

Example: Portfolio Grid

The portfolio uses a masonry layout with lazy loading:
// From portfolio-grid.js
function renderPortfolioGrid(items) {
  const grid = document.querySelector('.masonry-grid');
  
  items.forEach(item => {
    const card = createPortfolioCard(item);
    grid.appendChild(card);
  });
  
  // Initialize lazy loading
  observeImages();
}

Example: Mega Menu

The mega menu adapts between desktop and mobile:
// From mega-menu.js
class MegaMenu {
  constructor() {
    this.isMobile = window.innerWidth < 768;
    this.init();
  }
  
  init() {
    if (this.isMobile) {
      this.initMobileMenu();
    } else {
      this.initDesktopMenu();
    }
  }
}
The site includes several navigation patterns:

Mega Menu

Primary navigation with expandable sections for Services, Portfolio, About, and Contact

Global Search

Accessible via the search icon in the top-right corner, provides instant results

Mobile Menu

Hamburger menu that transforms into a full-screen navigation experience

Portfolio Tabs

Filter portfolio items by category (Branding, Strategy, Studio, Dev)

Key Features to Explore

Hero Section

The homepage hero uses a 50/50 split layout:
  • Left Panel: Value proposition with rotating text animation
  • Right Panel: Masonry grid of portfolio previews
<!-- From index.html -->
<div class="hero-container">
  <div class="half-left">
    <h1 class="hero-title">
      <span class="word">
        <span class="letter">T</span>
        <span class="letter">r</span>
        <span class="letter">a</span>
        <!-- ... -->
      </span>
    </h1>
  </div>
  <div class="half-right">
    <div class="masonry-grid">
      <!-- Portfolio items -->
    </div>
  </div>
</div>
The brand carousel uses pure CSS for infinite scrolling:
/* From index.html styles */
.carouselTrack {
  animation: infiniteLoop 40s linear infinite;
}

@keyframes infiniteLoop {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}
The carousel runs on the GPU using translate3d, ensuring smooth 60fps animation without JavaScript overhead.

Process Section

The “How We Work” section demonstrates the CSS variable system:
:root {
  --k-step-w: 21rem;   /* Step width */
  --k-num-size: 4rem;  /* Number indicator size */
  --k-gap: 40px;       /* Gap between steps */
}

.k-steps {
  display: flex;
  gap: var(--k-gap);
}

.k-step {
  width: var(--k-step-w);
}

Customization Quick Tips

1

Change Colors

Edit CSS variables in the root or in assets/styles/design-system.css:
:root {
  --k-blue: #0066cc;      /* Primary blue */
  --k-purple: #6e6eff;    /* Accent purple */
  --brands: rgba(245, 124, 0, 0.9);    /* Branding color */
  --strategy: rgba(25, 118, 210, 0.9); /* Strategy color */
}
2

Update Content

Modify the HTML directly in index.html for text, images, and layout changes:
<h1>Your New Title</h1>
<p>Your updated description</p>
3

Add Portfolio Items

Add new images to assets/images/portfolio/ and update the portfolio data in the appropriate JavaScript file.
4

Customize Components

Each component in /shared/components/ can be modified independently. Edit the JavaScript for behavior changes and CSS for styling.

Development Workflow

Making Changes

  1. Edit files in your preferred code editor
  2. Refresh browser to see changes (no build step needed)
  3. Test responsiveness using browser DevTools

Testing on Different Devices

# Start server on all network interfaces
python -m http.server 8000 --bind 0.0.0.0

# Access from mobile device on same network
# http://[your-computer-ip]:8000

Version Control Best Practices

# Create a feature branch
git checkout -b feature/new-component

# Make your changes
# ...

# Commit with descriptive messages
git add .
git commit -m "Add new portfolio filtering feature"

# Push to remote
git push origin feature/new-component

Performance Tips

Image Optimization

Use WebP format for images and include fallbacks. The site supports lazy loading automatically.

CSS Variables

Leverage CSS custom properties for theming instead of duplicating styles.

Component Loading

Components load asynchronously. Keep the critical path minimal.

Minimize Dependencies

The site uses zero npm dependencies. Keep it that way for maximum performance.

Common Issues & Solutions

Problem: Search functionality doesn’t return results.Solution: Ensure you’re running a local server (not just opening the HTML file). CORS restrictions prevent some features from working with file:// protocol.
python -m http.server 8000
Problem: Portfolio images show broken image icons.Solution: Check that image paths are correct and images exist in assets/images/. Use relative paths from the root.
<!-- Correct -->
<img src="./assets/images/portfolio/project.jpg" />

<!-- Incorrect -->
<img src="/images/project.jpg" />
Problem: Custom CSS changes aren’t visible.Solution: Clear browser cache or do a hard refresh (Ctrl+Shift+R or Cmd+Shift+R). Check browser console for CSS file loading errors.
Problem: Hamburger menu doesn’t open on mobile.Solution: Verify that JavaScript files are loading correctly. Check the browser console for errors. Ensure mega-menu.js is loaded.

Next Steps

Explore Components

Deep dive into each modular component and learn how to customize them

Design System

Master the CSS variable system and responsive design patterns

Deployment Guide

Learn how to deploy to GitHub Pages, Netlify, or other platforms

Development Setup

Learn about local development setup and project structure

Getting Help

If you encounter issues or have questions:
  • Documentation: Explore the /docs folder in the repository
  • Contact: Reach out to [email protected]
  • GitHub Issues: Report bugs or request features on the repository
  • Website: Visit klef.agency for more information
The Klef Sonatta Website is designed to be simple yet powerful. The lack of build tools and dependencies means you can start customizing immediately without learning complex toolchains.

Build docs developers (and LLMs) love