<(common.inc.plp)><:
use 5.010;
+use utf8;
use List::Util qw(sum max);
Html({
printf '<colgroup span="%d">', scalar @{ $versions{$_} } for @browsers;
print "\n";
-print '<thead><tr>';
-print '<th colspan="3">feature';
-printf('<th colspan="%d">%s',
- scalar @{ $versions{$_} },
- do {
- my $name = $caniuse->{agents}->{$_}->{browser};
- length $name < 16 ? $name : $caniuse->{agents}->{$_}->{abbr};
- },
-) for @browsers;
-print '<th>%';
+my $header = join('',
+ '<tr>',
+ '<th colspan="3">feature',
+ (map {
+ sprintf('<th colspan="%d" title="%.1f%%">%s',
+ scalar @{ $versions{$_} },
+ sum(values %{ $canihas->{$_} }),
+ do {
+ my $name = $caniuse->{agents}->{$_}->{browser};
+ length $name < 16 ? $name : $caniuse->{agents}->{$_}->{abbr};
+ },
+ )
+ } @browsers),
+ '<th>%',
+);
+print '<thead>', $header;
# preceding row without any colspan to work around gecko bug
print "\n<tr>";
print '<td>' x 3;
});
print '<td>', int featurescore($caniuse->{data}->{$id}->{stats}) / $maxscore * 100;
}
+print '<tfoot>', $header;
print '</table>';
sub paddedver {
}
:>
+<script>
+var classmatch = /\bopacity(\d+)/;
+Array.forEach(document.getElementsByTagName('TD'), function(val) {
+ var opacity;
+ if (opacity = classmatch.exec(val.className)) {
+ var c = document.defaultView.getComputedStyle(val, null).getPropertyValue('background-color');
+ var o = opacity[1] / 100;
+ val.style.backgroundColor = c.replace(/rgb\((.*)\)/, 'rgba($1, '+o+')');
+ val.style.textShadow = c+' 1px 1px 2px, ' + c+' -1px -1px 2px';
+ }
+});
+alert(t);
+</script>
<hr>
<div class="legend">