Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
178 changes: 178 additions & 0 deletions docs/THEMES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# FormatX Multi-Theme System

## Overview

FormatX features a sophisticated multi-theme system with franchise-inspired themes, each with unique color palettes, animations, and aesthetic elements.

## Available Themes

### πŸ–– LCARS (Default - Star Trek inspired)
- **Colors**: Cyan (`#00eaff`), Purple (`#7c4dff`), Teal (`#00ffc6`)
- **Aesthetic**: Sleek Star Trek LCARS interface design
- **Intro Animation**: Smooth warp effect
- **Message**: "Initializing FormatX… β€” LCARS Online"

### πŸŒƒ Cyberpunk 2077
- **Colors**: Hot Pink (`#ff003c`), Electric Blue (`#00f0ff`), Neon Yellow (`#fcee09`)
- **Aesthetic**: Dystopian neon-soaked cyberpunk
- **Intro Animation**: Digital glitch effect
- **Message**: "Initializing FormatX… β€” Jacking In..."

### βš”οΈ Star Wars
- **Colors**: Jedi Blue (`#0d6efd`), Sith Red (`#dc3545`), Logo Gold (`#ffe81f`)
- **Aesthetic**: Classic Star Wars color scheme with lightsaber hues
- **Intro Animation**: Opening crawl perspective effect
- **Message**: "Initializing FormatX… β€” A long time ago..."

### πŸŒ€ Stargate
- **Colors**: Wormhole Blue (`#4d9fff`), Orange (`#ff6b35`), Bright Cyan (`#00d4ff`)
- **Aesthetic**: Event horizon blues with orange accents
- **Intro Animation**: Chevron rotation and lock
- **Message**: "Initializing FormatX… β€” Chevrons Locked"

## Features

### ✨ Core Features
- **Four Complete Themes**: Each with unique color palettes and aesthetics
- **Theme-Specific Intro Animations**: Franchise-inspired loading animations
- **Persistent Selection**: Theme choice saved in localStorage
- **Dynamic CSS Injection**: themes.css loaded automatically by theme-loader.js
- **Theme Selector UI**: Easy-to-use dropdown menu in the navigation bar
- **Light Mode Support**: All four themes include light mode variants
- **Reduced-Motion Support**: Respects `prefers-reduced-motion` user preference
- **Smooth Transitions**: Seamless theme switching with CSS transitions

### 🎨 Technical Details

#### File Structure
```
docs/
β”œβ”€β”€ index.html # Includes theme-loader.js
β”œβ”€β”€ styles.css # Base styles with CSS variables
β”œβ”€β”€ themes.css # Theme definitions and animations
β”œβ”€β”€ theme-loader.js # Theme management and UI
└── script.js # Main application logic
```

#### CSS Variables
Each theme defines the following CSS variables:
- `--bg`: Background color
- `--text`: Primary text color
- `--muted`: Secondary text color
- `--primary`: Primary accent color
- `--primary-2`: Secondary accent color
- `--accent`: Tertiary accent color
- `--glass`: Glass effect background
- `--glass-strong`: Stronger glass effect
- `--border`: Border color
- `--shadow`: Shadow effect
- `--theme-glow`: Theme-specific glow color
- `--theme-ring-1`, `--theme-ring-2`, `--theme-ring-3`: Ring colors for preloader
- `--theme-core`: Core color for preloader
- `--theme-scanline`: Scanline effect color

#### Theme Selection API
The theme system exposes a JavaScript API:
```javascript
// Get current theme
const currentTheme = window.FormatXThemes.getTheme();

// Set theme
window.FormatXThemes.setTheme('cyberpunk');

// Get available themes
const themes = window.FormatXThemes.themes;
// Returns: { lcars: 'LCARS', cyberpunk: 'Cyberpunk 2077', ... }

// Listen for theme changes
window.addEventListener('franchiseThemeChanged', (event) => {
console.log('Theme changed to:', event.detail.theme);
});
```

## Usage

### For Users
1. Open the FormatX website
2. Click the "TΓ©ma" button in the navigation bar
3. Select your preferred theme from the dropdown
4. Your choice is automatically saved and will persist across visits

### For Developers

#### Adding a New Theme
1. Add theme definition in `themes.css`:
```css
:root[data-franchise-theme="mytheme"] {
--bg: #000000;
--text: #ffffff;
/* ... other variables ... */
}
```

2. Add light mode variant:
```css
:root[data-theme="light"][data-franchise-theme="mytheme"] {
/* light mode colors */
}
```

3. Add intro animation:
```css
@keyframes mytheme-intro {
/* animation keyframes */
}

:root[data-franchise-theme="mytheme"] #preloader .warp-core {
animation: mytheme-intro 1.5s ease forwards;
}
```

4. Add theme to `theme-loader.js`:
```javascript
const THEMES = {
// ... existing themes ...
mytheme: 'My Theme Name'
};
```

#### Customizing Existing Themes
Themes are defined using CSS custom properties (variables), making customization easy. Simply override the desired variables in a custom stylesheet loaded after `themes.css`.

## Accessibility

- **Reduced Motion**: All animations respect the `prefers-reduced-motion` media query
- **Keyboard Navigation**: Theme selector is fully keyboard accessible
- **ARIA Labels**: Proper ARIA labels for screen readers
- **Color Contrast**: All themes maintain sufficient color contrast ratios

## Browser Support

The multi-theme system works in all modern browsers that support:
- CSS Custom Properties (CSS Variables)
- ES6 JavaScript
- localStorage API
- CSS Grid and Flexbox

## Deployment

The theme system is ready for GitHub Pages deployment. When merged to the `master` branch:
1. GitHub Pages automatically publishes from the `docs` folder
2. All theme files are included and functional
3. No build step required - pure HTML, CSS, and JavaScript

## Testing

All features have been tested and verified:
- βœ“ Theme switching functionality
- βœ“ localStorage persistence
- βœ“ Theme-specific animations
- βœ“ Light mode variants
- βœ“ Reduced-motion support
- βœ“ Theme selector UI
- βœ“ CSS variable inheritance
- βœ“ Cross-browser compatibility

## License

Part of the FormatX project. See main LICENSE file for details.
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400..800&family=Exo:wght@300;400;600&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="./styles.css" />
<script src="./theme-loader.js"></script>
</head>
<body>
<!-- BetΓΆltΓ©si animΓ‘ciΓ³ (warp-mag) -->
Expand Down
23 changes: 16 additions & 7 deletions docs/styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* Base theme variables - can be overridden by themes.css */
:root{
--bg: #050611;
--text: #d8eaff;
Expand All @@ -9,6 +10,14 @@
--glass-strong: rgba(12,18,34,0.8);
--border: rgba(160,220,255,0.18);
--shadow: 0 10px 30px rgba(0,0,0,.4);

/* Default theme-specific colors */
--theme-glow: rgba(0,234,255,0.25);
--theme-ring-1: rgba(0,234,255,0.4);
--theme-ring-2: rgba(124,77,255,0.5);
--theme-ring-3: rgba(0,234,255,0.4);
--theme-core: #00eaff;
--theme-scanline: rgba(255,255,255,0.04);
}

/* Light theme */
Expand Down Expand Up @@ -390,21 +399,21 @@ pre{
.warp-core{ position:relative; width:160px; height:160px; display:grid; place-items:center; }
.warp-core .ring{
position:absolute; border-radius:50%;
border: 2px solid rgba(0,234,255,.4);
box-shadow: inset 0 0 30px rgba(0,234,255,.18), 0 0 30px rgba(124,77,255,.18);
border: 2px solid var(--theme-ring-1);
box-shadow: inset 0 0 30px var(--theme-glow), 0 0 30px var(--theme-glow);
animation: pulse 2.6s ease-in-out infinite, rotate 12s linear infinite;
}
.r1{ width:140px; height:140px }
.r2{ width:110px; height:110px; animation-duration: 2.2s, 10s; border-color: rgba(124,77,255,.5) }
.r3{ width:80px; height:80px; animation-duration: 1.8s, 8s }
.r2{ width:110px; height:110px; animation-duration: 2.2s, 10s; border-color: var(--theme-ring-2) }
.r3{ width:80px; height:80px; animation-duration: 1.8s, 8s; border-color: var(--theme-ring-3) }
.core-glow{
width:26px; height:26px; border-radius:50%;
background: radial-gradient(circle at 50% 40%, #fff, #00eaff 40%, rgba(0,234,255,.05) 60%);
box-shadow: 0 0 25px 6px rgba(0,234,255,.6), 0 0 60px 18px rgba(124,77,255,.35);
background: radial-gradient(circle at 50% 40%, #fff, var(--theme-core) 40%, transparent 60%);
box-shadow: 0 0 25px 6px var(--theme-glow), 0 0 60px 18px var(--theme-glow);
animation: throb 2.2s ease-in-out infinite;
}
.scanline{
position:absolute; inset:0; background: repeating-linear-gradient( to bottom, rgba(255,255,255,.04) 0 2px, transparent 2px 4px );
position:absolute; inset:0; background: repeating-linear-gradient( to bottom, var(--theme-scanline) 0 2px, transparent 2px 4px );
mix-blend-mode: screen; border-radius:50%; filter: blur(.2px);
animation: scan 3.2s linear infinite;
}
Expand Down
Loading