Skip to content

QueM775/HTML-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

HTML Template Documentation

A modern, responsive HTML template with integrated logging, theme switching, and comprehensive layout features.

πŸš€ Quick Start

  1. Clone or download the template files to your project directory
  2. Open index.html in any modern web browser
  3. Start customizing the content, styles, and functionality to meet your needs

πŸ“ Project Structure

HTML-template/
β”œβ”€β”€ index.html              # Main template file
β”œβ”€β”€ base.css               # Complete stylesheet with themes
β”œβ”€β”€ simple-logger.js       # Integrated logging system
β”œβ”€β”€ logger-readme.md       # Logger documentation
β”œβ”€β”€ HTML-Template.md       # This documentation file
└── logs/                  # Auto-created for Node.js logging (browser: console only)

✨ Features

🎨 Layout & Design

  • CSS Grid Layout: Responsive 35%/65% sidebar/main split
  • Sticky Header & Footer: Always visible navigation and status bar
  • Theme System: Light/dark mode with smooth transitions
  • Mobile Responsive: Adapts to all screen sizes with breakpoints
  • Modern UI: Clean, professional design with hover effects

🧭 Navigation

  • Horizontal Menu: Clean navigation with active state indicators
  • Page System: Multi-page SPA with smooth transitions
  • Sidebar Navigation: Quick links and feature overview
  • Smooth Scrolling: Animated scroll to sections

βš™οΈ Interactive Elements

  • Modal Settings: Configurable preferences dialog
  • Theme Toggle: One-click light/dark mode switching
  • Progress Bar: User feedback system with smooth animations
  • Responsive Controls: Touch-friendly on mobile devices

πŸ“ Logging Integration

  • Simple-Logger.js: Professional logging with multiple levels
  • Browser Optimized: Console-only logging for web applications
  • Structured Data: JSON-formatted log entries with timestamps
  • Level Control: Configurable logging verbosity (NONE/LOW/MED/HIGH/DEV)

🎨 Theme System

Color Scheme

Light Theme:

--bg: #cfbca5;           /* Main background */
--text: #3a3e3f;         /* Primary text */
--header-bg: #cdc0b0;    /* Header background */
--nav-bg: #e7dbcd;       /* Navigation elements */
--footer-bg: #cdb79e;    /* Footer background */
--card-bg: #e7dbcd;      /* Content cards */
--link-color: #000;      /* Link text */

Dark Theme:

--bg: #567189;           /* Main background */
--text: #eee9da;         /* Primary text */
--header-bg: #7b8fa1;    /* Header background */
--nav-bg: #526d82;       /* Navigation elements */
--footer-bg: #58606a;    /* Footer background */
--card-bg: #749bc2;      /* Content cards */
--link-color: #fad6a5;   /* Link text */

Theme Customization

Modify the CSS custom properties in base.css to customize colors:

:root {
    --bg: #your-color;
    --text: #your-color;
    /* ... other properties */
}

πŸ“± Responsive Breakpoints

Desktop (Default)

  • Layout: Side-by-side sidebar (35%) and main content (65%)
  • Navigation: Horizontal menu in header
  • Optimized for: Mouse interaction and larger screens

Tablet/Mobile (≀768px)

  • Layout: Stacked - Header β†’ Main β†’ Sidebar β†’ Footer
  • Navigation: Centered buttons with touch-friendly sizing
  • Sidebar: Limited height with scrolling
  • Optimized for: Touch interaction

Mobile Small (≀480px)

  • Compact spacing and smaller font sizes
  • Simplified navigation with reduced padding
  • Full-width modal dialogs

πŸ”§ JavaScript Features

Core Functionality

// Theme switching
function toggleTheme()

// Navigation between pages
function showPage(pageId)

// Progress bar control
function setProgress(percent)
function simulateProgress()

// Logging integration
logger.info("message", { data })
logger.error("error", { context })

Event Handlers

  • Theme Toggle: Light/dark mode switching
  • Navigation: Page switching with active states
  • Modal Control: Settings dialog open/close
  • Progress Simulation: Smooth progress bar animation
  • Responsive Resize: Window size change logging
  • Smooth Scrolling: Anchor link navigation

πŸ“Š Logging System

Configuration

const logger = new SimpleLogger({
    appName: "HTMLTemplate",
    level: "HIGH",
    compactMode: true,
    showProcessId: false,
    enableFileLogging: false  // Browser environment
});

Log Levels

  • NONE: No logging output
  • LOW: Error messages only
  • MED: Errors + warnings
  • HIGH: Errors + warnings + info + debug
  • DEV: All messages including development logs

Usage Examples

// Error logging
logger.error("API request failed", {
    endpoint: "/api/users",
    status: 404
});

// User action logging
logger.info("Page navigation", {
    pageId: "about"
});

// Debug information
logger.debug("Window resized", {
    width: 1920,
    height: 1080
});

πŸ› οΈ Customization Guide

Adding New Pages

  1. Add navigation button in header:
<a href="#" class="nav-btn" data-page="newpage">New Page</a>
  1. Create page content in main area:
<div id="newpagePage" class="page-content" style="display: none;">
    <h1>New Page</h1>
    <p>Your content here...</p>
</div>
  1. No additional JavaScript needed - the existing navigation system handles new pages automatically.

Modifying Layout Proportions

Change the CSS Grid template in base.css:

.app-container {
    grid-template-columns: 30% 70%;  /* 30%/70% split */
    /* or */
    grid-template-columns: 300px 1fr; /* Fixed sidebar width */
}

Adding Custom Styles

Add new CSS rules after the existing styles in base.css:

/* Custom component styles */
.my-component {
    background: var(--card-bg);
    border: 1px solid var(--text);
    padding: 1rem;
    border-radius: 8px;
}

Integrating with Backend

The template is ready for backend integration:

// Example API integration
async function loadData() {
    try {
        logger.info("Loading data from API");
        const response = await fetch('/api/data');
        const data = await response.json();
        logger.info("Data loaded successfully", { recordCount: data.length });
        // Update UI with data
    } catch (error) {
        logger.error("Failed to load data", { error: error.message });
    }
}

πŸ§ͺ Testing & Development

Browser Testing

Recommended browsers:

  • Chrome 90+
  • Firefox 88+
  • Safari 14+
  • Edge 90+

Features tested:

  • CSS Grid layout support
  • CSS Custom Properties
  • Responsive design behavior
  • Modal functionality
  • Theme switching
  • Logging output

Development Tips

  1. Use browser dev tools to inspect CSS Grid layout
  2. Check console output for logged events and errors
  3. Test responsive behavior using device emulation
  4. Verify theme switching in both light and dark modes
  5. Test modal functionality with keyboard navigation (Tab/Escape)

Performance Considerations

  • CSS transitions: Optimized for 60fps animations
  • JavaScript events: Debounced resize handlers prevent excessive logging
  • DOM updates: Efficient page switching without DOM manipulation
  • Memory management: Proper cleanup of intervals and event listeners

πŸ”’ Accessibility Features

Built-in Accessibility

  • Semantic HTML: Proper use of header, nav, main, aside, footer
  • Keyboard Navigation: Tab-accessible controls and modal
  • Screen Reader Support: Descriptive labels and ARIA attributes
  • Color Contrast: High contrast ratios in both themes
  • Focus Indicators: Visible focus states for interactive elements

ARIA Labels

The template includes appropriate ARIA attributes:

<button class="theme-toggle" title="Toggle theme" aria-label="Switch between light and dark themes">
<div class="modal" role="dialog" aria-modal="true">

πŸš€ Production Deployment

Optimization Checklist

  • Minify CSS and JavaScript files
  • Compress images and optimize assets
  • Set up proper caching headers
  • Configure HTTPS for secure connections
  • Test cross-browser compatibility
  • Validate HTML and CSS markup
  • Test accessibility with screen readers

Server Configuration

The template works with any web server. For optimal performance:

# .htaccess example
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 month"
</IfModule>

πŸ“ˆ Analytics Integration

Add analytics tracking to the existing logger system:

// Google Analytics example
function trackPageView(pageId) {
    gtag('config', 'GA_TRACKING_ID', {
        page_title: pageId,
        page_location: window.location.href
    });
    logger.info("Analytics: Page view tracked", { pageId });
}

🀝 Contributing & Support

Customization Support

This template is designed to be easily customizable:

  1. Modify colors by updating CSS custom properties
  2. Add new sections using the existing card component pattern
  3. Integrate APIs using the built-in logging system for debugging
  4. Extend functionality with additional JavaScript modules

Best Practices

  • Keep logging informative but not excessive
  • Use semantic HTML for accessibility
  • Test responsive behavior on real devices
  • Maintain color contrast ratios when customizing themes
  • Follow the existing code patterns for consistency

πŸ“‹ Browser Support Matrix

Feature Chrome Firefox Safari Edge
CSS Grid βœ… 57+ βœ… 52+ βœ… 10.1+ βœ… 16+
Custom Properties βœ… 49+ βœ… 31+ βœ… 9.1+ βœ… 15+
ES6 Features βœ… 51+ βœ… 54+ βœ… 10+ βœ… 14+
Flexbox βœ… 29+ βœ… 28+ βœ… 9+ βœ… 11+

πŸ“„ License & Credits

Template: Custom HTML/CSS/JavaScript template Logger: Simple-logger.js integration Icons: Unicode emoji characters (universal support) Fonts: System fonts for optimal performance


Version: 1.0 Author: Erich Quade Updated: 2025

For questions or support, refer to the code comments or create an issue in the project repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published