The left is not complete.
- User
The left is not complete.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
The left is not complete.
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
You're right! Let me fix the sidebar implementation. Here's the corrected HTML file with a properly functioning sidebar:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Healthy Life Guide</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
line-height: 1.6;
color: #333;
background: #fff;
}
/* Burger Menu */
.burger-btn {
display: none;
position: fixed;
top: 1rem;
left: 1rem;
z-index: 1001;
background: #2c3e50;
color: white;
border: none;
padding: 0.5rem 0.75rem;
border-radius: 4px;
cursor: pointer;
font-size: 1.2rem;
}
.burger-btn:hover {
background: #34495e;
}
/* Sidebar (TOC) */
.sidebar {
position: fixed;
top: 0;
left: 0;
width: 300px;
height: 100vh;
background: #f8f9fa;
padding: 1.5rem;
border-right: 1px solid #e9ecef;
overflow-y: auto;
transition: transform 0.3s ease;
z-index: 1000;
}
.sidebar.hidden {
transform: translateX(-100%);
}
.sidebar-header {
margin-bottom: 1.5rem;
padding-bottom: 1rem;
border-bottom: 2px solid #e9ecef;
}
.sidebar-title {
font-size: 1.25rem;
font-weight: 600;
color: #2c3e50;
margin-bottom: 1rem;
}
.toc-controls {
display: flex;
gap: 0.5rem;
}
.toc-btn {
flex: 1;
padding: 0.5rem 0.75rem;
background: #2c3e50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 0.875rem;
transition: background 0.2s ease;
}
.toc-btn:hover {
background: #34495e;
}
.toc-list {
list-style: none;
}
.toc-item {
margin: 0.25rem 0;
}
.toc-item.level-1 > .toc-link {
font-weight: 600;
font-size: 1rem;
}
.toc-item.level-2 > .toc-link {
padding-left: 2rem;
font-size: 0.95rem;
}
.toc-item.level-3 > .toc-link {
padding-left: 3rem;
font-size: 0.9rem;
}
.toc-link {
display: flex;
align-items: center;
padding: 0.5rem 1rem;
border-radius: 4px;
cursor: pointer;
text-decoration: none;
color: #2c3e50;
transition: all 0.2s ease;
}
.toc-link:hover {
background: #e9ecef;
}
.toc-link.active {
background: #2c3e50;
color: white;
}
.toggle-btn {
margin-right: 0.5rem;
background: transparent;
border: 1px solid #6c757d;
width: 1.25rem;
height: 1.25rem;
border-radius: 2px;
cursor: pointer;
font-size: 0.75rem;
color: #6c757d;
display: inline-flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.toc-link.active .toggle-btn {
border-color: white;
color: white;
}
.sub-toc {
list-style: none;
max-height: 0;
overflow: hidden;
transition: max-height 0.3s ease;
}
.sub-toc.open {
max-height: 1000px;
}
/* Main Content */
.main-content {
margin-left: 300px;
padding: 2rem 3rem;
transition: margin-left 0.3s ease;
min-height: 100vh;
}
.main-content.full-width {
margin-left: 0;
}
.content-section {
display: none;
max-width: 800px;
margin: 0 auto;
animation: fadeIn 0.3s ease;
}
.content-section.active {
display: block;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
/* Typography */
h1 {
font-size: 2.5rem;
margin-bottom: 1.5rem;
color: #2c3e50;
border-bottom: 3px solid #e9ecef;
padding-bottom: 1rem;
}
h2 {
font-size: 2rem;
margin: 2rem 0 1rem;
color: #34495e;
}
h3 {
font-size: 1.5rem;
margin: 1.5rem 0 0.75rem;
color: #495057;
}
p {
margin-bottom: 1rem;
font-size: 1.1rem;
color: #555;
line-height: 1.8;
}
ul {
margin: 1rem 0 1rem 2rem;
}
li {
margin-bottom: 0.5rem;
color: #555;
}
/* Responsive Design */
@media (max-width: 768px) {
.burger-btn {
display: block;
}
.sidebar {
transform: translateX(-100%);
}
.sidebar.active {
transform: translateX(0);
}
.main-content {
margin-left: 0;
padding: 4rem 1.5rem 2rem;
}
h1 {
font-size: 2rem;
}
h2 {
font-size: 1.5rem;
}
h3 {
font-size: 1.25rem;
}
p {
font-size: 1rem;
}
}
</style>
</head>
<body>
<button class="burger-btn" id="burgerBtn">☰</button>
<div class="sidebar" id="sidebar">
<div class="sidebar-header">
<h2 class="sidebar-title">Table of Contents</h2>
<div class="toc-controls">
<button class="toc-btn" id="openAll">Open All</button>
<button class="toc-btn" id="collapseAll">Collapse All</button>
</div>
</div>
<ul class="toc-list" id="toc"></ul>
</div>
<main class="main-content" id="mainContent">
<div class="content-section active" id="intro">
<h1>The Complete Guide to a Healthy, Productive & Meaningful Life</h1>
<p>Welcome to your comprehensive guide for building a life that balances health, productivity, and meaning. This book is structured to help you develop sustainable habits and practices that will transform your daily experience.</p>
<p>Navigate through the chapters using the table of contents on the left. Each section builds upon the previous one, creating a holistic approach to personal development.</p>
<p>Remember, lasting change comes from consistent small actions rather than dramatic overhauls. Take your time with each section and implement the practices that resonate most with your current life situation.</p>
</div>
</main>
<script>
// Book content data
const bookSections = [
{
id: 'foundations',
title: '1. Core Foundations of a Healthy Life',
level: 1,
content: `
<p>The foundation of any meaningful life starts with intentional choices in three key areas: physical health, mental clarity, and emotional balance. These elements are deeply interconnected—when one suffers, the others are affected.</p>
<p>In this chapter, we'll explore how to build a solid foundation by understanding these connections and implementing practical strategies that support all three areas simultaneously.</p>
<p>The journey to a healthier life isn't about perfection; it's about progress. Small, consistent improvements in your daily habits can lead to transformative results over time.</p>
`
},
{
id: 'nutrition',
title: '1.1 Nutrition for Sustained Energy',
level: 2,
parent: 'foundations',
content: `
<p>Proper nutrition is the cornerstone of physical health and mental clarity. What you eat directly impacts your energy levels, mood, and cognitive function throughout the day.</p>
<h3>Key Nutritional Principles</h3>
<p>Focus on whole, unprocessed foods that provide balanced macronutrients. Your plate should include:</p>
<ul>
<li>Lean proteins (25-30% of your plate): chicken, fish, legumes, tofu</li>
<li>Complex carbohydrates (40-45%): whole grains, sweet potatoes, quinoa</li>
<li>Healthy fats (25-30%): avocados, nuts, olive oil, fatty fish</li>
</ul>
<h3>Meal Timing and Energy Management</h3>
<p>Eat balanced meals every 3-4 hours to maintain stable blood sugar levels. This prevents energy crashes and supports consistent mental performance throughout the day.</p>
<p>Start your day with a protein-rich breakfast within an hour of waking. This sets your metabolic tone for the entire day and helps regulate hunger hormones.</p>
`
},
{
id: 'hydration',
title: '1.1.1 The Power of Proper Hydration',
level: 3,
parent: 'nutrition',
content: `
<p>Water is essential for every cellular process in your body. Even mild dehydration can impair cognitive function, mood, and physical performance.</p>
<p>Aim for at least 8-10 cups of water daily, more if you're active or in hot climates. Start your morning with a large glass of water to rehydrate after the night's fast.</p>
<p>Pro tip: Keep a water bottle visible throughout the day as a visual reminder to drink regularly.</p>
`
},
{
id: 'movement',
title: '1.2 Movement as Medicine',
level: 2,
parent: 'foundations',
content: `
<p>Regular physical activity is one of the most powerful tools for improving both physical and mental health. Exercise releases endorphins, reduces stress hormones, and promotes better sleep.</p>
<h3>Creating a Sustainable Exercise Routine</h3>
<p>The best exercise program is one you'll actually stick to. Start with activities you enjoy and gradually build intensity and duration.</p>
<h3>The Three Pillars of Fitness</h3>
<ul>
<li><strong>Cardiovascular Exercise:</strong> 150 minutes of moderate activity per week (brisk walking, cycling, swimming)</li>
<li><strong>Strength Training:</strong> 2-3 sessions per week targeting all major muscle groups</li>
<li><strong>Flexibility and Mobility:</strong> Daily stretching or yoga to maintain range of motion</li>
</ul>
<p>Remember: Any movement is better than no movement. Start where you are and build gradually.</p>
`
},
{
id: 'sleep',
title: '1.3 Sleep: The Foundation of Recovery',
level: 2,
parent: 'foundations',
content: `
<p>Quality sleep is non-negotiable for optimal health. During sleep, your body repairs tissues, consolidates memories, and regulates hormones that control hunger, stress, and growth.</p>
<h3>Sleep Hygiene Essentials</h3>
<ul>
<li>Maintain a consistent sleep schedule, even on weekends</li>
<li>Create a cool, dark, quiet sleeping environment</li>
<li>Avoid screens for 1-2 hours before bedtime</li>
<li>Limit caffeine after 2 PM</li>
<li>Develop a relaxing bedtime routine</li>
</ul>
<p>Aim for 7-9 hours of quality sleep per night. If you struggle with sleep, consider keeping a sleep diary to identify patterns and triggers.</p>
`
},
{
id: 'productivity',
title: '2. Productivity Without Burnout',
level: 1,
content: `
<p>True productivity isn't about doing more—it's about doing what matters most. In our hyperconnected world, the ability to focus deeply and work intentionally has become a superpower.</p>
<p>This chapter will teach you how to maximize your output while maintaining your well-being. You'll learn to work with your natural energy rhythms, eliminate time-wasters, and create systems that support sustained high performance.</p>
<p>Remember: Productivity is a means to an end, not the end itself. The goal is to create more time and energy for what truly matters in your life.</p>
`
},
{
id: 'focus',
title: '2.1 Mastering Deep Work',
level: 2,
parent: 'productivity',
content: `
<p>Deep work—the ability to focus without distraction on cognitively demanding tasks—is increasingly rare and increasingly valuable. In an economy that rewards complex problem-solving and creative thinking, deep work is your competitive advantage.</p>
<h3>Creating the Conditions for Deep Work</h3>
<ul>
<li><strong>Time Blocking:</strong> Schedule 90-minute blocks for focused work</li>
<li><strong>Environment Design:</strong> Create a dedicated workspace free from distractions</li>
<li><strong>Digital Minimalism:</strong> Turn off all notifications during deep work sessions</li>
<li><strong>Energy Management:</strong> Schedule deep work during your peak energy hours</li>
</ul>
<h3>The Deep Work Protocol</h3>
<p>1. Define a clear objective for each session<br>
2. Eliminate all distractions (phone in another room, browser blockers active)<br>
3. Set a timer for 90 minutes<br>
4. Work with full intensity until the timer rings<br>
5. Take a 15-20 minute break to recharge</p>
`
},
{
id: 'systems',
title: '2.2 Building Productivity Systems',
level: 2,
parent: 'productivity',
content: `
<p>