CrystalWindow in action

Click any panel below to launch the Visor HUD with different content configurations. Each variant demonstrates a distinct use-case pattern from the VRIL LABS component library.

Welcome Panel

Rich introductory panel with feature overview, quick-start steps, and action buttons.

Settings Visor

API key management, notification preferences, and account configuration in one glass pane.

Research Detail

Inline document preview with metadata, tags, citations, and download actions — zero page navigation.

Design Tokens

Every visual decision encoded as a CSS custom property. The token system supports dark mode, light mode, high-contrast, and print out of the box.

Gradient Palettes
Void Pulse — Hero / Dark Background
Ionosphere — CTAs / Interactive
Neural Arc — Cards / Panels
Aurora Shard — Header / Logo
Core Token Colors
#00FFC8
Olo Teal / --p
#0A84FF
Ionic Blue / --b
#6E3DDB
Void Indigo / --v
#FFB800
VCUR Gold / --g
#B8F5FF
Arctic Mist / --am
#1C1F2E
Deep Void / --sf3
#E8EEF5
Ghost Haze / --tx
#b87333
Copper Arc / --copper

Fluid Type Scale

Every text size uses clamp() for viewport-responsive sizing without media query breakpoints. Three typefaces, each with a specific role.

--text-hero
clamp(3rem,7vw,7rem)
Abc
--text-3xl
clamp(2.5rem,4vw,5rem)
Display
--text-2xl
clamp(2rem,2.5vw,3.5rem)
Section Heading
--text-xl
clamp(1.5rem,1.25vw,2.25rem)
Card Heading
--text-lg
clamp(1.125rem,.75vw,1.5rem)
Lead paragraph and feature text
--text-base
clamp(1rem,.25vw,1.125rem)
Body text for descriptions and long-form content.
--text-sm
clamp(.875rem,.35vw,1rem)
Small labels, captions, and supporting info.
--text-xs
clamp(.75rem,.25vw,.875rem)
SECTION LABELS · MONO · DETAIL COPY
Display / Headings
Syne — var(--font-d)

Geometric, futuristic. Every heading, hero title, and card name. Weights 400–800. Communicates authority without aggression.

Body / UI
Inter — var(--font-b)

Neutral, legible at every size. All paragraph text, button labels, form fields. Weights 300–600. The invisible workhorse of the VRIL design system.

Code / Mono
Atkinson Hyperlegible Mono — var(--font-m)

Section labels · hex values · code · API paths · token names · console output

Fallback Chain
System UI Cascade

Syne → -apple-system → BlinkMacSystemFont → Segoe UI → system-ui → sans-serif. Inter follows the same chain. Atkinson Hyperlegible Mono → Fira Code → Consolas → monospace. Every tier covered, every platform.

The full component system

Every component that appears across the VRIL LABS website family — codified, accessible, and exportable as a single self-contained CSS block.

Buttons
Feature Card · Teal
Bordered Feature Card

Standard card with top accent bar, hover transform, and icon area. Colour-variable via --fcc.

Feature Card · Gold
Gold Accent Variant

All accents driven by a single --fcc custom property: border-color, icon stroke, label colour, and top bar.

Glass Card
Neumorphic Glass Panel

Backdrop-filter + neumorphic inset shadows + top rim gradient. Degrades gracefully on non-supporting browsers.

4.2KB
Gzipped
Full SDK
600ms
φ-Spring
Reveal Time
0
External
Deps
IE9+
Browser
Support
Token / Pill Cards
--p (Olo Teal)
#00FFC8 · Primary
--b (Ionic Blue)
#0A84FF · Interactive
--v (Void Indigo)
#6E3DDB · Depth
--g (VCUR Gold)
#FFB800 · CTA

Install the SDK

One CSS file, one JS file, three lines of HTML. No build step required. Works with React, Vue, Svelte, plain HTML, or any CMS.

Method 1 — CDN (Recommended)
HTML
<!-- In <head> -->
<link rel="stylesheet"
  href="https://cdn.vril.li/sdk/v1/vril.min.css">

<!-- Before </body> -->
<script
  src="https://cdn.vril.li/sdk/v1/vril.min.js"
  defer></script>
Method 2 — NPM / Yarn
Shell
# npm
npm install @vrillabs/sdk

# yarn
yarn add @vrillabs/sdk

# pnpm
pnpm add @vrillabs/sdk
CrystalWindow HTML Structure
HTML — Visor HUD Scaffold
<!-- 1. Overlay (placed before nav in DOM) -->
<div id="cw-overlay" aria-hidden="true"></div>

<!-- 2. CrystalWindow panel (anchored below nav via top: var(--cw-nav-h)) -->
<div id="crystalwindow"
  role="dialog" aria-modal="true"
  aria-labelledby="cw-title"
  style="top: var(--cw-nav-h)">
  <div class="cw-glass">
    <div class="cw-handle" id="cw-handle">
      <div class="cw-handle-bar"></div>
    </div>
    <div class="cw-inner">
      <div class="cw-header">
        <h2 id="cw-title">Panel Title</h2>
        <button class="cw-close" id="cw-close" aria-label="Close"></button>
      </div>
      <div class="cw-body" id="cw-body"></div>
    </div>
    <div class="cw-reflect" aria-hidden="true"></div>
  </div>
</div>

<!-- 3. Nav must be sibling AFTER both #cw-overlay and #crystalwindow -->
<nav class="nav" id="nav">...</nav>
JavaScript API
JavaScript — CrystalWindow API
// Open with a panel ID (matches data-cw-panel="…" on content)
CrystalWindow.open('my-panel-id');

// Open with dynamic title + HTML content
CrystalWindow.open({
  id: 'dynamic',
  title: 'Hello from JS',
  badge: 'New Feature',
  content: `<p>Rendered at runtime.</p>`,
  onOpen: () => console.log('opened'),
});

// Close programmatically
CrystalWindow.close();

// Query current state
const isOpen = CrystalWindow.isOpen();
const panelId = CrystalWindow.currentPanel();

// Register a panel programmatically (React, Vue, etc.)
CrystalWindow.register('settings', {
  title: 'Settings',
  badge: 'Config',
  html:  '<div class="cw-body"><p>Settings content</p></div>',
});

// Listen to global events
window.addEventListener('cw:open', (e) => {
  console.log('Panel opened:', e.detail.id);
});
window.addEventListener('cw:close', (e) => {
  console.log('Panel closed:', e.detail.id);
});
SDK Endpoints Reference
CALL CrystalWindow.open(id | options) stable
CALL CrystalWindow.close() stable
GET CrystalWindow.isOpen() → boolean stable
GET CrystalWindow.currentPanel() → string | null stable
CALL CrystalWindow.register(id, descriptor) v1.1
EVT window: 'cw:open' | 'cw:close' stable

Zero-compromise performance

Every micro-decision — from will-change placement to touch event delegation — is made with rendering performance and accessibility as co-equal first-class constraints.

Animation
GPU-Compositor-Only

The Visor reveal uses only transform: translateY() and opacity — the only two CSS properties that skip layout and paint on every browser engine. Zero layout thrashing guaranteed.

Fallback Stack
5-Layer Compatibility

1 ) CSS custom props + backdrop-filter + @starting-style. 2 ) CSS transitions only (no BF). 3 ) JS rAF polyfill. 4 ) CSS class toggle only. 5 ) <details> HTML no-JS fallback. IE9 through Chrome 124 covered.

Accessibility
WCAG 2.1 AA Baked In

Focus trap on open. Escape key close. ARIA role="dialog" + aria-modal. Live region badge updates. prefers-reduced-motion: all animations disabled in a single media query block. No separate accessibility layer needed.

Memory
Event Delegation

One click listener on document.body for all CrystalWindow triggers. Zero per-button listeners. Panel content is rendered lazily on first open, then cached in a document fragment. GC-safe cleanup on destroy().

Touch
Swipe-Up-to-Close

Native touch event handler on the drag handle. Velocity-based threshold: if swipe speed > 0.5px/ms or displacement > 120px, close is triggered. Uses passive touch events so scroll never blocks the main thread.

CSP
Inline-Style-Free Mode

All inline styles in the SDK can be replaced by CSS custom property declarations. An optional CSP-safe mode moves top/height to a stylesheet, compatible with Content-Security-Policy: style-src 'self'.

Browser Animation Backdrop CSS Props Full SDK
Chrome 90+✓ Full
Safari 14+✓ -webkit-✓ Full
Firefox 89+≥ v103✓ Full
Edge 90+✓ Full
IE 11JS fallbackTier 3
IE 9 / IE 10class onlyTier 4