]> git.plutz.net Git - serve0/commitdiff
Merge branch 'master' of git.plutz.net:serve0
authorPaul Hänsch <paul@plutz.net>
Wed, 14 Apr 2021 15:48:45 +0000 (17:48 +0200)
committerPaul Hänsch <paul@plutz.net>
Wed, 14 Apr 2021 15:48:45 +0000 (17:48 +0200)
advsearch.sh
list.sh
style.css
thumbnail.sh
widgets.sh

index 3a2f33389fc54180bfc6f48dadee482d2a15c458..e21340f7e511aa8c92884149920fb90292204f27 100644 (file)
@@ -11,9 +11,11 @@ for n in 1 2 3 4 5 6 7 8 9; do
     tag="$(POST tag_$n $m)"
     [ ! "${tag##${cat}:*}" ] || [ ! "${tag##-${cat}:*}" ] || [ "$cat" = '*' -a "${tag##*:*}" ] \
     && f="${f}${tag}|"
+    [ "$cat" = \$ ] && f="${f}\$:${tag}|"
   done
   f="${f%[|^]}^"
 done
-f="${f%^}"
+f="$(printf '%s' "$f" |sed -E 's;[~|^]+$;;; s;\|\^;^;g;')"
+#f="${f%^}"
 
 REDIRECT "$(URL "${ITEM}")?o=${order}&f=${f}"
diff --git a/list.sh b/list.sh
index 6c09a43ad4983c216666384e77445f0b241d802f..60609b62c2f26c05dbeef788979d163ac0c178c3 100644 (file)
--- a/list.sh
+++ b/list.sh
@@ -51,10 +51,14 @@ list_item() {
   STRING "$FILTER^" \
   | sed -E 's;\^;\n;g; s;[]\/\(\)\\\^\$\?\.\+\*\;\[\{\}];\\&;g' \
   | while read -r f; do
-    [ "${f#\~}" ] || continue
-    [ "${f#\~}" = "$f" ] \
-    && fex="/(\ttags=([^\t]*,)?)(${f})((,[^\t]*)?\t)/{${fex}}" \
-    || fex="/(\ttags=([^\t]*,)?)(${f#\~})((,[^\t]*)?\t)/d; ${fex}"
+    [ "${f##*[A-Z]*}" ] && tl="y;ABCDEFGHIJKLMNOPQRSTUVWXYZ;abcdefghijklmnopqrstuvwxyz;;"
+    case $f in
+      ''|~) continue;;
+      ~\\\$:*) fex="h; ${tl} /${f#~\\\$:}/d; g;${fex}";;
+      \\\$:*) fex="h; ${tl} /${f#\\\$:}/{g;${fex}}";;
+      ~*) fex="/(\ttags=([^\t]*,)?)(${f#\~})((,[^\t]*)?\t)/d; ${fex}";;
+       *) fex="/(\ttags=([^\t]*,)?)(${f})((,[^\t]*)?\t)/{${fex}}";;
+    esac
     printf '%s\n' "${fex}"
   done \
   | tail -n1
index ce9813a760137237fc1a5475020b58ed63a248c3..dd67361b51d8d14d09e9bb3ecdb6cd21e3c50368 100644 (file)
--- a/style.css
+++ b/style.css
@@ -55,18 +55,25 @@ body {
   -padding: 0 .25em;
   margin: 0 .5%;
   margin-bottom: 1em;
+  overflow: hidden;
 }
-@media(min-width:  20em) { .itemlist .list { max-width: 49%; } }
-@media(min-width:  40em) { .itemlist .list { max-width: 32%; } }
-@media(min-width:  60em) { .itemlist .list { max-width: 24%; } }
-@media(min-width:  80em) { .itemlist .list { max-width: 19%; } }
-@media(min-width: 100em) { .itemlist .list { max-width: 19em; } }
 
 .itemlist .list img {
-  width: 100%; height: 11em;
+  -width: 1000%; height: 11em;
+  max-width: unset;
   background-color: #111;
-  object-fit: contain;
+  object-fit: cover;
+  transform: translate(-05%, 0);
+  margin-left: 50%;
+}
+.itemlist .list:hover img {
+  animation: thumbscroll 8s steps(10, end) infinite;
+}
+@keyframes thumbscroll {
+  from { transform: translate(-05%, 0);}
+  to   { transform: translate(-105%, 0);}
 }
+
 .itemlist .list label {
   display: block;
   font-weight: bolder;
@@ -141,7 +148,7 @@ body {
   word-break: break-word;
 }
 
-/* ====== ADVSEARCH PANEL ====== */
+/* ====== ADVSEARCH / FILTER PANEL ====== */
 
 #advsearch:target {
   display: block; position: fixed;
@@ -171,10 +178,11 @@ body {
 }
 #advsearch fieldset.select {
   display: inline-block;
-  width: 18em; max-width: 100%;
-  margin: 0 .5em; padding: 0 .375em;
+  width: 99%;
+  margin: 0 .5%; margin-bottom: .75em; padding: 0 .375em;
   box-shadow: .125em .125em .25em #000;
 }
+
 #advsearch fieldset.select > label.head {
   display: none;
   width: 40%;
@@ -205,9 +213,13 @@ body {
 #advsearch input.and { display: none; }
 #advsearch input.and + label { display: none; }
 #advsearch input.and + label + fieldset { display: none; }
-#advsearch input.and:checked + label + fieldset { display: inline-block; }
-#advsearch input.and:checked + label + fieldset + input + label { display: inline-block; }
+#advsearch input.and:checked + label + fieldset,
+#advsearch input.and:first-of-type + label + fieldset { display: inline-block; }
+#advsearch input.and:checked + label + fieldset + input + label,
+#advsearch input.and:first-of-type + label + fieldset + input + label { display: inline-block; }
 #advsearch input.and:checked + label + fieldset + input:checked + label { display: none; }
+#advsearch input.and:first-of-type + label + fieldset + input:checked + label { display: none; }
+
 
 /* ====== MULTITAG DIALOG ====== */
 
@@ -230,11 +242,6 @@ body {
   width: 99%;
   margin: 0 .5%; margin-top: 1em;
 }
-@media(min-width:  20em) { #multitag fieldset { max-width: 49%; } }
-@media(min-width:  40em) { #multitag fieldset { max-width: 32%; } }
-@media(min-width:  60em) { #multitag fieldset { max-width: 24%; } }
-@media(min-width:  80em) { #multitag fieldset { max-width: 19%; } }
-@media(min-width: 100em) { #multitag fieldset { max-width: 19em; } }
 
 #multitag fieldset select {
   width: 100%; height: 10em;
@@ -266,3 +273,12 @@ body#view .tag {
   padding: 0 .25em;
   border-radius: 1pt;
 }
+
+
+/* ====== SCALE BLOCK ELEMENTS ====== */
+
+@media(min-width:  20em) { .itemlist .list, #advsearch fieldset.select, #multitag fieldset { max-width: 49%; } }
+@media(min-width:  40em) { .itemlist .list, #advsearch fieldset.select, #multitag fieldset { max-width: 32%; } }
+@media(min-width:  60em) { .itemlist .list, #advsearch fieldset.select, #multitag fieldset { max-width: 24%; } }
+@media(min-width:  80em) { .itemlist .list, #advsearch fieldset.select, #multitag fieldset { max-width: 19%; } }
+@media(min-width: 100em) { .itemlist .list, #advsearch fieldset.select, #multitag fieldset { max-width: 19em; } }
index f6d212ca8bedb5845d2841ed2151aa31206ff61f..5575c3723f6e0080ff8c1ce029d9a490123683a4 100644 (file)
@@ -13,10 +13,10 @@ gen_thumb(){
       | sed -rn 's:ID_LENGTH=(.*)(\..*)$:\1:p;' \
     )"
   
-    chunk="$((${l:-10} / 5))"
+    chunk="$((${l:-10} / 11))"
     
     tmp="$(mktemp -d)"
-    for cnt in 1 2 3 4; do
+    for cnt in 1 2 3 4 5 6 7 8 9 10; do
       printf '' \
       | mplayer -input nodefault-bindings -nosound -benchmark \
                 -noconfig all -really-quiet \
@@ -29,8 +29,8 @@ gen_thumb(){
     printf '' \
     | mplayer -input nodefault-bindings -nosound -benchmark \
               -noconfig all -really-quiet \
-              -vf scale=159:-2,tile=2:2:4:0:2 \
-              -vo jpeg:quality=96:outdir="${tmp}"\
+              -vf expand=:::::16/9,scale=320:-2,tile=10:1:10:0:0 \
+              -vo jpeg:quality=85:outdir="${tmp}"\
               "mf://$tmp/_*.jpg" 2>&-
   
     mv "${tmp}/00000001.jpg" "$thumb"
index cd9dda30ca344037e5db60751e9c8a990eec9bfe..4b36b3534e8629c992c46a9309814131c37b1843 100644 (file)
@@ -188,7 +188,7 @@ w_advsearch(){
             $n "${t:+checked}" $n $n
 
     f="|${f#\~}|"
-    printf '*\n%s\n' "$w_tagcategories" \
+    printf '*\n%s\n$\n' "$w_tagcategories" \
     | while read -r category; do
       lbid="cat_${n}_${category}"
 
@@ -217,6 +217,8 @@ w_advsearch(){
         # printf '[option %s value="%s"\n%s]' "$t" "$tag" "$d"
        printf '[label [checkbox "tag_%s" "%s" %s] %s]' "$n" "$tag" "$t" "$d"
       done
+      d="${f##*\$:}" d="${d%%\|*}"
+      [ "$category" = \$ ] && printf '[input name="tag_%i" value="%s"]' "$n" "$(HTML "$d")"
       printf '\n]'
     done
     printf ']'