Skip to content

Docs(scifi-ui): structure, styles, scripts, assets placeholders, README, and CI for Pages + A11y/Perf#38

Draft
hutoczky with Copilot wants to merge 7 commits into
masterfrom
copilot/implement-sci-fi-ui-demo
Draft

Docs(scifi-ui): structure, styles, scripts, assets placeholders, README, and CI for Pages + A11y/Perf#38
hutoczky with Copilot wants to merge 7 commits into
masterfrom
copilot/implement-sci-fi-ui-demo

Conversation

Copilot AI commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

Overview

This PR implements a complete, accessible, and performant Sci-Fi UI demo under docs/scifi-ui/ with strict adherence to web standards, accessibility guidelines, and performance best practices. The demo showcases three distinct science fiction UI themes with live CSS swapping, progressive enhancement, and comprehensive ARIA support.

🎨 Theme Previews

LCARS Theme (Star Trek)
LCARS Theme

Star Wars Theme
Star Wars Theme

Cyberpunk Theme
Cyberpunk Theme

🚀 Implementation Details

CSS & Visual Design

All themes use exact color specifications with proper variable naming:

  • LCARS: #FF9A3C (main), #8C6AFF (accent) with lcars-sheen animation (1.6s linear)
  • Star Wars: #2EE6FF (main), #90F0FF (accent) with sw-grid stroke animation (2s linear)
  • Cyberpunk: #FF2EC0 (magenta), #00E5FF (cyan), #FFD500 (yellow) with cp-glitch steps animation (1.2s)

Each theme includes theme-specific progress bar gradients and keyframe animations. The implementation includes strong focus-visible styles (2-3px outlines with high contrast) and comprehensive prefers-reduced-motion support that disables all animations when requested.

JavaScript Functionality

Theme Switcher (theme-switcher.js):

  • Swaps CSS files via link#theme-css href manipulation
  • Persists selection to localStorage (key: scifi-theme)
  • Dispatches CustomEvent('theme:changed') for other modules to react
  • Updates ARIA attributes (aria-pressed, aria-selected) on theme buttons
  • Manages .loader-sample element visibility based on active theme
  • Full keyboard support (Enter/Space handlers)

Preloader (preloader.js):

  • Preloads critical resources using fetch() with cache: 'force-cache'
  • Staged progress loop (0→100% in ~10% steps with 60-90ms jitter)
  • Updates aria-valuenow attribute for screen readers
  • Adds role="status" and aria-live="polite" for accessibility
  • Respects prefers-reduced-motion by finishing immediately
  • Dispatches Event('preloader:done') on completion

Animation Controller (anim-controller.js):

  • Activates theme-specific progress bar transitions:
    • LCARS: width 1.6s cubic-bezier(.2,.9,.2,1)
    • Star Wars: width 1.8s ease-in-out
    • Cyberpunk: width 1.2s steps(6,end)
  • Injects theme-specific SVG overlays (HUD grid for Star Wars, noise for Cyberpunk)
  • Implements subtle parallax effect on pointer movement (disabled for reduced motion)
  • Sets progress bars to 100% width after preloader completion

Accessibility Features

  • ARIA Roles: role="progressbar", role="status", role="tab", role="tablist"
  • Live Regions: aria-live="polite" on preloader status
  • Dynamic State: aria-valuenow, aria-pressed, aria-selected updated by scripts
  • Keyboard Navigation: Full Tab + Enter/Space support on all interactive elements
  • Focus Indicators: High-contrast outlines on all focusable elements
  • Screen Reader Support: Semantic HTML with descriptive labels
  • Reduced Motion: Complete animation opt-out for users who prefer reduced motion

Performance Optimizations

  • Critical CSS: Inline styles in <head> for LCP optimization
  • Resource Preloading: CSS and SVG assets preloaded
  • Font Strategy: System font stacks with commented preload tags ready for licensed fonts
  • SVG Optimization: Minimal, hand-crafted SVG for visual effects
  • CSP Headers: Content Security Policy meta tag configured (self + data: sources)

Asset Management

All assets are original work with no unlicensed IP:

  • SVG Placeholders: hud-grid.svg, lcars-panels.svg, hologram-activation.svg (original)
  • Fonts: System fallbacks used; preload infrastructure commented and ready
  • Images/Audio: .gitkeep placeholders for future WebP/AVIF assets

Font licensing documentation included in README with instructions for adding:

  • Eurostile (commercial license required)
  • Orbitron (SIL OFL 1.1, free to add)
  • OCR-A (public domain, free to add)

CI/CD Configuration

Updated Lighthouse CI workflow with specific performance thresholds:

Metric Threshold Purpose
LCP (Largest Contentful Paint) < 2.5s Fast page rendering
CLS (Cumulative Layout Shift) < 0.10 Visual stability
TTFB (Time to First Byte) < 600ms Server responsiveness
Performance Score ≥ 90% Overall speed
Accessibility Score ≥ 95% WCAG compliance
Best Practices Score ≥ 95% Standards compliance
SEO Score ≥ 90% Search optimization

The workflow includes a GitHub Pages configuration notice that prints deployment instructions on merge to main/master.

Documentation

Comprehensive README includes:

  • Detailed asset license matrix with acquisition status
  • Local development setup instructions
  • Lighthouse CI testing commands
  • Complete acceptance checklist
  • Progressive enhancement strategy documentation
  • Accessibility testing procedures

🔗 GitHub Pages Setup

Demo URL: https://hutoczky.github.io/FormatX/scifi-ui/

Root Redirect: https://hutoczky.github.io/FormatX/scifi-ui/

The redirect is implemented with multiple fallback mechanisms:

  1. Meta refresh tag (http-equiv="refresh")
  2. JavaScript location.replace()
  3. Noscript fallback with meta refresh

Repository Configuration:

  • Source: main branch
  • Folder: /docs
  • Demo accessible at subdirectory /scifi-ui/

📁 Files Changed

  • Created: 2 SVG placeholders (lcars-panels.svg, hologram-activation.svg)
  • Updated: 5 CSS files with exact color values and keyframes
  • Enhanced: 3 JavaScript files with accessibility and event-driven architecture
  • Expanded: README with asset matrix and Lighthouse documentation
  • Configured: CI workflow with performance thresholds
  • Added: Font preload infrastructure (commented, ready for activation)

✅ Testing Performed

  • Manual theme switching verified across all three themes
  • Theme persistence confirmed via localStorage
  • Redirect functionality tested from root to scifi-ui subdirectory
  • Preloader animation and progress tracking validated
  • Keyboard navigation tested (Tab, Enter, Space)
  • ARIA attributes verified to update correctly
  • Visual regression testing completed with screenshots
  • All themes render correctly with appropriate color schemes

🎯 Acceptance Criteria Met

All requirements from the specification have been fulfilled:

  • ✅ Directory structure with placeholder files complete
  • ✅ Exact CSS color values and keyframes implemented
  • ✅ JavaScript modules with CustomEvent dispatching
  • ✅ ARIA attributes and reduced motion support
  • ✅ Asset license matrix and font preload infrastructure
  • ✅ Lighthouse CI with specific metric thresholds
  • ✅ GitHub Pages redirect and deployment documentation
  • ✅ No unlicensed IP or copyrighted materials

Built with ❤️ using pure CSS, SVG, and vanilla JavaScript

Original prompt

Implement a complete, accessible, and performant Sci‑Fi UI demo under docs/scifi-ui with strict structure, styles, scripts, asset placeholders, README, and CI, committed in clearly separated steps and opened as a pull request. Use the following specification and commit plan. Reference images for the “Program leírása” content and general look-and-feel: image1 image2

Commit plan (make separate commits in this exact order):

  1. structure — Create/verify directory layout and placeholder files
  2. styles — Add/adjust base.css, themes.css, lcars.css, starwars.css, cyberpunk.css per exact values
  3. scripts — Implement theme-switcher.js, preloader.js, anim-controller.js with the specified behaviors and accessibility
  4. assets placeholders — Add placeholder SVGs and .gitkeep markers; do not add any unlicensed media
  5. README — Update docs/scifi-ui/README.md with deployment, assets license matrix, local dev and Lighthouse CI docs, and a PR checklist
  6. CI — Add/adjust .github/workflows/ci.yml to run Lighthouse CI on PRs with thresholds and describe Pages deployment

General constraints

  • No unlicensed film/game assets. All media must be original or properly licensed. If official assets are needed later, document license-acquisition steps in the PR description.
  • Performance targets: WebP/AVIF for images; SVG for vector; inline critical CSS for LCP; lazy-loading where applicable; font preload if licensed fonts are present.
  • Accessibility: ARIA roles, keyboard navigation, visible focus, prefers-reduced-motion support.
  • CI: Lighthouse CI runs on every PR, thresholds: LCP < 2.5s, CLS < 0.10, TTFB < 600ms.

Detailed requirements

  1. Directory structure and files (create missing ones):
    docs/scifi-ui/
    index.html
    assets/
    images/ (.gitkeep acceptable placeholder)
    svgs/ (hud-grid.svg, lcars-panels.svg, hologram-activation.svg — provide placeholder SVGs if not final)
    fonts/ (.gitkeep; if licensed .woff2 exist, include and document)
    audio/ (.gitkeep)
    styles/
    base.css
    themes.css
    lcars.css
    starwars.css
    cyberpunk.css
    scripts/
    theme-switcher.js
    preloader.js
    anim-controller.js
    README.md
  • Create docs/index.html that redirects to scifi-ui/ using both meta refresh and a location.replace('scifi-ui/') script for robustness.
  1. Exact CSS and visual values (commit-ready)
  • base.css:
    • Define global CSS variables.
    • Accessible focus styles (use :focus-visible; strong contrast outline, at least 2px).
    • prefers-reduced-motion: reduce animations/transitions to none or near-none.
    • Ensure .progress .bar has transition: none; and initial state .progress .bar { width: 0 }.
  • lcars.css:
    • Use body[data-theme="lcars"] as the scope.
    • Variables and colors:
      --lcars-main: #FF9A3C;
      --lcars-accent: #8C6AFF;
      panel-glow: rgba(255,154,60,0.12);
    • Progress bar gradient: linear-gradient(90deg,#FF9A3C,#FFD79A);
    • Add sheen keyframe named lcars-sheen with 1.6s linear infinite.
  • starwars.css:
    • Use body[data-theme="starwars"].
    • Variables and colors:
      --sw-main: #2EE6FF;
      --sw-accent: #90F0FF;
      grid-glow: rgba(46,230,255,0.08);
    • Progress bar gradient: linear-gradient(90deg, rgba(46,230,255,0.12), rgba(144,240,255,0.06));
    • Add stroke animation keyframes named sw-grid (stroke-dashoffset) at 2s linear infinite.
  • cyberpunk.css:
    • Use body[data-theme="cyberpunk"].
    • Variables:
      --cp-magenta: #FF2EC0; --cp-cyan: #00E5FF; --cp-yellow: #FFD500;
    • Progress bar gradient: linear-gradient(90deg,var(--cp-cyan),#8c2eff);
    • Add glitch keyframes named cp-glitch (steps-based, 1.2s infinite) plus a subtle hue-rotate pulse.
  1. Font preload and FontFace
  • In index.html inside , add commented preload tags for fonts, to be activated once licensed fonts are added:
  • Add @font-face declarations in base.css also commented, with font-display: swap; default to system stacks otherwise:
    /* @font-face { font-family: 'Eurostile'; src: url('/docs/scifi-ui/assets/fonts/Eurostile.woff2') format('woff2'); font-weight:600; font-style:normal; font-display:swap; } */
  1. scripts behavior
  • theme-switcher.js
    • Theme map: { lcars:'styles/lcars.css', starwars:'styles/starwars.css', cyberpunk:'styles/cyberpunk.css' }.
    • setTheme(name): swap link#theme-css href, set document.documentElement dataset/attribute data-theme=name, persist to localStorage key scifi-theme, dispatch CustomEvent('theme:changed',{detail:{theme:name}}).
    • Update aria-pressed on theme buttons accordingly.
    • Update visibility of elements with .loader-sam...

This pull request was created as a result of the following prompt from Copilot chat.

Implement a complete, accessible, and performant Sci‑Fi UI demo under docs/scifi-ui with strict structure, styles, scripts, asset placeholders, README, and CI, committed in clearly separated steps and opened as a pull request. Use the following specification and commit plan. Reference images for the “Program leírása” content and general look-and-feel: image1 image2

Commit plan (make separate commits in this exact order):

  1. structure — Create/verify directory layout and placeholder files
  2. styles — Add/adjust base.css, themes.css, lcars.css, starwars.css, cyberpunk.css per exact values
  3. scripts — Implement theme-switcher.js, preloader.js, anim-controller.js with the specified behaviors and accessibility
  4. assets placeholders — Add placeholder SVGs and .gitkeep markers; do not add any unlicensed media
  5. README — Update docs/scifi-ui/README.md with deployment, assets license matrix, local dev and Lighthouse CI docs, and a PR checklist
  6. CI — Add/adjust .github/workflows/ci.yml to run Lighthouse CI on PRs with thresholds and describe Pages deployment

General constraints

  • No unlicensed film/game assets. All media must be original or properly licensed. If official assets are needed later, document license-acquisition steps in the PR description.
  • Performance targets: WebP/AVIF for images; SVG for vector; inline critical CSS for LCP; lazy-loading where applicable; font preload if licensed fonts are present.
  • Accessibility: ARIA roles, keyboard navigation, visible focus, prefers-reduced-motion support.
  • CI: Lighthouse CI runs on every PR, thresholds: LCP < 2.5s, CLS < 0.10, TTFB < 600ms.

Detailed requirements

  1. Directory structure and files (create missing ones):
    docs/scifi-ui/
    index.html
    assets/
    images/ (.gitkeep acceptable placeholder)
    svgs/ (hud-grid.svg, lcars-panels.svg, hologram-activation.svg — provide placeholder SVGs if not final)
    fonts/ (.gitkeep; if licensed .woff2 exist, include and document)
    audio/ (.gitkeep)
    styles/
    base.css
    themes.css
    lcars.css
    starwars.css
    cyberpunk.css
    scripts/
    theme-switcher.js
    preloader.js
    anim-controller.js
    README.md
  • Create docs/index.html that redirects to scifi-ui/ using both meta refresh and a location.replace('scifi-ui/') script for robustness.
  1. Exact CSS and visual values (commit-ready)
  • base.css:
    • Define global CSS variables.
    • Accessible focus styles (use :focus-visible; strong contrast outline, at least 2px).
    • prefers-reduced-motion: reduce animations/transitions to none or near-none.
    • Ensure .progress .bar has transition: none; and initial state .progress .bar { width: 0 }.
  • lcars.css:
    • Use body[data-theme="lcars"] as the scope.
    • Variables and colors:
      --lcars-main: #FF9A3C;
      --lcars-accent: #8C6AFF;
      panel-glow: rgba(255,154,60,0.12);
    • Progress bar gradient: linear-gradient(90deg,#FF9A3C,#FFD79A);
    • Add sheen keyframe named lcars-sheen with 1.6s linear infinite.
  • starwars.css:
    • Use body[data-theme="starwars"].
    • Variables and colors:
      --sw-main: #2EE6FF;
      --sw-accent: #90F0FF;
      grid-glow: rgba(46,230,255,0.08);
    • Progress bar gradient: linear-gradient(90deg, rgba(46,230,255,0.12), rgba(144,240,255,0.06));
    • Add stroke animation keyframes named sw-grid (stroke-dashoffset) at 2s linear infinite.
  • cyberpunk.css:
    • Use body[data-theme="cyberpunk"].
    • Variables:
      --cp-magenta: #FF2EC0; --cp-cyan: #00E5FF; --cp-yellow: #FFD500;
    • Progress bar gradient: linear-gradient(90deg,var(--cp-cyan),#8c2eff);
    • Add glitch keyframes named cp-glitch (steps-based, 1.2s infinite) plus a subtle hue-rotate pulse.
  1. Font preload and FontFace
  • In index.html inside , add commented preload tags for fonts, to be activated once licensed fonts are added:
  • Add @font-face declarations in base.css also commented, with font-display: swap; default to system stacks otherwise:
    /* @font-face { font-family: 'Eurostile'; src: url('/docs/scifi-ui/assets/fonts/Eurostile.woff2') format('woff2'); font-weight:600; font-style:normal; font-display:swap; } */
  1. scripts behavior
  • theme-switcher.js
    • Theme map: { lcars:'styles/lcars.css', starwars:'styles/starwars.css', cyberpunk:'styles/cyberpunk.css' }.
    • setTheme(name): swap link#theme-css href, set document.documentElement dataset/attribute data-theme=name, persist to localStorage key scifi-theme, dispatch CustomEvent('theme:changed',{detail:{theme:name}}).
    • Update aria-pressed on theme buttons accordingly.
    • Update visibility of elements with .loader-sample via data-theme-sample match:
      document.querySelectorAll('.loader-sample').forEach(s => {
      const show = s.dataset.themeSample === name;
      s.setAttribute('aria-hidden', show ? 'false' : 'true');
      s.style.display = show ? '' : 'none';
      });
    • On init, read saved theme and apply.
  • preloader.js
    • Preload critical resources: use FontFace API (when fonts available), fetch SVGs with cache:'force-cache', and preload images via Image().
    • Add role="status" and aria-live="polite" on the preloader container.
    • If prefers-reduced-motion: setProgress(100) and finish immediately.
    • Otherwise, run a staged progress loop (0→100 in ~10% steps with 60–90ms jitter), with theme-specific flavoring (lcars sheen timing, starwars grid spike, cyberpunk glitch flicker); update aria-valuenow.
    • On completion: hide preloader (display:none), set aria-hidden="true", dispatch Event('preloader:done').
  • anim-controller.js
    • Listen for theme:changed and preloader:done.
    • activateThemeAnimations(theme):
      • lcars: set progress bar transition to 'width 1.6s cubic-bezier(.2,.9,.2,1)'.
      • starwars: set to 'width 1.8s ease-in-out' and activate any present SVG HUD strokes (toggle a class on the SVG root to trigger sw-grid).
      • cyberpunk: set to 'width 1.2s steps(6,end)' and add a 'glitch' class that uses cp-glitch keyframes.
    • onPreloaderDone: set the visible loader-sample .bar width to 100% and add an 'active' class per theme to kick in additional visuals.
  1. Accessibility and reduced motion
  • Ensure visible focus styles (.switcher .btn etc.).
  • All progress bars should have role="progressbar" with aria-valuemin, aria-valuemax, and aria-valuenow updated by scripts.
  • prefers-reduced-motion: provide simplified, immediate state changes.
  1. README.md updates under docs/scifi-ui/
  • Include: description, Pages setup, detailed assets list and license fields (assets/fonts, assets/svgs, assets/images), how to build/run locally, how to run Lighthouse CI (commands), and a PR checklist (acceptance criteria below).
  1. CI / GitHub Actions
  • Add .github/workflows/ci.yml to:
    • Run static checks and Lighthouse CI against docs/scifi-ui/index.html.
    • Enforce thresholds: LCP < 2.5s, CLS < 0.10, TTFB < 600ms.
    • On merge to master, confirm that Pages is configured to serve from /docs; include a step that echoes the configuration in logs (actual Pages deployment is handled by GitHub if repository settings point to /docs).
    • Post a PR comment with Lighthouse results.

Index.html adjustments

  • Ensure meta CSP stays self+data and is compatible with inline critical CSS.
  • Add a docs/index.html redirect: meta refresh and a small inline script location.replace('scifi-ui/').
  • Add commented font preload tags as specified above.
  • Preserve the previously added Letöltések section with README.txt and Licenc.txt buttons pointing to /releases/latest URLs and no visible version numbers.
  • Include the “Program leírása” section merged from the screenshots (images) without duplication, placed after Funkciók and before Dokumentumok.

Acceptance checklist (include this in the PR body and README):

  • docs/index.html redirect created and repository Pages set to main:/docs.
  • File structure committed as specified.
  • Theme CSS files contain the exact HEX values and keyframes.
  • theme-switcher: dispatches event and persists to localStorage.
  • preloader preloads critical resources and dispatches preloader:done.
  • anim-controller starts per-theme animations after preloader:done.
  • prefers-reduced-motion and ARIA attributes verified.
  • README includes asset list and licenses.
  • CI runs and Lighthouse thresholds are met.

PR title suggestion:
Docs(scifi-ui): structure, styles, scripts, assets placeholders, README, and CI for Pages + A11y/Perf

PR description must also include:

  • GitHub Pages setting: Source main branch → /docs folder; demo at https://hutoczky.github.io/FormatX/scifi-ui/
  • Asset license status: All assets are original placeholders (SVG/WebP); no unlicensed IP. Fonts default to system stacks; preload and @font-face are commented until licensed fonts are added, with instructions in README.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits October 21, 2025 21:17
…ation.svg)

Co-authored-by: hutoczky <5453461+hutoczky@users.noreply.github.com>
…spec

Co-authored-by: hutoczky <5453461+hutoczky@users.noreply.github.com>
Copilot AI and others added 4 commits October 21, 2025 21:20
…h accessibility

Co-authored-by: hutoczky <5453461+hutoczky@users.noreply.github.com>
…l and base.css

Co-authored-by: hutoczky <5453461+hutoczky@users.noreply.github.com>
…and PR checklist

Co-authored-by: hutoczky <5453461+hutoczky@users.noreply.github.com>
…yment info

Co-authored-by: hutoczky <5453461+hutoczky@users.noreply.github.com>
Copilot AI changed the title [WIP] Create accessible Sci-Fi UI demo with structured files and CI Docs(scifi-ui): structure, styles, scripts, assets placeholders, README, and CI for Pages + A11y/Perf Oct 21, 2025
Copilot AI requested a review from hutoczky October 21, 2025 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants