UNPKG

lightview

Version:

A reactive UI library with features of Bau, Juris, and HTMX plus safe LLM UI generation

301 lines (280 loc) 14.7 kB
<!-- SEO-friendly SPA Shim --> <script src="/lightview-router.js"></script> <script> if (globalThis.LightviewRouter) { LightviewRouter.base('/index.html'); } </script> <!-- Load the page-specific stylesheet --> <link rel="stylesheet" href="./index.css"> <!-- Gallery Structure --> <div class="gallery-page"> <div class="gallery-layout"> <!-- Sidebar Overlay --> <div id="sidebar-overlay" class="sidebar-overlay"></div> <!-- Sidebar --> <div id="gallery-sidebar" class="gallery-sidebar" style="visibility: hidden" src="./component-nav.html"></div> <!-- Main Content --> <div id="gallery-main" class="gallery-main"> <!-- Header Container --> <div style="position: sticky; top: 0; z-index: 30; background: var(--gallery-surface); border-bottom: 1px solid var(--gallery-border); backdrop-filter: blur(8px);"> <!-- Breadcrumbs Row --> <div style="padding: 0.75rem 1.5rem 0;"> <script> (() => { const { Breadcrumbs } = Lightview.tags; const breadcrumbs = Breadcrumbs({ id: 'page-breadcrumbs', items: [ { label: 'Components', href: '/docs/components' }, { label: 'Footer' } ] }); document.currentScript.replaceWith(breadcrumbs.domEl); })(); </script> </div> <!-- Title Row --> <div class="gallery-header" style="border-bottom: none; height: auto; padding-top: 0.5rem; padding-bottom: 0.75rem;"> <button id="toggle-btn" class="toggle-btn" aria-label="Toggle Sidebar"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="toggle-icon" style="stroke: currentColor; stroke-width: 2;"> <path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7" /> <path stroke-linecap="round" stroke-linejoin="round" d="M11 19l-7-7 7-7" /> </svg> </button> <h1 class="gallery-title">Footer</h1> </div> </div> <!-- Content --> <div class="gallery-content"> <div class="section-content" style="max-width: 1000px;"> <p class="text-lg" style="opacity: 0.7; margin-bottom: 1.5rem;"> Footer can contain logo, links, and copyright notice. Supports multiple column layouts. </p> <!-- Basic Example with Examplify --> <div class="card bg-base-200" style="margin-bottom: 2rem;"> <div class="card-body"> <h2 class="card-title">Basic Example</h2> <p class="text-sm" style="opacity: 0.7; margin-bottom: 1rem;">Multi-column footer with links </p> <!-- Tabs --> <script> globalThis.switchSyntaxTab = (tabId) => { const tabs = ['tagged', 'vdom', 'object']; tabs.forEach(t => { const tabEl = document.getElementById(`tab-btn-${t}`); const contentEl = document.getElementById(`syntax-${t}`); if (t === tabId) { tabEl.classList.add('syntax-tab-active'); contentEl.style.display = 'block'; } else { tabEl.classList.remove('syntax-tab-active'); contentEl.style.display = 'none'; } }); }; </script> <div role="tablist" class="syntax-tabs" style="margin-bottom: 1rem;"> <button id="tab-btn-tagged" role="tab" class="syntax-tab syntax-tab-active" onclick="switchSyntaxTab('tagged')">Tagged</button> <button id="tab-btn-vdom" role="tab" class="syntax-tab" onclick="switchSyntaxTab('vdom')">vDOM</button> <button id="tab-btn-object" role="tab" class="syntax-tab" onclick="switchSyntaxTab('object')">Object DOM</button> </div> <!-- Tagged Syntax --> <div id="syntax-tagged"> <pre><script> examplify(document.currentScript.nextElementSibling, { at: document.currentScript.parentElement, scripts: ['/lightview.js', '/lightview-x.js'], styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'], type: 'module', minHeight: 200, autoRun: true }); </script><code contenteditable="true">await import('/components/layout/footer.js'); const { tags, $ } = Lightview; const { a, Footer } = tags; const footer = Footer({ class: 'bg-neutral text-neutral-content p-10 rounded-box' }, Footer.Nav({}, Footer.Title({}, 'Services'), a({ class: 'link link-hover' }, 'Branding'), a({ class: 'link link-hover' }, 'Design'), a({ class: 'link link-hover' }, 'Marketing') ), Footer.Nav({}, Footer.Title({}, 'Company'), a({ class: 'link link-hover' }, 'About us'), a({ class: 'link link-hover' }, 'Contact'), a({ class: 'link link-hover' }, 'Jobs') ), Footer.Nav({}, Footer.Title({}, 'Legal'), a({ class: 'link link-hover' }, 'Terms of use'), a({ class: 'link link-hover' }, 'Privacy policy') ) ); $('#example').content(footer);</code></pre> </div> <!-- vDOM Syntax --> <div id="syntax-vdom" style="display: none;"> <pre><script> examplify(document.currentScript.nextElementSibling, { at: document.currentScript.parentElement, scripts: ['/lightview.js', '/lightview-x.js'], styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'], type: 'module', minHeight: 200 }); </script><code contenteditable="true">await import('/components/layout/footer.js'); const { $, tags } = Lightview; const { Footer, a } = tags; const footer = { tag: Footer, attributes: { class: 'bg-neutral text-neutral-content p-10 rounded-box' }, children: [ { tag: Footer.Nav, children: [ { tag: Footer.Title, children: ['Services'] }, { tag: a, attributes: { class: 'link link-hover' }, children: ['Branding'] }, { tag: a, attributes: { class: 'link link-hover' }, children: ['Design'] }, { tag: a, attributes: { class: 'link link-hover' }, children: ['Marketing'] } ] }, { tag: Footer.Nav, children: [ { tag: Footer.Title, children: ['Company'] }, { tag: a, attributes: { class: 'link link-hover' }, children: ['About us'] }, { tag: a, attributes: { class: 'link link-hover' }, children: ['Contact'] }, { tag: a, attributes: { class: 'link link-hover' }, children: ['Jobs'] } ] }, { tag: Footer.Nav, children: [ { tag: Footer.Title, children: ['Legal'] }, { tag: a, attributes: { class: 'link link-hover' }, children: ['Terms of use'] }, { tag: a, attributes: { class: 'link link-hover' }, children: ['Privacy policy'] } ] } ] }; $('#example').content(footer);</code></pre> </div> <!-- Object DOM Syntax --> <div id="syntax-object" style="display: none;"> <pre><script> examplify(document.currentScript.nextElementSibling, { at: document.currentScript.parentElement, scripts: ['/lightview.js', '/lightview-x.js'], styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'], type: 'module', minHeight: 200 }); </script><code contenteditable="true">await import('/components/layout/footer.js'); const { $ } = Lightview; const footer = { Footer: { class: 'bg-neutral text-neutral-content p-10 rounded-box', children: [ { 'Footer.Nav': { children: [ { 'Footer.Title': { children: ['Services'] } }, { a: { class: 'link link-hover', children: ['Branding'] } }, { a: { class: 'link link-hover', children: ['Design'] } }, { a: { class: 'link link-hover', children: ['Marketing'] } } ] } }, { 'Footer.Nav': { children: [ { 'Footer.Title': { children: ['Company'] } }, { a: { class: 'link link-hover', children: ['About us'] } }, { a: { class: 'link link-hover', children: ['Contact'] } }, { a: { class: 'link link-hover', children: ['Jobs'] } } ] } }, { 'Footer.Nav': { children: [ { 'Footer.Title': { children: ['Legal'] } }, { a: { class: 'link link-hover', children: ['Terms of use'] } }, { a: { class: 'link link-hover', children: ['Privacy policy'] } } ] } } ] } }; $('#example').content(footer);</code></pre> </div> </div> </div> <!-- Props Table --> <h2 class="text-xl font-bold" style="margin-bottom: 1rem;">Props</h2> <div style="overflow-x: auto; margin-bottom: 2rem;"> <table class="table table-zebra"> <thead> <tr> <th>Prop</th> <th>Type</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>center</code></td> <td>boolean</td> <td>false</td> <td>Center aligned footer</td> </tr> </tbody> </table> </div> <!-- Sub-components --> <h2 class="text-xl font-bold" style="margin-bottom: 1rem;">Sub-components</h2> <div style="overflow-x: auto; margin-bottom: 2rem;"> <table class="table table-zebra"> <thead> <tr> <th>Component</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>Footer.Nav</code></td> <td>Link group container</td> </tr> <tr> <td><code>Footer.Title</code></td> <td>Section title</td> </tr> <tr> <td><code>Footer.Aside</code></td> <td>Extra content area</td> </tr> </tbody> </table> </div> <!-- Static Examples --> <h2 class="text-xl font-bold" style="margin-bottom: 1rem;">Centered Footer</h2> <footer class="footer footer-center bg-base-300 text-base-content p-4 rounded-box"> <aside> <p>Copyright © 2024 - All rights reserved by ACME Industries Ltd</p> </aside> </footer> </div> </div>