<?php

$scans = scandir(".");

$HTML = "<html>";
$HTML .= "<head>";
$HTML.="<link rel=\"stylesheet\" href=\"css/index.css\">";
$HTML .="</head>";

$readme = file("README.md");


$HTML .= "<body>";

$HTML .= "<div id=\"idx_container\">";

$HTML .= "<div id=\"idx_header\">";
$HTML .= $readme[0];
$HTML .= "</div>";

$HTML .= "<div id=\"idx_text\">";
$HTML .= implode(" ",array_slice($readme, 1, count($readme)-3));
$HTML .= "</div>";

$HTML .= "<div id=\"idx_thumbs\">";

//foreach($scans as $item) {
foreach(array("mandalala", "mandalala_plus","mandalala_hatch","mandalala_sphere") as $item) {
//    if(is_dir($item) && strpos($item, ".") === false && $item !== "images" && $item !== "js" && $item !== "css") {
        $HTML .= "<a href=\"$item\">"."<img src=\"images/".$item.".png\">"."</a><br>";
//    }
}

$HTML .= "</div>";

$HTML .= "<div id=\"idx_tail\">";
$HTML .= $readme[count($readme)-2];
$HTML .= "</div>";

$HTML .= "<div id=\"idx_tail\">";
$HTML .= "<a href=\"http://0xa.kuri.mu/\">0xA</a>.............";
$HTML .= "<a href=\"http://".$readme[count($readme)-1]."\">SRC</a>";
$HTML .= "</div>";


$HTML .= "<div>";

$HTML .= "</body>";
$HTML .= "</html>";

echo $HTML;


?>
