]> git.plutz.net Git - serve0/blobdiff - templates/stereoview.html.sh
layout for stereoview
[serve0] / templates / stereoview.html.sh
index 4aa623f3734a8982629386a57762b6b9a4d9f340..6fbbebd65c6422bb0c51d28c8adfbfd7585e5c40 100755 (executable)
 # along with Serve0  If not, see <http://www.gnu.org/licenses/>. 
 
 cat <<EOF
-  <canvas id="lv" width="400" height="480" style="width: 50%; margin: 0;">
-  </canvas><canvas id="rv" width="400" height="480" style="width: 50%; margin: 0;"></canvas>
+  <canvas id="lv" width="400" height="480"></canvas><canvas id="rv" width="400" height="480"></canvas>
 
-  <video id="video" onclick="videoPlay();" style="position: absolute; top: 0;">
+  <video id="video" onclick="videoPlay();">
     <source src="$(urlsafe "$video")" type='video/mp4; codecs="avc1.4D401E, mp3"'>"
   </video>
 
@@ -43,14 +42,14 @@ cat <<EOF
       rc.drawImage(video, (w / 8 * 5 + ox) % (w/2) |0, sy, w / 4 |0, h / 2, 0, 0, rv.width, h / 2 * scale);
     } else {
       sx = (w / 8 * 3 + ox) % (w) |0;
-      lc.drawImage(video, sx, (v * h + h / 8)     |0, w / 4 |0, h / 4, 0, 0, lv.width, h / 4 * scale);
-      rc.drawImage(video, sx, (v * h + h / 8 * 5) |0, w / 4 |0, h / 4, 0, 0, rv.width, h / 4 * scale);
+      lc.drawImage(video, sx, (v * h + h / 8)     |0, w / 4 |0, h / 2, 0, 0, lv.width, h / 2 * scale);
+      rc.drawImage(video, sx, (v * h + h / 8 * 5) |0, w / 4 |0, h / 2, 0, 0, rv.width, h / 2 * scale);
       if (sx < 0) {
-        lc.drawImage(video, sx + w, (v * h + h / 8)     |0, w / 4 |0, h / 4, 0, 0, lv.width, h / 4 * scale);
-        rc.drawImage(video, sx + w, (v * h + h / 8 * 5) |0, w / 4 |0, h / 4, 0, 0, rv.width, h / 4 * scale);
+        lc.drawImage(video, sx + w, (v * h + h / 8)     |0, w / 4 |0, h / 2, 0, 0, lv.width, h / 2 * scale);
+        rc.drawImage(video, sx + w, (v * h + h / 8 * 5) |0, w / 4 |0, h / 2, 0, 0, rv.width, h / 2 * scale);
       } else if ( sx + w / 4 > w) {
-        lc.drawImage(video, sx - w, (v * h + h / 8)     |0, w / 4 |0, h / 4, 0, 0, lv.width, h / 4 * scale);
-        rc.drawImage(video, sx - w, (v * h + h / 8 * 5) |0, w / 4 |0, h / 4, 0, 0, rv.width, h / 4 * scale);
+        lc.drawImage(video, sx - w, (v * h + h / 8)     |0, w / 4 |0, h / 2, 0, 0, lv.width, h / 2 * scale);
+        rc.drawImage(video, sx - w, (v * h + h / 8 * 5) |0, w / 4 |0, h / 2, 0, 0, rv.width, h / 2 * scale);
       }
     }