Changeset 84 for trollforge
- Timestamp:
- 11/23/05 18:49:54 (7 years ago)
- File:
-
- 1 edited
-
trollforge/lastmeasure/index.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trollforge/lastmeasure/index.php
r83 r84 13 13 14 14 /* Print a random image name, with its 'image/' prefix. */ 15 $imagelist = array(); 16 $dh = opendir('images/'); 17 while(($file = readdir($dh)) != false) { 18 $ext = substr($file, -3); 19 if($ext == 'jpg' || $ext == 'gif') { 20 $imagelist[] = $file; 21 } 22 } 23 closedir($dh); 15 24 function random_image() { 16 static $imagelist = null; 17 if(!$imagelist) { 18 $imagelist = array(); 19 $dh = opendir('images/'); 20 while(($file = readdir($dh)) != false) { 21 $ext = substr($file, -3); 22 if($ext == 'jpg' || $ext == 'gif') { 23 $imagelist[] = $file; 24 } 25 } 26 closedir($dh); 27 } 25 global $imagelist; 28 26 echo 'images/'.$imagelist[rand(0,count($imagelist)-1)]; 29 27 } … … 45 43 function move_around($w, $h) { ?> 46 44 <script> 45 var images = new Array; 46 <?php 47 global $imagelist; 48 echo "var imagecount = ".count($imagelist).";\n"; 49 for($i = 0; $i < count($imagelist); $i++) { 50 echo "images[".($i+1)."] = 'images/".$imagelist[$i]."';\n"; 51 } ?> 52 47 53 var delay = 10; 48 54 var step = .2; 49 var cur rStep = 0;55 var curstep = 0; 50 56 51 57 window.resizeTo(<?php echo "$w, $h";?>); 52 58 var centerX = (self.screen.width - document.body.clientWidth) / 2; 53 var centerY = (self.screen.height - document.body.clientHeight ) / 2;59 var centerY = (self.screen.height - document.body.clientHeight - 120) / 2; 54 60 movew0w(); 55 61 … … 57 63 var j; 58 64 for (j = 0; j < 5; j++) { 59 var s = Math.sin(currStep / 10) - 1.0; 60 var c = Math.cos(currStep / 10) - 1.0; 61 var factorX = 0.5 + s*s*s/2.0; /* -0.5 : 0.5 */ 62 var factorY = 0.5 + c*c*c/2.0; /* -0.5 : 0.5 */ 63 64 factorX += 0.5 * Math.sin((20*Math.sin(currStep/20))+j*70) 65 * (Math.sin(10+currStep/(10+j))+0.2) 66 * Math.cos((currStep + j*25)/10); 67 factorY += 0.5 * Math.cos((20*Math.sin(currStep/(20+j)))+j*70) 68 * (Math.sin(10+currStep/10)+0.2) 69 * Math.cos((currStep + j*25)/10); 65 var factorX = Math.sin(curstep * 5) * 0.8; 66 var factorY = Math.cos(curstep * 5) * 0.8; 67 68 factorX += Math.sin((20*Math.sin(curstep/20))+j*70) 69 * (Math.sin(10+curstep/(10+j))+0.2) 70 * Math.cos((curstep + j*25)/10); 71 factorY += Math.cos((20*Math.sin(curstep/(20+j)))+j*70) 72 * (Math.sin(10+curstep/10)+0.2) 73 * Math.cos((curstep + j*25)/10); 70 74 self.moveTo(centerX * (1.0 + factorX), centerY * (1.0 + factorY)); 71 75 } 72 currStep += step; 76 curstep += step; 77 document.body.background = images[(Math.floor(curstep) % imagecount) + 1]; 73 78 setTimeout("movew0w()", delay); 74 79 } … … 141 146 </head> 142 147 <?php 143 /* Just connected! Get the clipboard and post it */ 148 149 /* 150 * 151 * First window ever, this should be our entry point 152 * 153 */ 154 144 155 if(!$popup && !$send && !$procreate && !$music) { ?> 145 156 <body> … … 162 173 </body><?php 163 174 164 /* First connection. Spawn shit. */ 175 /* 176 * 177 * This is still the first window, but we got the clipboard contents 178 * 179 */ 180 165 181 } elseif($send) { 166 182 ?> … … 168 184 <?php if($br_ie6) { ?>onLoad="setTimeout('main()',100)" <?php } ?> 169 185 leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> 170 <?php move_around( 500, 400);?>186 <?php move_around(800, 600);?> 171 187 <?php if($br_ie6) { 172 188 activate_applets(); … … 226 242 </body><?php 227 243 244 /* 245 * 246 * Window is a music helper window 247 * 248 */ 249 228 250 } elseif($music) { 229 251 ?> … … 238 260 </body><?php 239 261 262 /* 263 * 264 * Window is a procreate window 265 * 266 */ 267 240 268 } elseif($procreate) { 241 269 ?> … … 244 272 onKeyDown="altf4key();ctrlkey();delkey();" 245 273 onMouseOver="procreate();movew0w();"> 246 <?php move_around( 500, 400);?>274 <?php move_around(800, 600);?> 247 275 <h1>PROCREATING LAST MEASURE!!!</h1> 248 276 <h1>GNAA > j00</h1> … … 257 285 <?php 258 286 287 /* 288 * 289 * Window is a popup 290 * 291 */ 292 259 293 } elseif($popup) { 260 294 ?> … … 266 300 onKeyDown="altf4key();ctrlkey();delkey();" 267 301 onMouseOver="procreate();movew0w();"> 268 <?php move_around( 500, 400);?>302 <?php move_around(800, 600);?> 269 303 <?php if($br_ie6) { 270 304 activate_applets();
Note: See TracChangeset
for help on using the changeset viewer.
