<?php

$host = $_SERVER['HTTP_HOST'];

function echolink($url, $name) {
  global $host;
  if("/$url/" != $_SERVER['REQUEST_URI']) {
    echo "<a href='https://$host/$url/'>$name</a>";
  } else {
    echo "<span>$name</span>";
  }
}
echo "<input type='checkbox' id='navtoggle'>";
echo '<label for="navtoggle"><svg xmlns="http://www.w3.org/2000/svg" viewBox="-5 -7 24 24" width="32" fill="currentColor"><path d="M1 0h12a1 1 0 0 1 0 2H1a1 1 0 1 1 0-2zm0 8h12a1 1 0 0 1 0 2H1a1 1 0 1 1 0-2zm0-4h12a1 1 0 0 1 0 2H1a1 1 0 1 1 0-2z"></path></svg></label>';
echo "<nav id='main-nav' style='--rowcount: 3;'><div>";
if($_SERVER["DOCUMENT_ROOT"] !== getcwd()) {
  echo "<a href='https://$host/'>home</a>";
}
echolink("about", "about");
echolink("about/uses", "uses");
echolink("about/music", "music");
echo "</div><div>";
echolink("blog", "blog");
echolink("links", "links");
echolink("stuff", "stuff");
echolink("guestbook", "guestbook");
echo "</div><div>";
echolink("stats", "stats");
echolink("etc/greenhouse", "greenhouse");
echolink("etc", "etc");
echo "</div></nav>";
?>