source view: index.php


<?php



  require 'headers.php';
  require './classes/Navigation.php';
  require './classes/Page.php';



?>
<!doctype html>
<html>
  <head>
    <script language="javascript">
      document.getElementsByTagName( 'html' )[0].style.display = 'none';
    </script>
    <!-- <meta name="theme-color" content="#7bafd4" /> -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="apple-touch-icon" sizes="57x57" href="/favicons/apple-touch-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="/favicons/apple-touch-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/favicons/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/favicons/apple-touch-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/favicons/apple-touch-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/favicons/apple-touch-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/favicons/apple-touch-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/favicons/apple-touch-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon-180x180.png">
    <link rel="icon" type="image/png" href="/favicons/favicon-32x32.png" sizes="32x32">
    <link rel="icon" type="image/png" href="/favicons/android-chrome-192x192.png" sizes="192x192">
    <link rel="icon" type="image/png" href="/favicons/favicon-96x96.png" sizes="96x96">
    <link rel="icon" type="image/png" href="/favicons/favicon-16x16.png" sizes="16x16">
    <link rel="manifest" href="/favicons/manifest.json">
    <link rel="shortcut icon" href="/favicons/favicon.ico">
    <meta name="msapplication-TileColor" content="#da532c">
    <meta name="msapplication-TileImage" content="/favicons/mstile-144x144.png">
    <meta name="msapplication-config" content="/favicons/browserconfig.xml">
    <meta name="theme-color" content="#ffffff">
    <meta name="viewport" content="width=device-width, user-scalable=no" />
    <script language="javascript" src="js-lib/Algebra.js"></script>
    <script language="javascript" src="js-lib/Color.js"></script>
    <script language="javascript" src="js-lib/ThemeApp.js"></script>
    <script language="javascript" src="js/stdlib.js"></script>
    <link href="https://fonts.googleapis.com/css?family=Heebo:300|Khula:300|Roboto:300|Source+Sans+Pro:200|Work+Sans:300|Yantramanav:300" rel="stylesheet" />
    <link href="styles/splash.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    </style>
    <title>kyle woodward</title>
  </head>
  <body data-theme="none">
    <div id="fallback" class="vertical-center"><div class="vertical-center-content">
      <ul id="links">
<?php
  for ( $i = 0; $i < Navigation::getItemCount(); ++$i )
  {
    $nav_item = Navigation::getItem( $i );
?>
        <li data-color="<?php print $nav_item->getColor()->toHex(); ?>" data-font-color="<?php print $nav_item->getFontColor()->toHex(); ?>" style="border-color:<?php print $nav_item->getColor()->toHex(); ?>;"><a href="<?php print $nav_item->getURL(); ?>"><?php print $nav_item->getName(); ?><span>&#x00bb;</span></a></li>
<?php
  }
?>
        <li id="splash-copy"><span><span style="color:#666;font-size:8pt;margin-top:3ex;">&copy; <?php print strtolower( Page::romanDate() ); ?> kyle woodward</span></span></li>
      </ul>
<?php
  $images_directory = 'splash_images/';
  $file_array       = scandir( $images_directory );

  $rand_min = 0;
  while ( substr( $file_array[$rand_min++], -4 ) != '.png' && count( $file_array ) > $rand_min ) {}
      
  $random_file_key  = rand( $rand_min, count( $file_array ) - 1 );
  $random_file_name = $file_array[$random_file_key];

  $random_nav_item = Navigation::getRandomItem();
  $fractal_bgcolor = $random_nav_item->getColor()->toHex();
  $fractal_color   = $random_nav_item->getFontColor()->toHex();

  //
  // 1) remove the .png
  //
  $equation = substr( $random_file_name, 0, -4 );

  //
  // 2) remove the timestamp
  //
  $equation = substr( $equation, strpos( $equation, '.' ) + 1 );

  //
  // 3) remove the (1.0)
  //
  $equation = substr( $equation, 5 );

  //
  // 4) fix the math markup
  //
  $equation = str_replace( 'z^1', ' z', $equation );
  $equation = str_replace( 'i', '<span class="complex-unit">i</span>', $equation );
  $equation = preg_replace( '/z\^(\d)/', ' z<span class="superscript">$1</span>', $equation );
  $equation = preg_replace( '/\+\(/', ' + (', $equation );
  $equation = preg_replace( '/\+ \(-([\d\.]+)\+/', '- ($1-', $equation );
  $equation = preg_replace( '/\+ \(-([\d\.]+)\-/', '- ($1+', $equation );
  $equation = preg_replace( '/\-/', '&ndash;', $equation );

  //
  // 5) dump it
  //
?>
          <div id="fractal-container" style="background-color:<?php print $fractal_bgcolor; ?>;color:<?php print $fractal_color; ?>;background-image:url('/splash_images/<?php print $random_file_name; ?>');"><span id="complex-equation"><?php print $equation; ?></span></div>
      <span class="copyright">&copy; <?php print strtolower( Page::romanDate() ); ?> kyle woodward</span>
    </div></div>
    <img id="woodward-hall" />
    <canvas id="canvas"></canvas>
<div id="console"><pre>
&#x1F354; My name is Kyle Woodward.
&#x1F354; I am an economist studying theoretical questions in game theory and market design.
&#x1F354; <span style="font-style:italic;">Toggle a terminal by pressing [ESC] or double-tapping.</span>
</pre></div>
<div id="text-cache" style="display:none;visibility:hidden;">&boxV;
&boxV; WELCOME TO <?php print strtoupper( $_SERVER['SERVER_NAME'] ) . "\n"; ?>
&boxV;
&boxV; My name is Kyle Woodward.
&boxV; I am an economist studying theoretical questions in game theory and market design.
&boxV; I also do other things.
&boxV;
&boxV; <span style="font-style:italic;">Toggle this terminal by pressing [ESC] or double-tapping.</span>
&boxV; <span style="font-style:italic;">This terminal supports tab-autocomplete and arrow-history.</span>
&boxV; <span style="font-style:italic;">For more, try `help`.</span>
&boxV;
&boxUR;&boxH;

</div>
  <script language="javascript">
    window.addEventListener( 'load', function () {
      let links = document.getElementById( 'links' );
      links.parentNode.removeChild( links );
      document.body.insertBefore( links, document.getElementById( 'console' ) );
      new App();
      let fallback = document.getElementById( 'fallback' );
      fallback.parentNode.removeChild( fallback );
      document.getElementsByTagName( 'html' )[0].style.display = 'block';
    } );
  </script>
<?php 
  
  Page::printTracking();
  
?>
  </body>
</html>