Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 7 additions & 53 deletions gcovr-templates/html/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,13 @@
<script>
// Apply theme and font size immediately to prevent flash
(function() {
document.documentElement.classList.add('no-transitions');

var saved = localStorage.getItem('gcovr-theme');
var theme = (saved === 'light' || saved === 'dark') ? saved
: window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
document.documentElement.setAttribute('data-theme', theme);

// Apply saved font size
var fontSize = localStorage.getItem('gcovr-font-size');
if (fontSize) {
var baseSize = 15 * (parseInt(fontSize, 10) / 100);
document.documentElement.style.setProperty('--font-size-base', baseSize + 'px');
}
})();
</script>
<style type="text/css">
Expand All @@ -46,11 +42,11 @@
</div>
<div class="sidebar-title-group">
<span class="sidebar-library">{{info.head}}</span>
<span class="sidebar-subtitle">GCC Code Coverage</span>
</div>
</div>
<div class="sidebar-search">
<input type="text" id="file-search" placeholder="Search files..." autocomplete="off">
<button class="search-clear" id="search-clear" type="button" aria-label="Clear search">&times;</button>
</div>
<div class="tree-controls">
<button class="tree-control-btn" id="expand-all" title="Expand all">
Expand All @@ -67,52 +63,6 @@
<div class="tree-loading">Loading file tree...</div>
{% endblock %}
</nav>
<div class="sidebar-footer no-expand">
<div class="font-size-control" id="font-size-control" title="Adjust text size">
<button class="font-size-a font-size-small" id="font-decrease" title="Decrease text size">A</button>
<div class="font-size-slider-container">
<div class="font-size-ticks">
<span class="tick"></span>
<span class="tick"></span>
<span class="tick middle"></span>
<span class="tick"></span>
<span class="tick"></span>
</div>
<input type="range" id="font-size-slider" min="0" max="4" value="2" step="1" class="font-size-slider">
</div>
<button class="font-size-a font-size-large" id="font-increase" title="Increase text size">A</button>
</div>
<div class="font-size-selector" id="font-size-selector">
<button class="font-size-toggle" id="font-size-toggle" title="Adjust text size">A</button>
<div class="font-size-menu" id="font-size-menu">
<button class="font-size-option" data-size="0">
<span class="size-label">80%</span>
<svg class="check" viewBox="0 0 16 16" fill="currentColor"><path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"/></svg>
</button>
<button class="font-size-option" data-size="1">
<span class="size-label">90%</span>
<svg class="check" viewBox="0 0 16 16" fill="currentColor"><path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"/></svg>
</button>
<button class="font-size-option" data-size="2">
<span class="size-label">100%</span>
<svg class="check" viewBox="0 0 16 16" fill="currentColor"><path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"/></svg>
</button>
<button class="font-size-option" data-size="3">
<span class="size-label">110%</span>
<svg class="check" viewBox="0 0 16 16" fill="currentColor"><path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"/></svg>
</button>
<button class="font-size-option" data-size="4">
<span class="size-label">120%</span>
<svg class="check" viewBox="0 0 16 16" fill="currentColor"><path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"/></svg>
</button>
</div>
</div>
<button class="theme-toggle" id="theme-toggle" title="Toggle theme">
<svg class="icon-moon" viewBox="0 0 16 16" fill="currentColor"><path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z"/></svg>
<svg class="icon-sun" viewBox="0 0 16 16" fill="currentColor"><path d="M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"/></svg>
<span class="theme-label">Theme</span>
</button>
</div>
<div class="sidebar-resize-handle" id="sidebar-resize-handle"></div>
</aside>

Expand All @@ -131,6 +81,10 @@
<div class="header-actions">
{% block navigation %}{% endblock %}
</div>
<button class="theme-toggle" id="theme-toggle" title="Toggle theme">
<svg class="icon-moon" viewBox="0 0 16 16" fill="currentColor"><path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z"/></svg>
<svg class="icon-sun" viewBox="0 0 16 16" fill="currentColor"><path d="M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"/></svg>
</button>
</header>

<div class="content-wrapper">
Expand Down
Loading