data => ['keyboard/altgr/index.inc.plp', @incs],
raw => <<'.',
<style>
-table.keys {
- display: inline-table;
+.keys.cmp {
+ display: inline-table; /* centered */
+ float: none;
margin: 0;
+ border-collapse: separate;
+ border-spacing: 2px;
+ border-spacing: .4vw; /* inline td margin equivalent */
}
-dt {
- display: flex;
- flex-direction: column;
- justify-content: center;
+.keys.big.cmp tbody {
+ font-size: 150%;
}
-dt img {
- max-height: 10ex;
+.keys.cmp tbody {
+ display: table-row-group;
}
+.keys.cmp tr {
+ display: table-row;
+}
+.keys.cmp tr > * {
+ display: table-cell;
+ position: static; /* under sticky thead */
+}
+.keys.cmp tbody th {
+ padding-right: 1ex;
+ text-align: right;
+}
+
img {
object-fit: cover;
height: 100%;
:>
<h1>Extended keyboards</h1>
-<p>Available key layouts with AltGr or similar modifier keys.</p>
+<p>Overview of available key layouts with AltGr or similar modifier keys.</p>
<:
my @sample = split /(?<!\+)/, $get{sample} // 'asSci1!+1';
require Shiar_Sheet::Keyboard;
printf '<section class="%s">', @sample ? 'section' : 'gallery';
-print '<dl>' if @sample;
+if (@sample) {
+ print '<table class="big keys cmp">';
+ print '<thead><tr><th>';
+ print "<th>$_" for @sample;
+ say '</tr></thead>';
+}
my %idx = map {s/\Q.inc.pl\E$//; ($_ => eval{ Data($_) })} @incs;
for my $inc (sort {
$idx{$a}{category} cmp $idx{$b}{category} || $a cmp $b
} keys %idx) {
- print @sample ? '<dt>' : '<figure>';
+ print @sample ? '<tr><th>' : '<figure>';
printf '<a href="/%s">', $inc =~ s/\.eng$//r;
my $table = $idx{$inc};
my $title = $table && $table->{title} || $inc;
print $title;
print '</a>';
my $keys = Shiar_Sheet::Keyboard->new($table);
- print join(' ', map { $keys->{key}{$_} =~ s/\s.*//r } grep {$_} keys %{$_})
+ print '<br>', join(' ', map { $keys->{key}{$_} =~ s/\s.*//r } grep {$_} keys %{$_})
for $keys->{mode} || ();
- say '<dd><table class="keys big"><tr>';
$keys->print_key('', $_, $keys->{def}{''}{$_} // 'ni') for @sample;
- print '</tr></table>';
- say '</dd>';
+ say '</tr>';
}
}
-:></dl></section>
+print '</table>' if @sample;
+:></section>