Changeset 3446019
- Timestamp:
- 01/24/2026 08:58:53 AM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
madnesschat-button/tags/1.0.2/assets/js/mcnb-frontend-simple.js
r3411134 r3446019 197 197 offsetX: cfg.offsetX || 20, 198 198 offsetY: cfg.offsetY || 20, 199 showLabel: cfg.showLabel 199 showLabel: cfg.showLabel, 200 // Usar siempre el color de fondo configurado 201 brandColor: cfg.brandColor || '#25D366' 200 202 }; 201 203 } … … 312 314 // Aplicar estilos básicos 313 315 var size = currentConfig.size; 314 btn.style.width = size + 'px';315 btn.style.height = size + 'px';316 316 btn.style.background = currentConfig.brandColor || '#25D366'; 317 317 btn.style.color = cfg.textColor || '#ffffff'; 318 btn.style.boxSizing = 'border-box'; 318 319 btn.style.borderRadius = '50%'; 319 320 btn.style.display = 'flex'; … … 326 327 // Aplicar estilo de botón si está configurado 327 328 if (cfg.buttonStyle === 'square') { 329 btn.style.width = size + 'px'; 330 btn.style.height = size + 'px'; 328 331 btn.style.borderRadius = '8px'; 329 332 } else if (cfg.buttonStyle === 'pill') { 333 // Permitir que el botón se estire horizontalmente 334 btn.style.width = 'auto'; 335 btn.style.height = 'auto'; 336 btn.style.minWidth = size + 'px'; 337 btn.style.minHeight = size + 'px'; 330 338 btn.style.borderRadius = '999px'; 331 btn.style.padding = '0 16px';339 btn.style.padding = '0 ' + Math.round(size * 0.35) + 'px'; 332 340 } else if (cfg.buttonStyle === 'text_side') { 341 // Permitir texto al lado dentro del botón (ancho automático) 342 btn.style.width = 'auto'; 343 btn.style.height = 'auto'; 344 btn.style.minWidth = size + 'px'; 345 btn.style.minHeight = size + 'px'; 333 346 btn.style.borderRadius = '999px'; 334 btn.style.padding = '12px 20px';347 btn.style.padding = Math.round(size * 0.22) + 'px ' + Math.round(size * 0.4) + 'px'; 335 348 btn.style.gap = '8px'; 349 } else { 350 // circle (default) 351 btn.style.width = size + 'px'; 352 btn.style.height = size + 'px'; 336 353 } 337 354
Note: See TracChangeset
for help on using the changeset viewer.