Files
udo cd1af21ba6 Refactor theme rendering and gauge components
- Consolidated theme rendering logic into helper functions in `lib/theme_helpers.php`.
- Updated `page.html.php` for both dark and light themes to utilize new rendering functions.
- Introduced `arcgauge` component for SVG arc gauges with dynamic updates.
- Enhanced CSS for gauges to improve layout and styling consistency.
- Added new test suite for smoke testing routes and component rendering.
- Updated index and themes views to dynamically display theme information from configuration.
2026-04-18 13:54:33 +00:00

35 lines
1.6 KiB
PHP

<?php
include_css('themes.css');
URL::$route['page-title'] = 'Themes';
$themeOptions = cfg('theme/options');
$currentTheme = (string)cfg('theme/key');
$previewRoute = 'theme-preview';
?>
<div class="theme-gallery-shell">
<section class="theme-gallery-hero card">
<span class="theme-gallery-kicker">Starter Theme Gallery</span>
<h1>Compare Themes Side by Side</h1>
<p>The gallery renders the same preview content in each theme family. This makes it easier to judge shell fit, typography, token balance, and embed behavior before carrying a theme into a downstream app.</p>
</section>
<div class="theme-gallery-grid">
<?php foreach($themeOptions as $themeKey => $themeInfo): ?>
<section class="theme-gallery-card<?= $themeKey === $currentTheme ? ' is-active' : '' ?>">
<div class="theme-gallery-head">
<div>
<h2><?= safe((string)$themeInfo['label']) ?></h2>
<p><?= safe((string)first($themeInfo['description'] ?? false, 'Reusable starter theme family.')) ?></p>
</div>
<?php if($themeKey === $currentTheme): ?><span class="theme-gallery-badge">Active</span><?php endif; ?>
</div>
<div class="theme-gallery-actions">
<a class="btn" href="<?= URL::Link($previewRoute, ['theme' => $themeKey]) ?>">Open Preview</a>
<a class="btn btn-secondary" href="<?= URL::Link('', ['theme' => $themeKey]) ?>">Open Home</a>
</div>
<div class="theme-gallery-frame-wrap">
<iframe title="<?= safe((string)$themeInfo['label']) ?> preview" src="<?= URL::Link($previewRoute, ['theme' => $themeKey, 'embed' => 1]) ?>"></iframe>
</div>
</section>
<?php endforeach; ?>
</div>
</div>