#!/usr/bin/perl

# generates a webpage with the color time shown on it
# Steve Pomeroy <steve@staticfree.info>
#######################################

use ColorTime;

print "Content-type:text/html\n\n";

$bgcolor=ColorTime::colorClock(time);
if($ENV{'QUERY_STRING'} eq 'color'){
  print "$bgcolor";
}
else{
  print<<EOS;
<html>
<head>
<meta HTTP-EQUIV="Refresh"Content="60;URL=http://staticfree.info/perl/time.pl">
<title>Time cycles...colors blend as time passes...</title>
<style><!--

    body { height: 95%; width: 95%; }
  .ball {position: absolute }

.ball\#yellow { top: 5%;  left: 40%; }
.ball\#green  { top: 30%; left: 75%; }
.ball\#red    { top: 30%; left: 5%;  }
.ball\#blue   { top: 75%; left: 60%; }
.ball\#black  { top: 75%; left: 20%; }


-->
</style>
</head>

<body bgcolor="\#$bgcolor">
EOS

  #print $times{getLowTime($mins)}." x ".$times{getHighTime($mins)};
  #print "<br>\n".$ppercent;

  print<<EOS;

  <div class="ball" id="yellow"><img src="/clock/yellow.gif"></div>
  <div class="ball" id="red"><img src="/clock/red.gif"></div>
  <div class="ball" id="green"><img src="/clock/green.gif"></div>
  <div class="ball" id="blue"><img src="/clock/blue.gif"></div>
  <div class="ball" id="black"><img src="/clock/black.gif"></div>

</body>
</html>
EOS

}
