Overview
Playground includes a powerful theme system with 30 predefined themes and full customization capabilities. Users can select from beautifully crafted color palettes or create their own unique designs.
Predefined Themes
The theme system loads themes from temas.json, which contains an array of theme objects. Each theme includes:
Display name of the theme
Primary color (hex format)
Secondary color (hex format)
Background color (hex format)
Optional text color for primary backgrounds
Theme Gallery
Dark Themes
Light Themes
Vibrant Themes
Dark Mode Color Schemes
Seda
Primary : #e1c78f
Secondary : #d4af37
Background : #0f0f0f
Text : #ffffff
Text on Primary : #000000
Espresso
Primary : #d4a574
Secondary : #8b6f47
Background : #1a1410
Text : #f5f5dc
Medianoche
Primary : #9b59b6
Secondary : #8e44ad
Background : #1a1a2e
Text : #eaeaea
Gris Oscuro
Primary : #b3b3b3
Secondary : #808080
Background : #1c1c1c
Text : #f0f0f0
Text on Primary : #000000
Light Mode Color Schemes
Ámbar
Primary : #e69500
Secondary : #ff8c00
Background : #f0f0f0
Text : #000000
Cielo
Primary : #3498db
Secondary : #2980b9
Background : #ecf0f1
Text : #2c3e50
Menta
Primary : #1abc9c
Secondary : #16a085
Background : #f4fffe
Text : #0a3d3b
Lavanda
Primary : #a29bfe
Secondary : #6c5ce7
Background : #f8f9fa
Text : #2d3436
Bold & Vibrant Color Schemes
Neón
Primary : #00ff88
Secondary : #00d9ff
Background : #0a0e27
Text : #C9C9C9
Text on Primary : #000000
Galaxia
Primary : #00a8ff
Secondary : #007fff
Background : #130f40
Text : #e6e8fa
Text on Primary : #000000
Amapola
Primary : #ff5733
Secondary : #c70039
Background : #2d2d2d
Text : #f0f0f0
Text on Primary : #000000
Coral
Primary : #e74c3c
Secondary : #c0392b
Background : #ffeaa7
Text : #34495e
Loading Themes
Themes are loaded asynchronously from the JSON file:
let temas = [];
async function cargarTemas () {
try {
const respuesta = await fetch ( 'temas.json' );
if ( ! respuesta . ok ) throw new Error ( 'No se pudo cargar temas.json' );
temas = await respuesta . json ();
crearBotonesTemas ();
} catch ( error ) {
console . error ( 'Error al cargar los temas:' , error );
}
}
Each theme is displayed as a circular button with a conic gradient showing all its colors:
function crearBotonesTemas () {
const container = document . getElementById ( 'temasButtons' );
temas . forEach (( tema ) => {
const boton = document . createElement ( 'button' );
boton . className = 'tema-boton' ;
// Create visual representation with conic gradient
if ( tema . textoFondoPrimario ) {
// 5-color split when textoFondoPrimario exists
boton . style . background = `conic-gradient(
from 0deg,
${ tema . primario } 0deg 90deg,
${ tema . secundario } 90deg 180deg,
${ tema . fondo } 180deg 270deg,
${ tema . texto } 270deg 315deg,
${ tema . textoFondoPrimario } 315deg 360deg
)` ;
} else {
// 4-color equal split
boton . style . background = `conic-gradient(
from 0deg,
${ tema . primario } 0deg 90deg,
${ tema . secundario } 90deg 180deg,
${ tema . fondo } 180deg 270deg,
${ tema . texto } 270deg 360deg
)` ;
}
boton . addEventListener ( 'click' , () => aplicarTema ( tema ));
});
}
The conic gradient provides a quick visual preview of all theme colors in a single circular button.
Applying a Theme
When a user clicks a theme button:
Color inputs are populated with theme values
Input events are dispatched to trigger live preview
The textoFondoPrimario option is configured if present
function aplicarTema ( tema ) {
const ids = [ 'ColorPrimario' , 'ColorSecundario' , 'ColorFondo' , 'ColorTexto' ];
const valores = [ tema . primario , tema . secundario , tema . fondo , tema . texto ];
ids . forEach (( id , i ) => {
const input = document . getElementById ( id );
if ( input ) {
input . value = valores [ i ];
input . dispatchEvent ( new Event ( 'input' , { bubbles: true }));
}
});
// Handle optional textoFondoPrimario
const checkboxColorTextoFondoPrimario =
document . getElementById ( 'activarColorTextoFondoPrimario' );
const inputColorTextoFondoPrimario =
document . getElementById ( 'ColorTextoFondoPrimario' );
if ( tema . textoFondoPrimario ) {
checkboxColorTextoFondoPrimario . checked = true ;
inputColorTextoFondoPrimario . value = tema . textoFondoPrimario ;
inputColorTextoFondoPrimario . dispatchEvent ( new Event ( 'input' ));
} else {
checkboxColorTextoFondoPrimario . checked = false ;
}
}
Custom Color Customization
Users can override theme colors or create completely custom themes:
Color Pickers
Select Primary Color
Choose your main brand color using the color picker for ColorPrimario.
Select Secondary Color
Pick an accent color with ColorSecundario to complement your primary.
Choose Background
Set the base background color with ColorFondo.
Define Text Color
Select the main text color with ColorTexto for optimal contrast.
Optional: Text on Primary
Enable and set ColorTextoFondoPrimario if you need different text color on primary backgrounds.
Live Preview
Color changes are previewed in real-time as you adjust the color pickers:
previsualizarCambios () {
const root = document . documentElement ;
root . style . setProperty ( '--color-primario' , inputPrimario . value );
root . style . setProperty ( '--color-secundario' , inputSecundario . value );
root . style . setProperty ( '--color-fondo' , inputColorFondo . value );
root . style . setProperty ( '--color-texto' , inputColorTexto . value );
if ( checkboxColorTextoFondoPrimario . checked ) {
root . style . setProperty ( '--color-texto-fondo-primario' ,
inputColorTextoFondoPrimario . value );
}
}
All changes are previewed instantly but won’t be saved until you click the “Guardar Configuración” button.
Typography Selection
Playground offers 10 font families:
Google Fonts
Nunito (default)
Open Sans
Web-Safe Fonts
Arial
Verdana
Georgia
Times New Roman
Tahoma
Trebuchet MS
const fuentesDisponibles = [
{ nombre: 'Nunito' , valor: "'Nunito', sans-serif" },
{ nombre: 'Open Sans' , valor: "'Open Sans', sans-serif" },
{ nombre: 'Arial' , valor: 'Arial, sans-serif' },
{ nombre: 'Verdana' , valor: 'Verdana, Geneva, sans-serif' },
{ nombre: 'Georgia' , valor: 'Georgia, serif' },
{ nombre: 'Times New Roman' , valor: '"Times New Roman", Times, serif' },
{ nombre: 'Tahoma' , valor: 'Tahoma, Geneva, sans-serif' },
{ nombre: 'Trebuchet MS' , valor: '"Trebuchet MS", Helvetica, sans-serif' },
{ nombre: 'Courier New' , valor: '"Courier New", Courier, monospace' },
{ nombre: 'Consolas' , valor: 'Consolas, "Courier New", monospace' }
];
Complete Theme List
Here are all 30 available themes:
Seda - Elegant gold on deep black
Espresso - Warm coffee tones
Medianoche - Purple midnight theme
Gris Oscuro - Sophisticated grayscale
Índigo - Deep indigo blue
Amapola - Bold red and gray
Marte - Martian red atmosphere
Neón - Cyberpunk neon lights
Galaxia - Space-inspired blues
Bosque - Forest greens
Carbón - Industrial charcoal
Atardecer - Sunset oranges
Girasol - Bright sunflower yellow
Océano - Deep ocean blues
Militar - Military slate gray
Ámbar - Classic amber (default)
Cielo - Sky blue
Glaciar - Icy cyan
Menta - Fresh mint green
Café - Coffee and cream
Esmeralda - Emerald green
Lavanda - Soft lavender
Rubí - Rich ruby red
Durazno - Peachy pastels
Limón - Lemon yellow
Arena - Sandy beige
Aura - Mystical purple-blue
Coral - Coral and cream
Cereza - Cherry red
Rosa - Pink blossoms