]> git.plutz.net Git - serve0/blobdiff - templates/playctl.html.sh
simplified styling
[serve0] / templates / playctl.html.sh
index 1725f7f784ce1b7c489ca04a2cbe4ff409e6a5ed..ad1ed9346e9b43e7bf41283da5ee2b080e4555da 100755 (executable)
@@ -16,7 +16,7 @@
 # along with Serve0  If not, see <http://www.gnu.org/licenses/>. 
 
 cat <<EOF
-<form class="panel" id="search" style="display: block;" action="?" method="get" accept-charset="UTF-8">
+<form class="panel top" id="search" style="display: block;" action="?" method="get" accept-charset="UTF-8">
   <input type="text" name="s" value="$search" placeholder="Search">
 
   <label for="o1" class="order">Order by:</label>
@@ -35,79 +35,91 @@ cat <<EOF
   <h1>$info</h1>
   <a href="$video">Download</a>
 
-  <form action="?action=playctl" method="post">
-     <button type="submit" name="seek" value="-60">&lt;&lt;&lt;</button>
-     <button type="submit" name="seek" value="-10">&lt;&lt;</button>
-     <button type="submit" name="ctl" value="stop">&#x25a0;</button>
-     <button type="submit" name="ctl" value="pause">|| / &#x25b6;</button>
-     <button type="submit" name="seek" value="+10">&gt;&gt;</button>
-     <button type="submit" name="seek" value="+60">&gt;&gt;&gt;</button>
-     <br>
-     <button type="submit" name="amp" value="off">Amp Off</button>
-     <button type="submit" name="amp" value="on">Amp On</button>
-     <br>
-     $(for n in $(seq 0 5 100); do
-       printf '<button class="%s" type="submit" name="vol" value="%s">&nbsp;</button>' "$([ "$volume" = "$n" ] && printf selected)" "$n"
-     done)
-     <br>
-     <!--button type="submit" name="osd" value="progression">Progress</button -->
+  <form action="?action=playctl" method="post" class="playctl">
+    <fieldset class="playback">
+      <button type="submit" name="seek" value="-60">&lt;&lt;&lt;</button>
+      <button type="submit" name="seek" value="-10">&lt;&lt;</button>
+      <button type="submit" name="ctl" value="stop">&#x25a0;</button>
+      <button type="submit" name="ctl" value="pause">|| / &#x25b6;</button>
+      <button type="submit" name="seek" value="+10">&gt;&gt;</button>
+      <button type="submit" name="seek" value="+60">&gt;&gt;&gt;</button>
+    </fieldset>
+    <fieldset class="volume">
+      $(for n in $(seq 0 5 100); do
+        printf '<button class="%s" type="submit" name="vol" value="%s">&nbsp;</button>' "$([ "$volume" = "$n" ] && printf selected)" "$n"
+      done)
+    </fieldset>
   </form>
 
-  <span class="info length">$(($length / 60)):$(($length % 60)) min</span>
+  <span class="info length">$(printf "%d:%02d min" $(($length / 60)) $(($length % 60)) )</span>
   <span class="info width" >Width: $width</span>
   <span class="info height">Height: $height</span><br>
   
   $(printf %s\\n "$tags" |sed -r 's:\|*([^|]+)\|*:<span class="info tag">\1</span> :g')
   ${description:+<span class="info description">$(printf %s "$description" |_wiki)</span>}
+</div>
 
-  <form class="panel" id="tagger" action="?action=meta&${page_this}" method="post" accept-charset="UTF-8">
-    <input type="hidden" name="length" value="$length">
-    <input type="hidden" name="width" value="$width">
-    <input type="hidden" name="height" value="$height">
-
-    $(
-    for cat in $(list_categories); do
-      printf '<p class="newtag"><label class="category">%s:</label><select name="tag" size="12" multiple>' "${cat}"
-      catt="${cat}:"
-      [ "$catt" = "none:" ] && catt=''
-      
-      printf %s "$taglist_set" |egrep '^'"$catt"'[^:]+$' |while read line; do
-        printf '<option %s value="%s">%s</option>' \
-               "$(egrep -q "(^|.*\|)$line(\|.*|$)" "$meta" && printf selected)" \
-               "$line" "${line#*:}"
-      done
-      printf '</select></p>'
-    done
-    )
-
-    <p class="newtag additional">
-      <label class="additional">Additional Tags (one per line):</label>
-      <textarea name="tags" rows="4"></textarea>
-    </p>
-    <p class="newtag description">
-      <label class="description">Description:</label>
-      <textarea name="description" rows="4">$description</textarea>
-    </p>
-    <input type="submit" value="Edit!">
-    <input type="submit" name="trash" value="Delete Video">
-
-    <a class="panel toggle" href="#foot">Hide</a>
+<form class="panel switchable bottom playctl" id="advctl" action="?action=playctl" method="post">
+  <fieldset class="volume">
+    <button type="submit" name="amp" value="off">Amp Off</button>
+    <button type="submit" name="amp" value="on">Amp On</button>
+  </fieldset>
+  <fieldset class="pasink">
+    $(pa_sinks |while read no name; do
+      printf '<button type="submit" name="pasink" value="%s">%s</button>' "$no" "$name"
+    done)
+  </fieldset>
+  <a class="panel toggle" href="#foot">Hide</a>
+</form>
 
-  </form>
-</div>
+<form class="panel switchable bottom" id="tagger" action="?action=meta&${page_this}" method="post" accept-charset="UTF-8">
+  <input type="hidden" name="length" value="$length">
+  <input type="hidden" name="width" value="$width">
+  <input type="hidden" name="height" value="$height">
+
+  $(
+  for cat in $(list_categories); do
+    printf '<fieldset class="newtag"><label class="category">%s:</label><select name="tag" size="12" multiple>' "${cat}"
+    catt="${cat}:"
+    [ "$catt" = "none:" ] && catt=''
+    
+    printf %s "$taglist_set" |egrep '^'"$catt"'[^:]+$' |while read line; do
+      printf '<option %s value="%s">%s</option>' \
+             "$(egrep -q "(^|.*\|)$line(\|.*|$)" "$meta" && printf selected)" \
+             "$line" "${line#*:}"
+    done
+    printf '</select></fieldset>'
+  done
+  )
+
+  <fieldset class="newtag additional">
+    <label class="additional">Additional Tags (one per line):</label>
+    <textarea name="tags" rows="4"></textarea>
+  </fieldset>
+  <fieldset class="newtag description">
+    <label class="description">Description:</label>
+    <textarea name="description" rows="4">$description</textarea>
+  </fieldset>
+  <input type="submit" value="Edit!">
+  <input type="submit" name="trash" value="Delete Video">
+
+  <a class="panel toggle" href="#foot">Hide</a>
+</form>
 
 <div class="panel footer" id="foot">
   <a class="panel toggle" href="#tagger">Edit Tags</a>
+  <a class="panel toggle" href="#advctl">More</a>
 </div>
+
+<span class="progress">
 EOF
 
 cnt=0
 progress \
-| while read n; do
-  printf '<span class="progress"><span style="width: %s%%;">%s</span></span>\n' $n $n
+| while read p t; do
+  printf '<span style="width: %d%%;">%d:%02d</span>\n' "${p}" "$(($t / 60))" "$(($t % 60))"
 done
 
-
-
+printf '</span>'
 
 # vi:set filetype=html: