summary refs log tree commit diff
path: root/bin/shotty.l
diff options
context:
space:
mode:
authorC. McEnroe <june@causal.agency>2021-10-18 21:53:54 -0400
committerC. McEnroe <june@causal.agency>2021-10-18 21:53:54 -0400
commit48548e649cb79efe96265b3800955a96a570c77b (patch)
tree286e70343bb8e0096c80c20ea651f50a3c489c0e /bin/shotty.l
parentAdd shotty -t to animate (crudely) between snapshots (diff)
downloadsrc-48548e649cb79efe96265b3800955a96a570c77b.tar.gz
src-48548e649cb79efe96265b3800955a96a570c77b.zip
Revert "Add shotty -t to animate (crudely) between snapshots"
This reverts commit 0fc730ec8e058607b05185e1a36b22615ffbae40.

It's mostly irrelevant to how shotty actually functions so I think
it would be better done externally. Reverting just to keep the dumb
JavaScript in history.
Diffstat (limited to '')
-rw-r--r--bin/shotty.l25
1 files changed, 1 insertions, 24 deletions
diff --git a/bin/shotty.l b/bin/shotty.l
index 93e7f0e..3d1d50c 100644
--- a/bin/shotty.l
+++ b/bin/shotty.l
@@ -507,9 +507,8 @@ int main(int argc, char *argv[]) {
 	bool debug = false;
 	bool size = false;
 	bool hide = false;
-	int interval = 0;
 
-	for (int opt; 0 < (opt = getopt(argc, argv, "Bb:df:h:inst:w:"));) {
+	for (int opt; 0 < (opt = getopt(argc, argv, "Bb:df:h:insw:"));) {
 		switch (opt) {
 			break; case 'B': bright = true;
 			break; case 'b': defaultBg = atoi(optarg);
@@ -519,7 +518,6 @@ int main(int argc, char *argv[]) {
 			break; case 'i': colors = true;
 			break; case 'n': hide = true;
 			break; case 's': size = true;
-			break; case 't': interval = atoi(optarg);
 			break; case 'w': cols = atoi(optarg);
 			break; default:  return EX_USAGE;
 		}
@@ -561,25 +559,4 @@ int main(int argc, char *argv[]) {
 	}
 	if (hide) mode &= ~Cursor;
 	if (!mc) html();
-
-	if (interval) {
-		printf(
-			Q(
-				<script>
-				let frames = document.querySelectorAll("pre");
-				let frame = 0;
-				function animate() {
-					for (let i = 0; i < frames.length; ++i) {
-						frames[i].hidden = (i != frame);
-					}
-					frame++;
-					if (frame == frames.length) frame = 0;
-				}
-				animate();
-				setInterval(animate, %d);
-				</script>
-			),
-			interval
-		);
-	}
 }