blob: f109cec5949ecb611aa9ba539513c32082e17511 [file] [log] [blame]
Andreu779c3b72019-09-24 03:14:35 +02001<?php
2 $id = isset($_GET['id']) ? $_GET['id'] : 9;
3
4 // 2^0 (not hidden) and 2^9 (fully hidden)
5 $hidden = (int)rand(1,512);
6 $bits = decbin($hidden);
7 while (strlen($bits) < 9) $bits = '0' . $bits;
8
9 $i = 0;
10?>
11
12<style>
13 img.black {
14 filter: brightness(0%);
15 }
16</style>
17
18<form action="collage.php" method="GET">
19 <input type="text" name="id" placeholder="Poseu un nĂºmero de l'1 al 113..." />
20 <input type="submit" value="Actualitza foto" />
21</form>
22
23<table cellspacing="0" cellpadding="0">
24 <tr>
25 <td><img src="./imgs/<?=$id?>/slice_01_01.png" width="33" class="<?=(int)$bits[$i++] ? 'black' : ''?>" /></td>
26 <td><img src="./imgs/<?=$id?>/slice_01_02.png" width="33" class="<?=(int)$bits[$i++] ? 'black' : ''?>" /></td>
27 <td><img src="./imgs/<?=$id?>/slice_01_03.png" width="33" class="<?=(int)$bits[$i++] ? 'black' : ''?>" /></td>
28 </tr>
29 <tr>
30 <td><img src="./imgs/<?=$id?>/slice_02_01.png" width="33" class="<?=(int)$bits[$i++] ? 'black' : ''?>" /></td>
31 <td><img src="./imgs/<?=$id?>/slice_02_02.png" width="33" class="<?=(int)$bits[$i++] ? 'black' : ''?>" /></td>
32 <td><img src="./imgs/<?=$id?>/slice_02_03.png" width="33" class="<?=(int)$bits[$i++] ? 'black' : ''?>" /></td>
33 </tr>
34 <tr>
35 <td><img src="./imgs/<?=$id?>/slice_03_01.png" width="33" class="<?=(int)$bits[$i++] ? 'black' : ''?>" /></td>
36 <td><img src="./imgs/<?=$id?>/slice_03_02.png" width="33" class="<?=(int)$bits[$i++] ? 'black' : ''?>" /></td>
37 <td><img src="./imgs/<?=$id?>/slice_03_03.png" width="33" class="<?=(int)$bits[$i++] ? 'black' : ''?>" /></td>
38 </tr>
39</table>