<?php
namespace entities\html;

class Input
{
   public function __construct(
      $name=null, $type=null, $value=null, $class=null, $clear_on_focus=false)
   {
      $this->name = $name;
      $this->type = $type;
      $this->value = $value;
      $this->class = $class;
      $this->clear_on_focus = $clear_on_focus;
   }
   public function __toString()
   {
      return $this->build_html();
   }
   private function build_html()
   {
      $markup = "<input";
      $markup .= $this->build_assignments();
      if ($this->clear_on_focus)
      {
         $markup .= " onFocus=\"this.value='';this.style.color='black'\"";
      }
      $markup .= "/>\n";
      return $markup;
   }
   protected function build_assignments()
   {
      $assignments = $this->build_assignment("name");
      $assignments .= $this->build_assignment("type");
      $assignments .= $this->build_assignment("value");
      $assignments .= $this->build_assignment("class");
      return $assignments;
   }
   private function build_assignment($name)
   {
      $value = $this->$name;
      if (!is_null($value))
      {
         return " $name=\"$value\"";
      }
      return null;
   }
}
<?php
namespace entities\html;

class Page
{
   private $scripts = array();
   public function __construct($title=null)
   {
      $this->set_title($title);
      $this->css_path = $GLOBALS["CSS_PATH"];
   }
   protected function set_title($title)
   {
      $this->title = $title;
   }
   public function __toString()
   {
      return $this->build_html();
   }
   private function build_html()
   {
      $markup = "<html>\n";
      $markup .= "<head>\n";
      $markup .= $this->build_head();
      $markup .= "</head>\n";
      $markup .= $this->build_body();
      $markup .= "</html>\n";
      return $markup;
   }
   protected function build_head()
   {
      $markup = $this->build_title();
      $markup .= $this->build_style_link();
      $markup .= $this->build_script_tags();
      $markup .= $this->build_description();
      $markup .= $this->build_thumbnail_link();
      $markup .= $this->build_favicon_link();
      return $markup;
   }
   private function build_title()
   {
      $markup = "<title>" . $this->title . "</title>\n";
      $markup .= new Meta($this->title, "title");
      return $markup;
   }
   private function build_style_link()
   {
      $tag = "<link href=\"" . $this->css_path . "\" rel=\"stylesheet\">\n";
      return $tag;
   }
   protected function build_script_tags()
   {
      $markup = "";
      foreach ($this->scripts as $path)
      {
         $markup .= new Script($path);
      }
      return $markup;
   }
   private function build_description()
   {
      return new Meta($GLOBALS["PAGE_DESCRIPTION"], "description") . "\n";
   }
   private function build_thumbnail_link()
   {
      $tag = "<link rel=\"image_src\"";
      $tag .= " href=\"" . $GLOBALS["THUMBNAIL_PATH"] . "\"/>";
      return $tag;
   }
   private function build_favicon_link()
   {
      return new Link("shortcut icon", $GLOBALS["FAVICON_PATH"]);
   }
   private function build_body()
   {
      $markup = "<body>\n";
      $markup .= $this->build_content();
      $markup .= "</body>\n";
      return $markup;
   }
   protected function build_content()
   {
      return "";
   }
   protected function add_script($path)
   {
      $this->scripts[] = $path;
   }
}
<?php
namespace entities\html;

class Script
{
   public function __construct($path=null, $content=null)
   {
      $this->path = $path;
      $this->content = $content;
   }
   public function __toString()
   {
      return $this->build_html();
   }
   public function build_html()
   {
      $markup = "<script";
      if (!is_null($this->path))
      {
         $markup .= " src=\"" . $this->path . "\"";
      }
      $markup .= ">";
      $markup .= $this->build_content();
      $markup .= "</script>\n";
      return $markup;
   }
   protected function build_content()
   {
      return $this->content;
   }
}
<?php
namespace entities\html;

class A extends Element
{
   public function __construct($href=null, $content=null, $id=null, $class=null)
   {
      parent::__construct("a", $id, $class);
      $this->add_attribute("href", $href);
      $this->content = $content;
   }
   protected function build_content()
   {
      $content = $this->content;
      if (is_null($content))
      {
         $content = $this->get_attribute("href");
      }
      return $content;
   }
}
<?php
namespace entities\html;

class IFrame extends Element
{
   public function __construct($id, $src, $width, $height)
   {
      parent::__construct("iframe", $id);
      $this->add_attribute("src", $src);
      $this->add_attribute("width", $width);
      $this->add_attribute("height", $height);
      $this->add_attribute("frameborder", "0");
   }
}
3.142.250.57
3.142.250.57
3.142.250.57
 
September 30, 2015


Edge of Life is a form I made with Babycastles and Mouth Arcade for an event in New York called Internet Yami-ichi, a flea market of internet-ish goods. We set up our table to look like a doctor's office and pharmacy and offered free examinations and medication prescriptions, a system described by one person as "a whole pharmacy and medical industrial complex".

Diagnoses were based on responses to the form and observations by our doctor during a short examination. The examination typically involved bizarre questions, toy torpedoes being thrown at people and a plastic bucket over the patient's head. The form combined ideas from Myers-Briggs Type Indicators, Codex Seraphinianus and chain-mail personality tests that tell you which TV show character you are. In our waiting room, we had Lake of Roaches installed in a stuffed bat (GIRP bat). It was really fun!

The icons for the food pyramid are from Maple Story and the gun icons are from the dingbat font Outgunned. I'm also using Outgunned to generate the items in Food Spring.