# iNTERCEPT UI Guide This guide documents the UI design system, components, and patterns used in iNTERCEPT. ## Table of Contents 1. [Design Tokens](#design-tokens) 2. [Base Templates](#base-templates) 3. [Navigation](#navigation) 4. [Components](#components) 5. [Adding a New Module Page](#adding-a-new-module-page) 6. [Adding a New Dashboard](#adding-a-new-dashboard) --- ## Design Tokens All design tokens are defined in `static/css/core/variables.css`. Import this file first in any stylesheet. ### Colors ```css /* Backgrounds (layered depth) */ --bg-primary: #0a0c10; /* Darkest - page background */ --bg-secondary: #0f1218; /* Panels, sidebars */ --bg-tertiary: #151a23; /* Cards, elevated elements */ --bg-card: #121620; /* Card backgrounds */ --bg-elevated: #1a202c; /* Hover states, modals */ /* Accent Colors */ --accent-cyan: #4a9eff; /* Primary action color */ --accent-green: #22c55e; /* Success, online status */ --accent-red: #ef4444; /* Error, danger, stop */ --accent-orange: #f59e0b; /* Warning */ --accent-amber: #d4a853; /* Secondary highlight */ /* Text Hierarchy */ --text-primary: #e8eaed; /* Main content */ --text-secondary: #9ca3af; /* Secondary content */ --text-dim: #4b5563; /* Disabled, placeholder */ --text-muted: #374151; /* Barely visible */ /* Status Colors */ --status-online: #22c55e; --status-warning: #f59e0b; --status-error: #ef4444; --status-offline: #6b7280; ``` ### Spacing Scale ```css --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px; ``` ### Typography ```css /* Font Families */ --font-sans: 'Inter', -apple-system, sans-serif; --font-mono: 'JetBrains Mono', monospace; /* Font Sizes */ --text-xs: 10px; --text-sm: 12px; --text-base: 14px; --text-lg: 16px; --text-xl: 18px; --text-2xl: 20px; --text-3xl: 24px; --text-4xl: 30px; ``` ### Border Radius ```css --radius-sm: 4px; --radius-md: 6px; --radius-lg: 8px; --radius-xl: 12px; --radius-full: 9999px; ``` ### Light Theme The design system supports light/dark themes via `data-theme` attribute: ```html ``` Toggle with JavaScript: ```javascript document.documentElement.setAttribute('data-theme', 'light'); ``` --- ## Base Templates ### `templates/layout/base.html` The main base template for standard pages. Use for pages with sidebar + content layout. ```html {% extends 'layout/base.html' %} {% block title %}My Page Title{% endblock %} {% block styles %} {% endblock %} {% block navigation %} {% set active_mode = 'mymode' %} {% include 'partials/nav.html' %} {% endblock %} {% block sidebar %}
{% endblock %} {% block content %}

Page Title

{% endblock %} {% block scripts %} {% endblock %} ``` ### `templates/layout/base_dashboard.html` Extended base for full-screen dashboards (maps, visualizations). ```html {% extends 'layout/base_dashboard.html' %} {% set active_mode = 'mydashboard' %} {% block dashboard_title %}MY DASHBOARD{% endblock %} {% block styles %} {{ super() }} {% endblock %} {% block stats_strip %}
{% endblock %} {% block dashboard_content %}
{% endblock %} ``` --- ## Navigation ### Including Navigation ```html {% set active_mode = 'pager' %} {% include 'partials/nav.html' %} ``` ### Valid `active_mode` Values | Mode | Description | |------|-------------| | `pager` | Pager decoding | | `sensor` | 433MHz sensors | | `rtlamr` | Utility meters | | `adsb` | Aircraft tracking | | `ais` | Vessel tracking | | `aprs` | Amateur radio | | `wifi` | WiFi scanning | | `bluetooth` | Bluetooth scanning | | `tscm` | Counter-surveillance | | `satellite` | Satellite tracking | | `sstv` | ISS SSTV | | `listening` | Listening post | | `spystations` | Spy stations | | `meshtastic` | Mesh networking | | `weathersat` | Weather satellites | | `sstv_general` | HF SSTV | | `gps` | GPS tracking | | `websdr` | WebSDR | | `subghz` | Sub-GHz analyzer | | `bt_locate` | BT Locate | | `wifi_locate` | WiFi Locate | | `analytics` | Analytics dashboard | | `spaceweather` | Space weather | ### Navigation Groups The navigation is organized into groups: - **Signals**: Pager, 433MHz, Meters, Listening Post, SubGHz - **Tracking**: Aircraft, Vessels, APRS, GPS - **Space**: Satellite, ISS SSTV, Weather Sat, HF SSTV, Space Weather - **Wireless**: WiFi, Bluetooth, BT Locate, WiFi Locate, Meshtastic - **Intel**: TSCM, Analytics, Spy Stations, WebSDR --- ## Components ### Card / Panel ```html {% call card(title='PANEL TITLE', indicator=true, indicator_active=false) %}

Panel content here

{% endcall %} ``` Or manually: ```html
PANEL TITLE

Content here

``` ### Empty State ```html {% include 'components/empty_state.html' with context %} {# Or with variables: #} {% with title='No data yet', description='Start scanning to see results', action_text='Start Scan', action_onclick='startScan()' %} {% include 'components/empty_state.html' %} {% endwith %} ``` ### Loading State ```html {# Inline spinner #} {% include 'components/loading.html' %} {# With text #} {% with text='Loading data...', size='lg' %} {% include 'components/loading.html' %} {% endwith %} {# Full overlay #} {% with overlay=true, text='Please wait...' %} {% include 'components/loading.html' %} {% endwith %} ``` ### Status Badge ```html {% with status='online', text='Connected', id='connectionStatus' %} {% include 'components/status_badge.html' %} {% endwith %} ``` Status values: `online`, `offline`, `warning`, `error`, `inactive` ### Buttons ```html ``` ### Badges ```html Default Primary Online Warning Error ``` ### Form Groups ```html
Enter frequency in MHz
``` ### Stats Strip Used in dashboards for horizontal statistics display: ```html
0 COUNT
TRACKING
--:--:-- UTC
``` --- ## Adding a New Module Page ### 1. Create the Route In `routes/mymodule.py`: ```python from flask import Blueprint, render_template mymodule_bp = Blueprint('mymodule', __name__, url_prefix='/mymodule') @mymodule_bp.route('/dashboard') def dashboard(): return render_template('mymodule_dashboard.html', offline_settings=get_offline_settings()) ``` ### 2. Register the Blueprint In `routes/__init__.py`: ```python from routes.mymodule import mymodule_bp app.register_blueprint(mymodule_bp) ``` ### 3. Create the Template Option A: Simple page extending base.html ```html {% extends 'layout/base.html' %} {% set active_mode = 'mymodule' %} {% block title %}My Module{% endblock %} {% block navigation %} {% include 'partials/nav.html' %} {% endblock %} {% block content %} {% endblock %} ``` Option B: Full-screen dashboard ```html {% extends 'layout/base_dashboard.html' %} {% set active_mode = 'mymodule' %} {% block dashboard_title %}MY MODULE{% endblock %} {% block dashboard_content %} {% endblock %} ``` ### 4. Add to Navigation In `templates/partials/nav.html`, add your module to the appropriate group: ```html ``` Or if it's a dashboard link: ```html My Module ``` ### 5. Create Stylesheet In `static/css/mymodule.css`: ```css /** * My Module Styles */ @import url('./core/variables.css'); /* Your styles using design tokens */ .mymodule-container { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: var(--space-4); } ``` --- ## Adding a New Dashboard For full-screen dashboards like ADSB, AIS, or Satellite: ### 1. Create the Template ```html MY DASHBOARD // iNTERCEPT {% if offline_settings.fonts_source == 'local' %} {% else %} {% endif %}
Back Main Dashboard
{% set active_mode = 'mydashboard' %} {% include 'partials/nav.html' %}
``` ### 2. Create the Stylesheet ```css /** * My Dashboard Styles */ @import url('./core/variables.css'); :root { /* Dashboard-specific aliases */ --bg-dark: var(--bg-primary); --bg-panel: var(--bg-secondary); --bg-card: var(--bg-tertiary); --grid-line: rgba(74, 158, 255, 0.08); } /* Your dashboard styles */ ``` --- ## Best Practices ### DO - Use design tokens for all colors, spacing, and typography - Include the nav partial on all pages for consistent navigation - Set `active_mode` before including the nav partial - Use semantic component classes (`btn`, `panel`, `badge`, etc.) - Support both light and dark themes - Test on mobile viewports ### DON'T - Hardcode color values - use CSS variables - Create new color variations without adding to tokens - Duplicate navigation markup - use the partial - Skip the favicon and design tokens imports - Use inline styles for layout (use utility classes) --- ## File Structure ``` templates/ ├── layout/ │ ├── base.html # Standard page base │ └── base_dashboard.html # Dashboard page base ├── partials/ │ ├── nav.html # Unified navigation │ ├── page_header.html # Page title component │ └── settings-modal.html # Settings modal ├── components/ │ ├── card.html # Panel/card component │ ├── empty_state.html # Empty state placeholder │ ├── loading.html # Loading spinner │ ├── stats_strip.html # Stats bar component │ └── status_badge.html # Status indicator ├── index.html # Main dashboard ├── adsb_dashboard.html # Aircraft tracking ├── ais_dashboard.html # Vessel tracking └── satellite_dashboard.html # Satellite tracking static/css/ ├── core/ │ ├── variables.css # Design tokens │ ├── base.css # Reset & typography │ ├── components.css # Component styles │ └── layout.css # Layout styles ├── index.css # Main dashboard styles ├── adsb_dashboard.css # Aircraft dashboard ├── ais_dashboard.css # Vessel dashboard ├── satellite_dashboard.css # Satellite dashboard └── responsive.css # Responsive breakpoints ```