From: Mark Wooding Date: Fri, 24 Dec 2021 17:32:57 +0000 (+0000) Subject: mason/dhandler, static/tgal.css: Embrace idea of multiple thumbnail sets. X-Git-Url: https://git.distorted.org.uk/~mdw/tgal/commitdiff_plain/6e749fabbf4a2758454db148bd366367069142c5 mason/dhandler, static/tgal.css: Embrace idea of multiple thumbnail sets. Rather than a single row of thumbnails, the code is now structured so that it might have several at the same time, with different sizes. CSS media queries can control which one actually gets displayed. Internally, we make two passes over a directory, fetching the images the first time through, and making scaled thumbnails afterwards, and introduce loops over the available sizes (though currently there's only the one). We're actually just making the same display as before, so there's still no functional change. --- diff --git a/mason/dhandler b/mason/dhandler index 7d76fdf..011c561 100755 --- a/mason/dhandler +++ b/mason/dhandler @@ -82,6 +82,16 @@ Failed to find ‘<% $path |h %>’. urlencode "$SCRIPTURL/$uplink"; } (my $nosl = $path) =~ s!/$!!; + + my %tn; + for my $f (@$ff) + { $tn{$f} = TrivGal::Image->new($path . $f->name); } + for my $d (@$dd) { + my ($ddd, $fff, $iii) = listdir $real . "/" . $d->name; + $tn{$d} = $iii ? + TrivGal::Image->new(join_paths $path, $d->name, $iii->name) : + undef; + } % <&| .html, title => "Folder " . $m->interp->apply_escapes($nosl || "[top]", "h"), @@ -97,29 +107,28 @@ Failed to find ‘<% $path |h %>’. % % if (@$dd) {

Subfolders

-