Diferencia entre revisiones de «Usuario:RubiVGM/statsDynamicColors»

De Unión PokéPRO - Wiki
Ir a la navegaciónIr a la búsqueda
Sin resumen de edición
Sin resumen de edición
 
(No se muestran 2 ediciones intermedias del mismo usuario)
Línea 1: Línea 1:
document.addEventListener('DOMContentLoaded', function() {
importScript('Usuario:RubiVGM/statsDynamicColors.js');
  document.querySelectorAll('.stat-bar').forEach(function(bar) {
    var value = parseInt(bar.getAttribute('data-value'));  // Obtiene el valor de la estadística
    if (value < 50) {
      bar.style.backgroundColor = '#ff5959';  // Rojo
    } else if (value >= 50 && value < 100) {
      bar.style.backgroundColor = '#fae078';  // Naranja
    } else {
      bar.style.backgroundColor = '#a7db8d';  // Verde
    }
  });
});

Revisión actual - 21:42 28 ene 2025

importScript('Usuario:RubiVGM/statsDynamicColors.js');