<?php
namespace structures\html;

class Image extends Element
{
   public function __construct($src, $id=null, $class=null)
   {
      parent::__construct("img", $id, $class, false);
      $this->add_attribute("src", $src);
   }
}
<?php
namespace structures\html;

class Meta extends Element
{
   public function __construct($content, $name=null, $http_equiv=null)
   {
      parent::__construct("meta", null, null, false);
      $this->add_attribute("name", $name);
      $this->add_attribute("http-equiv", $http_equiv);
      $this->add_attribute("content", $content);
   }
}
Animation = function(rate, skip_frames, buffer)
{
   this.rate = rate;
   this.playing = false;
   this.deviation = 0;
   this.skip_frames = skip_frames || false;
   this.buffer = buffer || false;
}

Animation.prototype.play = function(method_name, delay)
{
   if (method_name == null)
   {
      method_name = "sequence";
   }
   var parameters = this.extract_parameters(arguments);
   var current = this;
   this.reset_last_ms(delay);
   this.interval = window.setTimeout(
      function()
      {
	 current.playing = true;
	 current.loop(method_name, parameters);
      }, delay);
}

Animation.prototype.reset_last_ms = function(delay)
{
   if (this.skip_frames)
   {
      this.last_ms = +new Date - this.rate;
      if (delay)
      {
	 this.last_ms += delay;
      }
   }
}

Animation.prototype.loop = function(method_name, parameters)
{
   var frames = 1;
   if (this.skip_frames)
   {
      frames += this.measure_deviation();
       console.log(frames);
   }
   var current = this;
   for (var ii = 0; ii < frames; ii++)
   {
      current[method_name].apply(current, parameters);
   }
   if (this.playing)
   {
      this.interval = window.setTimeout(
	 function()
	 {
	    current.loop(method_name, parameters);
	 }, this.rate - this.buffer);
   }
}

Animation.prototype.measure_deviation = function()
{
   var count = 0;
   var time = +new Date;
   var difference = time - this.last_ms;
   var overflow = difference - this.rate;
   this.deviation += overflow;
   this.last_ms = time;
   if (this.deviation < -this.rate)
   {
      this.deviation += this.rate;
      count--;
   }
   else
   {
      while (this.deviation > this.rate)
      {
	 this.deviation -= this.rate;
	 count++;
      }
   }
   return count;
}

Animation.prototype.stop = function()
{
   window.clearInterval(this.interval);
   this.playing = false;
}

Animation.prototype.extract_parameters = function(list)
{
   if (list.length > 2)
   {
      list = Array.prototype.slice.call(list);
      return list.slice(2);
   }
   return [null];
}

Animation.prototype.toggle = function()
{
   if (this.playing)
   {
      this.stop();
   }
   else
   {
      this.play();
   }
}

Animation.prototype.toString = function()
{
   return "[object Animation]";
}
window.getSize = function()
{
    if (window.innerWidth != undefined)
    {
	return {width: window.innerWidth, height: window.innerHeight};
    }
    var body = document.body;
    var document_element = document.documentElement;
    return {width: Math.max(body.clientWidth, document_element.clientWidth),
	    height: Math.max(body.clientHeight, document_element.clientHeight)};
}
Color = function()
{
   this.setRGB.apply(this, arguments);
}

Color.prototype.setRGB = function()
{
   if (arguments.length > 1)
   {
      this.rgb = [arguments[0], arguments[1], arguments[2]];
   }
   else if (arguments.length > 0)
   {
      var color = arguments[0];
      if (color instanceof Array)
      {
	 this.rgb = color;
      }
      else if (color.slice(0, 3) == "rgb")
      {
	 this.rgb = this.extractRGBFromTuple(color);
      }
      else
      {
	 this.rgb = this.extractRGBFromHexString(color);
      }
   }
   else
   {
       this.randomize();
   }
}

Color.prototype.extractRGBFromTuple = function(color)
{
   var rgb = color.match(/\d+/g);
   return [+rgb[0], +rgb[1], +rgb[2]];
}

Color.prototype.extractRGBFromHexString = function(color)
{
   var r = parseInt(color.slice(1, 3), 16);
   var g = parseInt(color.slice(3, 5), 16);
   var b = parseInt(color.slice(5, 7), 16);
   return [r, g, b];
}

Color.prototype.randomize = function(min, max)
{
    this.rgb = this.buildRandomRGB(min, max);
}

Color.prototype.buildRandomRGB = function(min, max)
{
    var min = min || 0;
    var max = max || 255;
    var r = this.getRandomInteger(min, max);
    var g = this.getRandomInteger(min, max);
    var b = this.getRandomInteger(min, max);
    return [r, g, b];
}

Color.prototype.getRandomInteger = function(min, max)
{
   return Math.floor(Math.random() * (max - min + 1)) + min;
}

Color.prototype.getString = function()
{
   var r = parseInt(this.rgb[0]);
   var g = parseInt(this.rgb[1]);
   var b = parseInt(this.rgb[2]);
   return "rgb(" + r + "," + g + "," + b + ")";
}

Color.prototype.changeBrightness = function(factor)
{
    for (var ii = 0; ii < this.rgb.length; ii++)
    {
	this.rgb[ii] += factor;
    }
}

Color.prototype.toString = function()
{
   return "[object Color]";
}
18.232.179.37
18.232.179.37
18.232.179.37
 
December 3, 2013

Where in the mind's prism does light shine, inward, outward, or backward, and where in a plane does it intersect, experientially and literally, while possessing itself in a dripping wet phantasm?


Fig 1.1 What happens after you turn on a video game and before it appears?

The taxonomy of fun contains the difference between gasps of desperation and exaltation, simultaneously identical and opposite; one inspires you to have sex, while the other to ejaculate perpetually. A destruction and its procession are effervescent, while free play is an inseminated shimmer hatching inside you. Unlikely to be resolved, however, in such a way, are the climaxes of transitions between isolated, consecutive game states.

You walk through a door or long-jump face first (your face, not Mario's) into a painting. A moment passes for eternity, viscerally fading from your ego, corpus, chakra, gaia, the basis of your soul. It happens when you kill too, and especially when you precisely maim or obliterate something. It's a reason to live, a replicating stasis.


Fig 1.2 Sequence in a video game

Video games are death reanimated. You recurse through the underworld toward an illusion. Everything in a decision and logic attaches permanently to your fingerprint. At the core, you use its energy to soar, comatose, back into the biosphere, possibly because the formal structure of a mind by human standards is useful in the next world.