EVR.include("level/map/Display.js");
EVR.Level.Map = function(level)
{
   EVR.Graphic.call(
      this, level.road, null, null, ALIGN_TOP_RIGHT, level.road.container);
   this.level = level;
   this.register = level.register;
   this.height = this.level.register.get_dimensions(true)[1];
   this.build();
   this.append();
   this.display = new EVR.Level.Map.Display(this, this.level);
}
EVR.Level.Map.prototype = new EVR.Graphic;
EVR.Level.Map.prototype.build = function()
{
   var level = this.level;
   var register = this.register;
   this.set_color(level.background);
   this.css.borderTop = register.css.borderTop;
}
EVR.Level.Map.prototype.shape = function()
{
   EVR.Graphic.prototype.shape.call(this);
   var dimensions = this.register.get_dimensions();
   var width = this.container.get_dimensions()[0] - dimensions[0];
   this.set_dimensions(width, dimensions[1]);
}
EVR.Level.Map.prototype.place = function(x, y)
{
   EVR.Graphic.prototype.place.call(this);
   var y = this.register.get_coordinates()[1];
   this.set_coordinates([null, y]);
}
EVR.Level.Map.prototype.draw = function()
{
   EVR.Graphic.prototype.draw.call(this);
   !!this.display && this.display.draw();
}
EVR.Level.Map.prototype.advance_player = function(ii)
{
   this.display.advance_player(ii);
}
EVR.Level.Map.prototype.advance_ghost = function(ii)
{
   this.display.advance_ghost(ii);
}
EVR.Level.Map.prototype.get_player_position = function()
{
   return this.display.get_player_position();
}
EVR.Level.Map.prototype.hide_ghost_indicator = function()
{
   this.display.hide_ghost_indicator();
}
EVR.Level.Map.prototype.toString = function()
{
   return "[object EVR.Level.Map]";
}
EVR.Level.Map.Indicator = function(display, opacity)
{
   this.display = display;
   this.cells = display.row.cells;
   this.border_width = INDICATOR_BORDER_WIDTH;
   this.current = -1;
   this.opacity = opacity;
   this.attached = false;
   this.build_outer();
   this.build_inner();
   this.draw();
}
EVR.Level.Map.Indicator.prototype.build_outer = function()
{
   var element = document.createElement("div");
   var cell = this.cells[0];
   var css = element.style;
   css.width = "100%";
   css.background = INDICATOR_BORDER_COLOR;
   css.position = "relative";
   css.opacity = this.opacity;
   css.fontSize = "0px";
   this.element = element;
}
EVR.Level.Map.Indicator.prototype.build_inner = function()
{
   var element = document.createElement("div");
   var css = element.style;
   css.background = INDICATOR_COLOR;
   css.position = "relative";
   css.width = "100%";
   css.top = this.border_width;
   css.fontSize = "0px";
   this.element.appendChild(element);
   this.inner = element;
}
EVR.Level.Map.Indicator.prototype.draw = function(height)
{
   if (height == null)
   {
      height = this.cells[0].clientHeight;
   }
   height -= 2;
   this.element.style.height = height;
   this.inner.style.height = height - this.border_width * 2;
}
EVR.Level.Map.Indicator.prototype.advance = function(ii)
{
   this.current = ii;
   this.append();
}
EVR.Level.Map.Indicator.prototype.append = function()
{
   this.cells[this.current].appendChild(this.element);
   this.attached = true;
}
EVR.Level.Map.Indicator.prototype.remove = function()
{
   if (this.attached)
   {
      this.cells[this.current].removeChild(this.element);
      this.attached = false;
   }
}
EVR.Level.Map.Indicator.prototype.get_position = function()
{
   return this.current;
}
EVR.Level.Map.Indicator.prototype.toString = function()
{
   return "[object EVR.Level.Map.Indicator]";
}
EVR.Level.Records = function(level)
{
   EVR.Table.call(this, level.road, "1%", "100%");
   this.level = level;
   this.history = level.history;
   this.colors = RECORDS_COLORS;
   this.sizes = RECORDS_FONT_SIZES;
   this.lengths = RECORDS_TIER_LENGTHS;
   this.element.style.textAlign = "center";
   this.texts = [];
   this.new_entry_added = false;
   this.set_times();
   this.display();
   this.append();
}
EVR.Level.Records.prototype = new EVR.Table;
EVR.Level.Records.prototype.set_times = function()
{
   this.times = this.history.get_times().sort(this.compare_times);
}
EVR.Level.Records.prototype.compare_times = function(x, y)
{
   if (x.get() < y.get())
   {
      return -1;
   }
   if (x.get() > y.get())
   {
      return 1;
   }
   return 0;
}
EVR.Level.Records.prototype.display = function()
{
   this.insert_rows();
   var times = this.times;
   this.display_first_tier(times.slice(0, 1)[0]);
   this.display_second_tier(times.slice(1, 3));
   this.display_third_tier(times.slice(3));
}
EVR.Level.Records.prototype.insert_rows = function()
{
   var count = this.lengths[2];
   for (var ii = 0; ii < count; ii++)
   {
      var row = this.insert_row();
      if (ii != count - 1)
      {
	 row.style.height = 100 / count + "%";
      }
   }
}
EVR.Level.Records.prototype.display_first_tier = function(time)
{
   var row = this.get_rows()[0];
   var cell = this.insert_cell(row);
   this.fill_cell(cell, time, 0, this.lengths[2]);
}
EVR.Level.Records.prototype.fill_cell = function(cell, time, index, span)
{
   if (!!span)
   {
      cell.rowSpan = span;
   }
   if (!!!time)
   {
      time = RECORDS_BLANK_TIME_TEXT;
   }
   var color = this.determine_font_color(time);
   var font = RECORDS_FONT_FAMILY;
   var size = this.determine_size(index);
   var string = time.toString(RECORDS_PRECISION);
   var container = this.level.container;
   var text = new EVR.Text(cell, string, font, color, size, container);
   this.style_cell(cell, index);
   this.texts.push(text);
}
EVR.Level.Records.prototype.determine_font_color = function(time)
{
   var newest = this.history.get_newest().time;
   if (time instanceof EVR.Time)
   {
      if (!this.new_entry_added && newest.get() == time.get())
      {
	 this.new_entry_added = true;
	 return RECORDS_NEW_FONT_COLOR;
      }
   }
   return RECORDS_FONT_COLOR;
}
EVR.Level.Records.prototype.determine_size = function(index)
{
   var sizes = this.sizes;
   if (index < 1)
   {
      return sizes[0];
   }
   if (index < 3)
   {
      return sizes[1];
   }
   return sizes[2];
}
EVR.Level.Records.prototype.style_cell = function(cell, index)
{
   var style = cell.style;
   style.background = this.determine_background_color(index);
   style.letterSpacing = RECORDS_LETTER_SPACING;
   style.padding = "0 " + RECORDS_PADDING;
   style.verticalAlign = "middle";
   style.fontWeight = RECORDS_FONT_WEIGHT;
   cell.noWrap = true;
}
EVR.Level.Records.prototype.determine_background_color = function(index)
{
   var colors = this.colors;
   if (index < 3)
   {
      return colors[index];
   }
   return colors[3];
}
EVR.Level.Records.prototype.display_second_tier = function(times)
{
   var span, cell, row, row_count = this.lengths[2];
   for (var ii = 0; ii < this.lengths[1]; ii++)
   {
      span = row_count / 2;
      row = this.get_rows()[ii * span];
      cell = this.insert_cell(row);
      this.fill_cell(cell, times[ii], ii + 1, span);
   }
}
EVR.Level.Records.prototype.display_third_tier = function(times)
{
   var cell, row;
   for (var ii = 0; ii < this.lengths[2]; ii++)
   {
      row = this.get_rows()[ii];
      cell = this.insert_cell(row);
      this.fill_cell(cell, times[ii], ii + 3);
   }
}
EVR.Level.Records.prototype.draw = function()
{
   var texts = this.texts;
   for (var ii = 0; ii < texts.length; ii++)
   {
      texts[ii].set_font_size();
   }
}
EVR.Level.Records.prototype.toString = function()
{
   return "[object EVR.Level.Records]";
}
3.236.121.117
3.236.121.117
3.236.121.117
 
July 18, 2022


A new era ‼

Our infrastructure has recently upgraded ‼

Nugget Communications Bureau 👍

You've never emailed like this before ‼

Roundcube

Webmail software for reading and sending email from @nugget.fun and @shampoo.ooo addresses.

Mailman3

Email discussion lists, modernized with likes and emojis. It can be used for announcements and newsletters in addition to discussions. See lists for Picture Processing or Scrapeboard. Nowadays, people use Discord, but you really don't have to!

FreshRSS

With this hidden in plain sight, old technology, even regular people like you and I can start our own newspaper or social media feed.

Nugget Streaming Media 👍

The content you crave ‼

HLS

A live streaming, video format based on M3U playlists that can be played with HTML5.

RTMP

A plugin for Nginx can receive streaming video from ffmpeg or OBS and forward it as an RTMP stream to sites like Youtube and Twitch or directly to VLC.


Professional ‼

Nugget Productivity Suite 👍

Unleash your potential ‼

Kanboard

Virtual index cards you can use to gamify your daily grind.

Gitea

Grab whatever game code you want, share your edits, and report bugs.

Nugget Security 👍

The real Turing test ‼

Fail2ban

Banning is even more fun when it's automated.

Spamassassin

The documentation explains, "an email which mentions rolex watches, Viagra, porn, and debt all in one" will probably be considered spam.

GoAccess

Display HTTP requests in real time, so you can watch bots try to break into WordPress.

Nugget Entertainment Software 👍

The best in gaming entertainment ‼

Emoticon vs. Rainbow

With everything upgraded to the bleeding edge, this HTML4 game is running better than ever.


Zoom ‼

The game engine I've been working on, SPACE BOX, is now able to export to web, so I'm planning on turning nugget.fun into a games portal by releasing my games on it and adding an accounts system. The upgraded server and software will make it easier to create and maintain. I'm also thinking of using advertising and subscriptions to support the portal, so some of these services, like webmail or the RSS reader, may be offered to accounts that upgrade to a paid subscription.