| Panel | '; products.forEach(function(p) { var domain = p.domain || 'solarreviews.com'; var logoUrl = 'https://img.logo.dev/' + domain + '?token=' + logoToken + '&format=png&size=200'; var score = scores.find(function(s) { return s.slug === p.slug; }); var scorePct = score ? Math.round(score.score / maxScore * 100) : 0; var scoreColor = scorePct >= 80 ? '#34d399' : scorePct >= 60 ? '#fbbf24' : '#f87171'; html += '' +
' ' +
' ' +
'' +
' ' +
'' +
' ' +
// Score bar
'' + p.model + ' ' +
'' + p.brand + ' ' +
'' +
' ' +
'View Specs →' +
'' +
'' +
'' +
' ' +
'' + scorePct + '%' +
' | ';
});
html += '|
|---|---|---|
| ' + f.label + ' | '; products.forEach(function(p) { var val = p[f.key]; var dispVal = val !== undefined && val !== null ? val : '—'; if (f.type === 'bar' && f.bw && val !== undefined && val !== null && !isNaN(val)) { var pct = barStyle(val, f.bw.best, f.bw.worst, f.bw.range, f.higher); var isBest = val === f.bw.best; var isWorst = val === f.bw.worst; var barColor = isBest ? '#34d399' : isWorst ? '#f87171' : '#f59e0b'; html += '' +
' ' +
'' + val + (f.unit || '') + '' +
' ' +
'' +
'' +
' ' +
' | ';
} else {
if (f.unit && dispVal !== '—') dispVal += f.unit;
html += '' + dispVal + ' | '; } }); html += '