From 6e749fabbf4a2758454db148bd366367069142c5 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Fri, 24 Dec 2021 17:32:57 +0000 Subject: [PATCH] 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. --- mason/dhandler | 47 +++++++++++++++++++++++++++++------------------ static/tgal.css | 6 ++++-- 2 files changed, 33 insertions(+), 20 deletions(-) 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

-