#!/usr/bin/perl -w use Term::ANSIColor qw(:constants); print(RED," SlideShow Bob\n"); print("The PNG File Animator\n"); print(GREEN,"V0.0.1 by Graham Lee\n"); print("--------------------\n\n"); #gather information print(WHITE,"Please enter the title of the animation: "); $title=; chomp($title); print("This program takes filenames of the form fname[i].png, where i is an index number.\n"); print("The index i must start at 0 (otherwise you waste too much memory)!\n"); print("Maximum value of i: "); $imax=; chomp($imax); $numimgs=$imax+1; print("File prefix (the fname part): "); $fname=; chomp($fname); print("Do you have another set of images to add (such as images of the unit cell)?(Y/N) "); $anymore=; if ($anymore =~ /[yY]/i) { print("What is the file prefix of these png images? "); $fname2=; chomp($fname2); print("How many slices through the unit cell? "); $slices=; chomp($slices); } else { $fname2=""; } print("Name of HTML file to generate: "); $html1name=; chomp($html1name); print(BLUE,"\n\nWORKING...\n"); print(WHITE); $htmlname=">".$html1name; open(OUTFILE,$htmlname) or die("Error $! received.\n"); select(OUTFILE); #create HTML print("\n\n$title\n"); #generate JavaScript print("\n"); #end of JavaScript print("\n\n\n"); print("\n\n"); print("

$title

\n\n"); unless ($fname2 eq "") { print("
\n"); print("Depth (z): \n"); print("
\n\n"); } print("
\n"); print(""); unless ($fname2 eq ""){ print(""); } print("\n
\n"); print("[-] "); print(""); print(""); for($i=1;$i<$numimgs;$i++) { print(""); print(""); } print(" [+]\n"); print("
\n"); print("Hover the mouse over the scrollbar to jump to a position in the series.\n"); print("Click on the +/- buttons to skip forward or backward one frame.\n"); print("
\n\n\n"); #finished generating HTML select(STDOUT); close(OUTFILE); print(BLUE,"Finished generating $html1name!\n"); print(WHITE,"SlideShow Bob Complete.\n");