<file_sep>var start = null;
var quickestTime = null;

function resizeGame() {
    var center = document.getElementsByClassName("game-bounds").item(0);

    center.style.width = (document.body.clientWidth - 50) + "px";
    center.style.height = (document.body.clientHeight - 50) + "px";
}

resizeGame();

if (window.attachEvent) {
    window.attachEvent('onresize', function () {
        resizeGame();
    });
} else if (window.addEventListener) {
    window.addEventListener('resize', function () {
        resizeGame();
    });
}


function getRandomColor() {
    var letters = '0123456789ABCDEF'.split(''),
        color = "#";
    for (var i = 0; i < 6; i++) {
        color += letters[Math.floor(Math.random() * 16)];
    }
    return color;
}

function makeShapeAppear() {
    var shape = document.getElementById('shape');

    var top = Math.random() * 400,
        left = Math.random() * 400,
        size = (Math.random() * 200) + 10;

    shape.style.display = "block";
    shape.style.top = top + "px";
    shape.style.left = left + "px";
    shape.style.width = size + "px";
    shape.style.height = size + "px";
    shape.style.backgroundColor = getRandomColor();

    if (Math.random() > 0.5) {
        shape.style.borderRadius = "50%";
    } else {
        shape.style.borderRadius = "0%";
    }

    start = new Date().getTime();
}

function appearAfterDelay() {
    setTimeout(makeShapeAppear, Math.random() * 2000); // Max Length 2 Seconds
}

document.getElementById('shape').onclick = function () {
    var end = new Date().getTime(),
        timeTaken = (end - start);

    document.getElementById('shape').style.display = "none";
    document.getElementById('time-taken').innerHTML = timeTaken / 1000 + 's';

    if (quickestTime) {
        if ((end - start) < quickestTime) {
            quickestTime = timeTaken;
        }
    } else {
        quickestTime = timeTaken;
    }

    document.getElementById('quickest-time').innerHTML = quickestTime / 1000 + 's';

    appearAfterDelay();
};
appearAfterDelay();
<file_sep>function FrequencyConverter() {
	this.values = {
		"hertz": 0.001,
		"kilohertz": 1,
		"megahertz": 1000,
		"gigahertz": 1000000
	};
	
	this.convert = function (From, To, Value) {
		return (Value * this.values[From]) / this.values[To];
	}
}<file_sep>function SpeedConverter() {
	
	// Units in Foot Per Second
	this.values = {
		"miles-per-hour": 1.46667,
		"foot-per-second": 1,
		"meter-per-second": 3.28084,
		"kilometer-per-hour": 0.911344,
		"knot": 1.68781
	};
	
	this.convert = function(From, To, Value ) {
		return (Value * this.values[From]) / this.values[To];
	}
}<file_sep>function AreaConverter () {
    
    // Units in Square Inch
    this.values = {
        "square-kilometer": 1550003100,
        "square-meter": 1550,
        "square-mile": 4014489600,
        "square-yard": 1296,
        "square-foot": 144,
        "square-inch": 1,
        "hectare": 15500031,
        "acre": 6272640
    };
    
    this.convert = function(From, To, Value) {
        return (Value * this.values[From]) / this.values[To]
    }
}<file_sep>function LengthConverter() {

    // Units in Nanometer
    this.values = {
        "kilometer": 1000000000000,
        "meter": 1000000000,
        "decimeter": 100000000,
        "centimeter": 10000000,
        "millimeter": 1000000,
        "micrometer": 1000,
        "nanometer": 1,
        "mile": 1609344000000,
        "yard": 914400000,
        "foot": 304800000,
        "inch": 25400000,
        "nautical-mile": 1852000000000,
        "light-year": 9460730472580800000000000
    };

    this.convert = function (From, To, Value) {
        return (Value * this.values[From]) / this.values[To]
    }
}
<file_sep>function TemperatureConverter() {
	TemperatureTypeEnum = {
		FAHRENHEIT: "fahrenheit",
		CELSIUS: "celsius",
		KELVIN: "kelvin"
	};
	
	this.convert = function(From, To, Value) {
		switch(From) {
			case TemperatureTypeEnum.FAHRENHEIT:
				if (To == TemperatureTypeEnum.CELSIUS) {
				return ((Value - 32) * 5) / 9;
				} else {
					return (Value + 459.67) * (5 / 9);	
				}
				break;
			case TemperatureTypeEnum.CELSIUS:
				if (To == TemperatureTypeEnum.FAHRENHEIT) {
					return (Value * (9 / 5)) + 32;
				} else {
					return Value + 273.15;
				}
				break;
			case TemperatureTypeEnum.KELVIN:
				if (To == TemperatureTypeEnum.CELSIUS) {
					return Value - 273.15;
				} else {
					return (Value * (9 / 5)) -459.67;
				}
				break;
			
		}
	}
}<file_sep>function TimeConverter () {
    
    // Units in Nanosecond
    this.values = {
        "nanosecond": 1,
        "microsecond": 1000,
        "millisecond": 1000000,
        "second": 1000000000,
        "minute": 60000000000,
        "hour": 3600000000000,
        "day": 86400000000000,
        "week": 604800000000000,
        "month": 2629746000000000,
        "year": 31556952000000000,
        "decade": 315360000000000000,
        "century": 3153599999996478000
    };
    
    this.convert = function(From, To, Value) {
        return (Value * this.values[From]) / this.values[To]
    }
}<file_sep>  $(document).ready(function () {

      var toggleAffix = function (affixElement, scrollElement, wrapper) {

          var height = affixElement.outerHeight(),
              top = wrapper.offset().top;

          if (scrollElement.scrollTop() >= top) {
              wrapper.height(height);
              affixElement.addClass("affix");
              toggleNavbarSchema(false);
          } else {
              affixElement.removeClass("affix");
              wrapper.height('auto');
              toggleNavbarSchema(true);
          }

      };


      $('[data-toggle="affix"]').each(function () {
          var ele = $(this),wrapper = $('<div></div>');

          ele.before(wrapper);
          $(window).on('scroll resize', function () {
              toggleAffix(ele, $(this), wrapper);
          });

          // init
          toggleAffix(ele, $(window), wrapper);
      });
      
      // toggle between 'navbar-light' and 'navbar-inverse'
      function toggleNavbarSchema(light) {
          if (light) {
              $("nav").addClass("navbar-light");
              $("nav").removeClass("navbar-inverse");
          } else {
              $("nav").addClass("navbar-inverse");
              $("nav").removeClass("navbar-light");
          }
      }
      
      
      

  });


