A modern, responsive HTML template with integrated logging, theme switching, and comprehensive layout features.
- Clone or download the template files to your project directory
- Open
index.htmlin any modern web browser - Start customizing the content, styles, and functionality to meet your needs
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)
- 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
- 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
- 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
- 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)
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 */Modify the CSS custom properties in base.css to customize colors:
:root {
--bg: #your-color;
--text: #your-color;
/* ... other properties */
}- Layout: Side-by-side sidebar (35%) and main content (65%)
- Navigation: Horizontal menu in header
- Optimized for: Mouse interaction and larger screens
- Layout: Stacked - Header β Main β Sidebar β Footer
- Navigation: Centered buttons with touch-friendly sizing
- Sidebar: Limited height with scrolling
- Optimized for: Touch interaction
- Compact spacing and smaller font sizes
- Simplified navigation with reduced padding
- Full-width modal dialogs
// 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 })- 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
const logger = new SimpleLogger({
appName: "HTMLTemplate",
level: "HIGH",
compactMode: true,
showProcessId: false,
enableFileLogging: false // Browser environment
});- NONE: No logging output
- LOW: Error messages only
- MED: Errors + warnings
- HIGH: Errors + warnings + info + debug
- DEV: All messages including development logs
// 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
});- Add navigation button in header:
<a href="#" class="nav-btn" data-page="newpage">New Page</a>- 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>- No additional JavaScript needed - the existing navigation system handles new pages automatically.
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 */
}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;
}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 });
}
}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
- Use browser dev tools to inspect CSS Grid layout
- Check console output for logged events and errors
- Test responsive behavior using device emulation
- Verify theme switching in both light and dark modes
- Test modal functionality with keyboard navigation (Tab/Escape)
- 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
- 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
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">- 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
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>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 });
}This template is designed to be easily customizable:
- Modify colors by updating CSS custom properties
- Add new sections using the existing card component pattern
- Integrate APIs using the built-in logging system for debugging
- Extend functionality with additional JavaScript modules
- 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
| 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+ |
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.