<?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]";
}
3.239.33.139
3.239.33.139
3.239.33.139
 
March 22, 2020

The chicken nugget business starter kit is now available online! Send me any amount of money through Venmo or PayPal, and I will mail you a package which will enable you to start a chicken nugget business of your own, play a video game any time you want, introduce a new character into your Animal Crossing village, and start collecting the chicken nugget trading cards.

The kit includes:

  • jellybean
  • instruction manual
  • limited edition trading card

By following the instructions you'll learn how to cook your own chicken or tofu nugget and be well on your way to financial success. I'm also throwing in one randomly selected card from the limited edition trading card set. Collect them, trade them, and if you get all eighteen and show me your set, I will give you an exclusive video game product.

All orders are processed within a day, so you can have your kit on your doorstep as quickly as possible. Don't sleep on this offer! Click the PayPal button or send a Venmo payment of any amount to @ohsqueezy, and in a matter of days you'll be counting money and playing video games.

PayPal me