word/memory: manual grid size override option
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 31 Dec 2021 13:35:54 +0000 (14:35 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 7 Feb 2022 17:42:33 +0000 (18:42 +0100)
Temporary workaround for unsupported aspect ratio and custom amounts.

word/memory.plp

index 7bf757f6cc76d44a17c92d297a178b9c34f22ca9..11520b19b483d3a6860742e62b6ca151db83b39f 100644 (file)
@@ -78,5 +78,10 @@ figure.good {
 </style>
 EOT
 });
+if (my $gridsize = $get{grid}) {
+       printf "<style>#quiz {grid: repeat(%d, 1fr) / repeat(%d, 1fr)}</style>",
+               reverse split /\D+/, $gridsize;
+       say '';
+}
 say '<h1>memory</h1><p id="quiz"></p>';
 say "<script>new WordMemory('/$wordlistbase.json')</script>";