Centre de marque

Brand Center | CPS · PYG · Eyser tailwind.config = { theme: { extend: { fontFamily: { primary: ['Segoe UI', 'Calibri', 'system-ui', 'sans-serif'], secondary: ['Calibri', 'Segoe UI', 'system-ui', 'sans-serif'] }, transitionDuration: { '300': '300ms' } } } } /* =================================================================== PREVENCIÓN DE PARPADEO (FOUC) Mantiene la pantalla invisible unos milisegundos hasta que Tailwind termina de compilar, mostrando la web con un fundido. =================================================================== */ body { opacity: 0; animation: bcFadeIn 0.4s ease-out forwards; animation-delay: 0.2s; } @keyframes bcFadeIn { to { opacity: 1; } } /* Fallback crítico: si Tailwind CDN no carga (red restringida, sin conexión, proxy corporativo), la navegación entre empresas depende de esta única regla para no mostrar todas las marcas apiladas. */ .hidden { display: none !important; } /* Fallback crítico de layout responsive: replica el comportamiento de "hidden lg:flex" / "lg:hidden" de Tailwind por si el CDN no carga. Sin esto, el sidebar de escritorio y la barra móvil dependerían enteramente de una red externa para mostrarse. */ @media (min-width: 1024px) { #sidebar-desktop { display: flex !important; } #mobile-header { display: none !important; } } @media (max-width: 1023px) { #sidebar-desktop { display: none !important; } #mobile-header { display: block !important; } } /* =================================================================== VARIABLES CSS DE MARCA Cada empresa redefine estas variables sobre el elemento mediante el atributo data-active-company. El JS solo cambia ese atributo; todo el repintado de color del ÁREA DE CONTENIDO lo hace el CSS. Importante: estas variables NO controlan el color del placeholder de logo (ver .mini-logo-* más abajo) — cada marca mantiene su propio color ahí, fijo, sin importar cuál esté activa. =================================================================== */ :root { --brand-primary: #211261; --brand-secondary: #dde5ed; --brand-accent: #211261; --brand-surface: #ffffff; --brand-text-on-primary: #ffffff; } body[data-active-company="cps"] { --brand-primary: #211261; --brand-secondary: #dde5ed; --brand-accent: #211261; --brand-surface: #ffffff; --brand-text-on-primary: #ffffff; } body[data-active-company="pyg"] { --brand-primary: #323e48; --brand-secondary: #84c286; --brand-accent: #4a68af; --brand-surface: #ffffff; --brand-text-on-primary: #ffffff; } body[data-active-company="eyser"] { --brand-primary: #71962c; --brand-secondary: #8b6530; --brand-accent: #71962c; --brand-surface: #000000; --brand-text-on-primary: #ffffff; } /* Utilidades que consumen las variables, ya que Tailwind CDN no puede generar clases dinámicas para valores arbitrarios en runtime */ .bg-brand-primary { background-color: var(--brand-primary); } .bg-brand-secondary { background-color: var(--brand-secondary); } .bg-brand-accent { background-color: var(--brand-accent); } .text-brand-primary { color: var(--brand-primary); } .text-brand-secondary { color: var(--brand-secondary); } .text-brand-accent { color: var(--brand-accent); } .border-brand-primary { border-color: var(--brand-primary); } .ring-brand-primary { box-shadow: 0 0 0 2px var(--brand-primary); } /* Scrollbar elegante y discreta para el área de contenido */ #main-content::-webkit-scrollbar { width: 8px; } #main-content::-webkit-scrollbar-track { background: transparent; } #main-content::-webkit-scrollbar-thumb { background-color: #d1d5db; border-radius: 9999px; } #main-content::-webkit-scrollbar-thumb:hover { background-color: #9ca3af; } /* ------------------------------------------------------------------- PLACEHOLDER DE LOGO (RESPALDO): si la URL de imagen del logo de una marca falla al cargar, se sustituye por este monograma con el color propio de esa marca, fijo, escrito directamente aquí (no depende de --brand-primary, que cambia según la empresa activa). El sidebar ya NO usa logos ni placeholders, solo texto. Si cambias el color principal de una marca en COMPANY_DATA (JS), actualiza también el HEX aquí para que coincida. ------------------------------------------------------------------- */ .mini-logo-cps { background-color: #211261; } .mini-logo-pyg { background-color: #323e48; } .mini-logo-eyser { background-color: #71962c; } /* Placeholder de logo: monograma con iniciales sobre el color de marca. Se usa automáticamente como respaldo si la URL de imagen del logo no carga (ver atributo onerror en las etiquetas del HTML). */ .logo-placeholder { display: flex; align-items: center; justify-content: center; font-family: 'Segoe UI', system-ui, sans-serif; font-weight: 700; letter-spacing: 0.02em; color: #ffffff; user-select: none; } /* Logo real de marca (header de cada vista): el tamaño de la caja lo fijan las clases de Tailwind en el propio (ej. w-20 h-20). Esta regla solo se encarga de que la imagen NUNCA se deforme ni se recorte dentro de esa caja, conservando su proporción natural. */ .brand-logo-image { object-fit: contain; } /* Animación de entrada suave al cambiar de vista */ .view-enter { animation: viewFadeIn 400ms ease-out; } @keyframes viewFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } } /* Toast de confirmación de copiado */ #copy-toast { transition: opacity 300ms ease, transform 300ms ease; } /* Indicador activo del sidebar: barra lateral animada */ .sidebar-btn { position: relative; transition: background-color 300ms ease, color 300ms ease; } .sidebar-btn::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background-color: var(--brand-accent-indicator, transparent); transform: scaleY(0); transition: transform 300ms ease; } .sidebar-btn[data-active="true"]::before { transform: scaleY(1); } /* Sub-tabs de sucursal (solo CPS) */ .subtab-btn { transition: color 300ms ease, border-color 300ms ease; border-bottom: 2px solid transparent; } .subtab-btn[data-active="true"] { border-bottom-color: var(--brand-primary); color: var(--brand-primary); } /* Tarjeta de color: ahora con 4 filas de datos (HEX, RGB, CMYK, Pantone) en vez de solo HEX. Solo el HEX es clicable para copiar. */ .color-data-row { display: flex; justify-content: space-between; font-family: 'Calibri', system-ui, sans-serif; } .color-data-label { color: #9ca3af; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; } .color-data-value { color: #4b5563; font-size: 0.75rem; font-weight: 600; } .hex-copy-row { cursor: pointer; transition: background-color 300ms ease; } .hex-copy-row:hover { background-color: #f9fafb; }

Brand Center

<!-- Las 3 vistas de empresa (CPS, PYG, Eyser) se generan íntegramente por JavaScript a partir de COMPANY_DATA. Ver sección "1. DATOS EDITABLES" en el más abajo. -->
¡Copiado!
(function () { 'use strict'; /* ================================================================= ╔═══════════════════════════════════════════════════════════════╗ ║ 1. DATOS EDITABLES ║ ║ ║ ║ Todo el contenido del sitio (colores, descargables, logos, ║ ║ sucursales) vive aquí, en estos objetos y arrays. El HTML de ║ ║ cada vista se genera automáticamente a partir de esto. ║ ║ ║ ║ Para añadir algo nuevo: copia un bloque existente (las ║ ║ llaves { ... } de un color o de una categoría de descarga), ║ ║ pégalo justo debajo, separado por una coma, y cambia los ║ ║ valores. No hace falta tocar nada más abajo en el archivo. ║ ╚═══════════════════════════════════════════════════════════════╝ ================================================================= */ /* ----------------------------------------------------------------- 1.1 CATEGORÍAS DE DESCARGA Estas son las categorías que aparecen repetidas en cada sucursal/marca, con su icono y texto. Para añadir una categoría nueva (ej: "Carteles"), copia un bloque { ... } completo y pégalo donde quieras dentro del array. Campos: key -> identificador interno SIN espacios ni acentos. Se usa para emparejar esta categoría con su URL de descarga en cada sucursal/marca (ver sección 1.2 y 1.3 más abajo). Si añades una categoría nueva, invéntate una key nueva en minúsculas (ej. 'carteles') y úsala también al añadir sus URLs por sucursal. label -> título de la tarjeta sublabel -> texto pequeño debajo del título icono -> SVG (paths) de Heroicons, formato outline 24x24 infoOnly -> OPCIONAL. Si vale true, la tarjeta es solo informativa: no lleva enlace ni icono de descarga. onlyIn -> OPCIONAL. Si lo omites, la categoría aparece en TODAS las sucursales/marcas (comportamiento normal). Si quieres que aparezca SOLO en sucursales concretas de CPS, añade un array con sus keys, por ejemplo: onlyIn: ['espana'] -> solo en CPS España onlyIn: ['espana', 'mexico'] -> solo en esas dos Nota: esto solo filtra sucursales de CPS. Para que una categoría no aparezca en PYG o Eyser (que no tienen sucursales), de momento hay que quitarle manualmente su key del downloadUrls de esa marca. ----------------------------------------------------------------- */ var DOWNLOAD_CATEGORIES = [ { key: 'logotipos', label: 'Logotipo (JPG, PNG, PDF...)', sublabel: 'Pack de marca', icon: '' }, { key: 'presentacion', label: 'Plantilla PPTX Corporativa', sublabel: 'Formato PPTX', icon: '' }, { key: 'word', label: 'Documentos Modelo', sublabel: 'Formato DOCX', icon: '' }, { key: 'firma', label: 'Firma corporativa', sublabel: 'Generador de firma de correo', icon: '' }, { key: 'fondo_ordenador', label: 'Fondo de Pantalla', sublabel: 'Ordenador (Escritorio)', icon: '' }, { key: 'fondo_movil', label: 'Fondo para Móvil', sublabel: 'Fondo de pantalla', icon: '' }, { key: 'fondo_teams', label: 'Fondo para Videollamadas', sublabel: 'Microsoft Teams', icon: '' }, { key: 'fondo_whatsapp', label: 'Fondo de WhatsApp', sublabel: 'Foto de perfil - WhatsApp', icon: '' }, { key: 'cabecera_linkedin', label: 'Cabecera LinkedIn', sublabel: 'Foto para cabecera', icon: '' }, { key: 'logotipo_eng', label: 'Logotipo ENG', sublabel: '', onlyIn: ['espana'], icon: '' }, { key: 'font', label: 'Tipografías: Segoe UI y Calibri', sublabel: 'Ya instaladas en tu ordenador con Windows y Microsoft 365', infoOnly: true, icon: '' } /* Para añadir una categoría nueva, copia desde la línea "{" hasta la línea "}," de arriba, pégala aquí debajo, cambia key/label/ sublabel/icon. Si no tienes un SVG a mano, puedes dejar el mismo icono de otra categoría como provisional. RECUERDA: si añades una categoría nueva aquí, tienes que añadir también su URL en CADA sucursal/marca en la sección 1.2 y 1.3, o esa tarjeta aparecerá sin enlace de descarga. */ ]; /* ----------------------------------------------------------------- 1.2 COLORES POR EMPRESA Cada color lleva HEX (el único editable a mano con seguridad), y RGB / CMYK / Pantone ya calculados. IMPORTANTE sobre estos 3 valores derivados: - RGB: conversión matemática exacta del HEX. Siempre fiable. - CMYK: fórmula estándar de conversión (la misma que usan Photoshop/Illustrator sin perfil ICC). Aproximación de trabajo, no un valor certificado de imprenta. - Pantone: el código Pantone Coated visualmente MÁS CERCANO, calculado por distancia de color en espacio LAB contra el catálogo público Pantone Solid Coated. NO es el Pantone oficial de la marca (no existe documentado en ningún manual). El campo "distancia" indica cuán cercano es el match: por debajo de 3 es muy fiable, entre 3 y 6 es razonable, por encima de 6 es solo orientativo. Si cambias un HEX aquí, los valores RGB/CMYK/Pantone que aparecen no se recalculan solos (esto es HTML+JS estático, no tiene un motor de color en vivo). Si cambias un color de marca, dímelo y te recalculo los 3 valores derivados correctamente. ----------------------------------------------------------------- */ var COMPANY_DATA = { cps: { name: 'CPS', sidebarSubtitle: '4 sucursales', tagline: 'Recursos corporativos', logoUrl: 'https://cps.es/wp-content/uploads/brand-center/cps.png', // <-- pega aquí la URL pública del logo de CPS (PNG/SVG) logoInitials: 'CPS', colors: [ { label: 'Principal', hex: '#211261', rgb: '33, 18, 97', cmyk: '100, 100, 32, 23', pantone: 'PANTONE 273 C', pantoneDist: 2.0 }, { label: 'Secundario', hex: '#B8D8EB', rgb: '184, 216, 235', cmyk: '32, 6, 6, 8', pantone: 'PANTONE 290 C', pantoneDist: 1.0 }, { label: 'Apoyo', hex: '#DDE5ED', rgb: '221, 229, 237', cmyk: '10, 2, 0, 0', pantone: 'PANTONE 656 C', pantoneDist: 5.3 }, /* Para añadir un color nuevo a CPS, copia un bloque { ... } completo de arriba, pégalo aquí, cambia label y hex, y dime el HEX para que te calcule rgb/cmyk/pantone exactos. */ ], branches: [ { key: 'espana', label: 'CPS España', downloadUrls: { logotipos: 'https://drive.google.com/uc?export=download&id=1sA78EwwapiANEwVgM2oRLhDH95raOlGo', logotipo_eng:'https://drive.google.com/uc?export=download&id=1sYfQsq7iIZ0V4IzPDRD0ifmZQoYrQnkm', word: 'https://drive.google.com/uc?export=download&id=1VTDhiSHWeb-bYxyaX4aKvbjIZuxzoA2a', firma: 'https://drive.google.com/uc?export=download&id=1AvNkCPma4zyfSdS1Y5ZzvIsozIUA1g3M', presentacion: 'https://drive.google.com/uc?export=download&id=1zUuyZe5RTPHI6gHO3CHaSQuQusNKGOwL', fondo_ordenador: 'https://drive.google.com/uc?export=download&id=133rptyBYzVPdXnBAryopG2-rYKCD7nEh', fondo_movil: 'https://drive.google.com/uc?export=download&id=1w_pSkdCrduA3UuY4iMQthDHtMqQmEfyb', fondo_teams: 'https://drive.google.com/uc?export=download&id=1EOiR8AW8CHxeYxq7TRyqE8rpkIL6t0V8', fondo_whatsapp: 'https://drive.google.com/uc?export=download&id=1YTD1TUDWuYu7r8cNP4Gf_EAva-AD2LMU', cabecera_linkedin: 'https://drive.google.com/uc?export=download&id=1J4_nnppcbkxhB6SQUyaYqgu97k60pmm9', dossier: 'https://drive.google.com/uc?export=download&id=1mth1uUNUxkGSTlIZrk8rSjy3rEa03jAF' } }, { key: 'colombia', label: 'CPS Colombia', downloadUrls: { logotipos: 'https://drive.google.com/uc?export=download&id=1z9xI4f29CazHpZ-mH6GG51sconbJPG0l', presentacion: 'https://drive.google.com/uc?export=download&id=1ECJV63ZiGlhLOMIGxmkJk8ULAl5md15L', fondo_ordenador: 'https://drive.google.com/uc?export=download&id=1YcJNvDp9_o__sHv6iGgEvD6se4IQNhpX', fondo_movil: 'https://drive.google.com/uc?export=download&id=1XYNh7DS3gaEd4loU9cZ0AqWrWqQOBjKD', fondo_teams: 'https://drive.google.com/uc?export=download&id=1oIxpyIO1OIxXibVajU0YQ5dJcmWjyIPc', fondo_whatsapp: 'https://drive.google.com/uc?export=download&id=1V85BmEk1t1i68njHYF9CuRpa9u-EN4xE', cabecera_linkedin: 'https://drive.google.com/uc?export=download&id=1pDvL-DlwvYI-ywUmP5IZjif7RbUOctoI', word: 'https://drive.google.com/uc?export=download&id=18puC0uRDPFYvmr7tqB-cGlvHwP8QuKKb', firma: 'https://drive.google.com/uc?export=download&id=1n7LoUUoRBl3ONLLISfTu2crZvQ7BpSPG' } }, { key: 'peru', label: 'CPS Perú', downloadUrls: { logotipos: 'https://drive.google.com/uc?export=download&id=1Ugb0xkpzR_-8bACsnW84s03j26rNo_qM', presentacion: 'https://drive.google.com/uc?export=download&id=1e2s7K4soSOVhjvssmxnQRPp5BcObQ5FV', fondo_ordenador: 'https://drive.google.com/uc?export=download&id=14jsx4bvDJyA1D-gtSqfML7BnvsUio_N_', fondo_movil: 'https://drive.google.com/uc?export=download&id=1TRCQm6HJnFMA1Fi9mjDpamDbaKAGRohY', fondo_teams: 'https://drive.google.com/uc?export=download&id=1sYvfes2AMBTe-LkAZwC1Mh4teWXe9S5T', fondo_whatsapp: 'https://drive.google.com/uc?export=download&id=19-pFvgo8yQo9oNhjLdbN8__GkRfh7V-L', cabecera_linkedin: 'https://drive.google.com/uc?export=download&id=1_YcKeTcbDXRuiWcHYO3bWOyO5ZXsQU09', word: 'https://drive.google.com/uc?export=download&id=1fQbeZTBOUNmh_kY9RrbvPIhxE-XVrWQ0', firma: 'https://drive.google.com/uc?export=download&id=15Y7BjXqYAUFDUv0kojgEbo8fbbEsFALy' } }, { key: 'mexico', label: 'CPS México', downloadUrls: { logotipos: 'https://drive.google.com/uc?export=download&id=1LSYOvstDus_MfU44DV4xAsuN6AB5VlDS', presentacion: 'https://drive.google.com/uc?export=download&id=1QKTbKiWBgvza4n_2I-x9Pm5gvBZ9PXws', fondo_ordenador: 'https://drive.google.com/uc?export=download&id=16IpsyF1xhcdQHW3qwk6MkKYCAzqdKnDl', fondo_movil: 'https://drive.google.com/uc?export=download&id=1GeL6itE9xaw5CJitMCGv5INnSioRbt9i', fondo_teams: 'https://drive.google.com/uc?export=download&id=1uOPUJ8IE6JA6qy7C-a1Ke1CWL4wZ001q', fondo_whatsapp: 'https://drive.google.com/uc?export=download&id=1DhwiTeXDigL9hc50UcXaW7NWgyvrzpfu', cabecera_linkedin: 'https://drive.google.com/uc?export=download&id=1D7zl977f8xopni5HQ3WJPEJH6tx016Fo', word: 'https://drive.google.com/uc?export=download&id=18puC0uRDPFYvmr7tqB-cGlvHwP8QuKKb', firma: 'https://drive.google.com/uc?export=download&id=1XDXDgomqx5hKtoSOyd2yoFQqZrvabceW' } } /* Para añadir una sucursal nueva, copia un bloque { key: '...', label: '...', downloadUrls: { ... } } completo de arriba y pégalo aquí. La key debe ir en minúsculas y sin espacios ni acentos (se usa internamente). El objeto downloadUrls debe tener una línea por cada key que exista en DOWNLOAD_CATEGORIES (sección 1.1, más arriba); si añades una categoría nueva ahí, añade también su key aquí en cada sucursal. */ ] }, pyg: { name: 'PYG', sidebarSubtitle: 'Agua y Medio Ambiente', tagline: 'Recursos corporativos', logoUrl: 'https://cps.es/wp-content/uploads/brand-center/pyg.png', // <-- pega aquí la URL pública del logo de PYG (PNG/SVG) logoInitials: 'PYG', colors: [ { label: 'Principal', hex: '#84C286', rgb: '132, 194, 134', cmyk: '32, 0, 31, 24', pantone: 'PANTONE 346 C', pantoneDist: 9.8 }, { label: 'Secundario', hex: '#323E48', rgb: '50, 62, 72', cmyk: '31, 14, 0, 72', pantone: 'PANTONE 432 C', pantoneDist: 0.8 }, { label: 'Apoyo', hex: '#4A68AF', rgb: '74, 104, 175', cmyk: '58, 41, 0, 31', pantone: 'PANTONE 7456 C', pantoneDist: 5.3 } ], branches: [], // PYG no tiene sub-sucursales downloadUrls: { logotipos: 'https://drive.google.com/uc?export=download&id=10brPLASftlca6FHHgl6ASyFH9yJWwfJx', presentacion: 'https://drive.google.com/uc?export=download&id=1mpyDmlybQ-U7OBAGfzay7q5we3wv_ZLm', fondo_ordenador: 'https://drive.google.com/uc?export=download&id=1TOobLhzvgUiUZ4dQ4SavGD24xnu82FBN', fondo_movil: 'https://drive.google.com/uc?export=download&id=1fZB75jpPBY8PfsOaT3e9v3GbUD8CR540', fondo_teams: 'https://drive.google.com/uc?export=download&id=1eAxq4ff-AatvGFDyGryld32S4QIg_r2L', fondo_whatsapp: 'https://drive.google.com/uc?export=download&id=18W4Z3NPsigU8gOOoFpOqBNuM8tFQx5Hd', cabecera_linkedin: 'https://drive.google.com/uc?export=download&id=1DUnXgt1Hy5JnYfJ-gA7wNdd63nba8j7y', word: 'https://drive.google.com/uc?export=download&id=1d2XKujG3gh2xzpZYg8UqID_wVWfLWBkr', firma: 'https://drive.google.com/uc?export=download&id=1AvNkCPma4zyfSdS1Y5ZzvIsozIUA1g3M' } }, eyser: { name: 'Eyser Ingeniería', sidebarSubtitle: 'Ingeniería', tagline: 'Recursos corporativos', logoUrl: 'https://cps.es/wp-content/uploads/brand-center/eyser.png', // <-- pega aquí la URL pública del logo de Eyser (PNG/SVG) logoInitials: 'EY', colors: [ { label: 'Principal', hex: '#71962C', rgb: '113, 150, 44', cmyk: '25, 0, 71, 41', pantone: 'PANTONE 370 C', pantoneDist: 4.6 }, { label: 'Secundario', hex: '#8B6530', rgb: '139, 101, 48', cmyk: '0, 27, 65, 45', pantone: 'PANTONE 7559 C', pantoneDist: 5.5 }, { label: 'Apoyo', hex: '#000000', rgb: '0, 0, 0', cmyk: '0, 0, 0, 100', pantone: 'Negro puro', pantoneDist: 5.5 } ], branches: [], // Eyser no tiene sub-sucursales downloadUrls: { logotipos: 'https://drive.google.com/uc?export=download&id=1I-ljBWmyAhU_L_LtsK-oXz_5Zg_yHU93', presentacion: 'https://drive.google.com/uc?export=download&id=1hRH-g3rbq4zH2sD7HEsarOwDEz2K3zpu', fondo_ordenador: 'https://drive.google.com/uc?export=download&id=1EZVaabC2tpwH6FLlMFqvWcwLZiaqcByq', fondo_movil: 'https://drive.google.com/uc?export=download&id=1Lv7RZ18GLlIwKB-UhcJvHlxrD3no-kEw', fondo_teams: 'https://drive.google.com/uc?export=download&id=1zWckaNYEXjCp8hPgdETwSEkGyFIiraen', fondo_whatsapp: 'https://drive.google.com/uc?export=download&id=1po-RntDoXXPIT6Udf0xW0etQ53ZOoKSr', cabecera_linkedin: 'https://drive.google.com/uc?export=download&id=1euhFgJRcXDNtdhdhNjLVIE1yFiM53hKq', word: 'https://drive.google.com/uc?export=download&id=1i0z67B3VkvgQTrH6YjTn9wO4QB-Mp2UW', firma: 'https://drive.google.com/uc?export=download&id=1AvNkCPma4zyfSdS1Y5ZzvIsozIUA1g3M' } } /* Para añadir una EMPRESA nueva (ej: una cuarta marca), copia todo un bloque "claveempresa: { ... }," desde "cps:" hasta su cierre "}," y pégalo aquí. Después añade su clave al array COMPANY_ORDER justo abajo, para que aparezca en el sidebar. */ }; // Orden de aparición en el sidebar. Si añades una empresa nueva // arriba, añade también su clave aquí en la posición que quieras. var COMPANY_ORDER = ['cps', 'pyg', 'eyser']; /* ================================================================= ╔═══════════════════════════════════════════════════════════════╗ ║ A PARTIR DE AQUÍ: LÓGICA DEL SITIO ║ ║ No necesitas tocar nada de lo que sigue para añadir ║ ║ colores, categorías de descarga, sucursales o marcas. ║ ╚═══════════════════════════════════════════════════════════════╝ ================================================================= */ var DOWNLOAD_CARD_ICON_CLOSE = ''; /* Tarjeta de descarga: el grosor y color del borde en reposo se controlan aquí con "border-2 border-gray-200" (2px, gris medio). Para hacerlo más o menos grueso, cambia "border-2" por "border" (1px) o "border-4" (4px). Para cambiar el color en reposo, cambia "border-gray-200" por otro tono de la escala de grises de Tailwind (gray-100 más sutil, gray-300 más marcado). El color al pasar el ratón ya usa el color principal de la marca activa (hover:border-brand-primary), eso no hace falta tocarlo. */ function buildInfoCard(category) { return ( '
' + '' + '' + category.icon + '' + '' + '' + '' + category.label + '' + '' + category.sublabel + '' + '' + '
' ); } function buildDownloadCard(category, downloadUrls) { if (category.infoOnly) return buildInfoCard(category); var url = (downloadUrls && downloadUrls[category.key]) || '#'; // Mientras la URL siga siendo '#' (sin rellenar), el enlace no hace // nada y se queda en la misma pestaña. En cuanto pegues una URL // real de Google Drive, se abre automáticamente en pestaña nueva // (target="_blank"), para que el usuario no salga del Brand Center. var isRealUrl = url !== '#'; var targetAttr = isRealUrl ? ' target="_blank" rel="noopener"' : ''; return ( '' + '' + '' + category.icon + '' + '' + '' + '' + category.label + '' + '' + category.sublabel + '' + '' + DOWNLOAD_CARD_ICON_CLOSE + '' ); } function buildDownloadGrid(downloadUrls, branchKey) { var html = '
'; DOWNLOAD_CATEGORIES.forEach(function (category) { // Si la categoría tiene "onlyIn" definido, solo se muestra cuando // el branchKey actual está en esa lista. Sin "onlyIn", se muestra // siempre (comportamiento normal, sin cambios para el resto). var isRestricted = Array.isArray(category.onlyIn); var allowedHere = !isRestricted || (branchKey && category.onlyIn.indexOf(branchKey) !== -1); if (!allowedHere) return; html += buildDownloadCard(category, downloadUrls); }); html += '
'; return html; } function buildPantoneLabel(color) { if (color.pantoneDist === 0) { // Caso blanco/negro puro: el texto ya lo explica todo return '' + color.pantone + ''; } var confidence = color.pantoneDist <= 3 ? 'muy cercano' : (color.pantoneDist <= 6 ? 'cercano' : 'orientativo'); return ( '' + color.pantone + '' ); } function buildColorCard(color) { return ( '
' + '
' + '
' + '

' + color.label + '

' + '
' + '' + '
' + 'Rgb' + color.rgb + '' + '
' + '
' + 'Cmyk' + color.cmyk + '' + '
' + '
' + 'Pantone' + buildPantoneLabel(color) + '
' + '
' ); } function buildLogoMarkup(company, sizeClasses) { var initials = company.logoInitials; var companyKey = Object.keys(COMPANY_DATA).filter(function (k) { return COMPANY_DATA[k] === company; })[0]; if (company.logoUrl) { // Sin caja ni fondo: el logo se muestra "desnudo", limitado en // altura por sizeClasses para no descontrolar el layout. Si la // imagen falla en cargar, el onerror la sustituye por el // placeholder con iniciales (ese sí lleva caja, para que las // iniciales se lean bien sobre cualquier fondo de página). return ( '<img src="' + company.logoUrl + '" alt="Logo ' + company.name + '" class="' + sizeClasses + ' flex-shrink-0 brand-logo-image" ' + 'onerror="this.outerHTML=\'
' + initials + '
'.replace(/"/g, '"') + '\';">' ); } return '
' + initials + '
'; } function buildTypographyBlock() { return ( '
' + '
' + '

Primaria · Segoe UI

' + '
' + '

Aa Bb Cc Dd Ee Ff Gg 123456

' + 'Bold' + '
' + '
' + '

Aa Bb Cc Dd Ee Ff Gg 123456

' + 'Regular' + '
' + '
' + '
' + '

Secundaria · Calibri

' + '
' + '

Aa Bb Cc Dd Ee Ff Gg 123456

' + 'Bold' + '
' + '
' + '

Aa Bb Cc Dd Ee Ff Gg 123456

' + 'Regular' + '
' + '
' + '
' ); } function buildCompanyView(companyKey) { var company = COMPANY_DATA[companyKey]; var hasBranches = company.branches.length > 0; /* Header de marca: texto a la izquierda, logo a la derecha, gracias a "justify-between" en el contenedor flex. El tamaño del logo es RESPONSIVE: 'w-20 h-20' (80px) en móvil, y a partir de tablet (prefijo sm:) sube a 'sm:w-40 sm:h-40' (160px, el doble). Esto evita que el logo grande se desborde en pantallas estrechas. Para cambiar el tamaño de escritorio, edita los números después de "sm:" (cada unidad de Tailwind = 4px). Para cambiar también el tamaño en móvil, edita los números SIN el prefijo "sm:". */ var headerInner = '
' + '
' + '

' + company.name + '

' + '

' + company.tagline + '

' + '
' + buildLogoMarkup(company, 'w-20 h-20 sm:w-40 sm:h-40') + '
'; var colorsHtml = '
' + '

Paleta de Colores

' + '
' + company.colors.map(buildColorCard).join('') + '
' + '
'; var typographyHtml = '
' + '

Tipografía

' + buildTypographyBlock() + '
'; var downloadsHtml; if (hasBranches) { var tabsHtml = '
' + '' + '
'; var panelsHtml = company.branches.map(function (branch, i) { return ( '
' + '

' + branch.label + ' · Descargables

' + buildDownloadGrid(branch.downloadUrls, branch.key) + '
' ); }).join(''); downloadsHtml = tabsHtml + panelsHtml; } else { downloadsHtml = '
' + '

Repositorio de Descargables

' + buildDownloadGrid(company.downloadUrls) + '
'; } var bodyContent = colorsHtml + typographyHtml + downloadsHtml; return ( '
' + headerInner + bodyContent + '
' ); } function renderAllCompanyViews() { var container = document.getElementById('company-views-container'); var html = ''; COMPANY_ORDER.forEach(function (key) { html += buildCompanyView(key); }); container.innerHTML = html; } /* ================================================================= 2. SIDEBAR Y MENÚ MÓVIL (generados desde COMPANY_DATA) ================================================================= */ function buildSidebarButton(companyKey, mobile) { var company = COMPANY_DATA[companyKey]; var attr = mobile ? 'data-company-btn-mobile' : 'data-company-btn'; var isActive = companyKey === COMPANY_ORDER[0]; return ( '' ); } function renderSidebars() { var desktopNav = document.getElementById('sidebar-nav-desktop'); var mobileNav = document.getElementById('mobile-menu-panel'); var desktopHtml = ''; var mobileHtml = ''; COMPANY_ORDER.forEach(function (key) { desktopHtml += buildSidebarButton(key, false); mobileHtml += buildSidebarButton(key, true); }); desktopNav.innerHTML = desktopHtml; mobileNav.innerHTML = mobileHtml; } /* ================================================================= 3. NAVEGACIÓN ENTRE EMPRESAS ================================================================= */ function setActiveCompany(company) { if (COMPANY_ORDER.indexOf(company) === -1) return; document.body.setAttribute('data-active-company', company); COMPANY_ORDER.forEach(function (c) { var view = document.querySelector('[data-company-view="' + c + '"]'); if (!view) return; if (c === company) { view.classList.remove('hidden'); view.classList.add('view-enter'); } else { view.classList.add('hidden'); view.classList.remove('view-enter'); } }); document.querySelectorAll('[data-company-btn]').forEach(function (btn) { var isActive = btn.getAttribute('data-company-btn') === company; btn.setAttribute('data-active', isActive ? 'true' : 'false'); btn.classList.toggle('bg-gray-50', isActive); }); document.querySelectorAll('[data-company-btn-mobile]').forEach(function (btn) { var isActive = btn.getAttribute('data-company-btn-mobile') === company; btn.setAttribute('data-active', isActive ? 'true' : 'false'); btn.classList.toggle('bg-gray-50', isActive); }); var main = document.getElementById('main-content'); if (main) main.scrollTop = 0; } function attachCompanyNavListeners() { document.querySelectorAll('[data-company-btn]').forEach(function (btn) { btn.addEventListener('click', function () { setActiveCompany(btn.getAttribute('data-company-btn')); }); }); document.querySelectorAll('[data-company-btn-mobile]').forEach(function (btn) { btn.addEventListener('click', function () { setActiveCompany(btn.getAttribute('data-company-btn-mobile')); closeMobileMenu(); }); }); } /* ================================================================= 4. SUB-TABS DE SUCURSAL (cualquier empresa con branches.length > 0) ================================================================= */ function setActiveBranch(branchKey) { document.querySelectorAll('[data-cps-branch-btn]').forEach(function (btn) { var isActive = btn.getAttribute('data-cps-branch-btn') === branchKey; btn.setAttribute('data-active', isActive ? 'true' : 'false'); btn.classList.toggle('text-gray-400', !isActive); }); document.querySelectorAll('[data-cps-branch-panel]').forEach(function (panel) { var isActive = panel.getAttribute('data-cps-branch-panel') === branchKey; if (isActive) { panel.classList.remove('hidden'); panel.classList.add('view-enter'); } else { panel.classList.add('hidden'); panel.classList.remove('view-enter'); } }); } function attachBranchTabListeners() { document.querySelectorAll('[data-cps-branch-btn]').forEach(function (btn) { btn.addEventListener('click', function () { setActiveBranch(btn.getAttribute('data-cps-branch-btn')); }); }); } /* ================================================================= 5. MENÚ MÓVIL (HAMBURGUESA) ================================================================= */ var mobileToggle = document.getElementById('mobile-menu-toggle'); var mobilePanel = document.getElementById('mobile-menu-panel'); var iconOpen = document.getElementById('icon-menu-open'); var iconClose = document.getElementById('icon-menu-close'); function openMobileMenu() { mobilePanel.classList.remove('hidden'); iconOpen.classList.add('hidden'); iconClose.classList.remove('hidden'); mobileToggle.setAttribute('aria-expanded', 'true'); } function closeMobileMenu() { mobilePanel.classList.add('hidden'); iconOpen.classList.remove('hidden'); iconClose.classList.add('hidden'); mobileToggle.setAttribute('aria-expanded', 'false'); } if (mobileToggle) { mobileToggle.addEventListener('click', function () { var isOpen = mobileToggle.getAttribute('aria-expanded') === 'true'; if (isOpen) { closeMobileMenu(); } else { openMobileMenu(); } }); } /* ================================================================= 6. CLIC PARA COPIAR HEX ================================================================= */ var toast = document.getElementById('copy-toast'); var toastText = document.getElementById('copy-toast-text'); var toastTimeoutId = null; function showToast(message) { toastText.textContent = message; toast.classList.remove('opacity-0', 'translate-y-2'); toast.classList.add('opacity-100', 'translate-y-0'); if (toastTimeoutId) clearTimeout(toastTimeoutId); toastTimeoutId = setTimeout(function () { toast.classList.remove('opacity-100', 'translate-y-0'); toast.classList.add('opacity-0', 'translate-y-2'); }, 1800); } function copyTextFallback(text) { var textarea = document.createElement('textarea'); textarea.value = text; textarea.style.position = 'fixed'; textarea.style.left = '-9999px'; document.body.appendChild(textarea); textarea.select(); try { document.execCommand('copy'); } catch (err) { console.error('No se pudo copiar el texto: ', err); } document.body.removeChild(textarea); } function copyHexToClipboard(hex) { if (navigator.clipboard && window.isSecureContext) { navigator.clipboard.writeText(hex).then(function () { showToast('¡Copiado! ' + hex); }).catch(function () { copyTextFallback(hex); showToast('¡Copiado! ' + hex); }); } else { copyTextFallback(hex); showToast('¡Copiado! ' + hex); } } function attachCopyListeners() { document.querySelectorAll('[data-copy-hex]').forEach(function (swatch) { swatch.addEventListener('click', function () { copyHexToClipboard(swatch.getAttribute('data-copy-hex')); }); }); } /* ================================================================= 7. INICIALIZACIÓN ================================================================= */ renderAllCompanyViews(); renderSidebars(); attachCompanyNavListeners(); attachBranchTabListeners(); attachCopyListeners(); })();