EVR.include("title/word/Word.js");
EVR.Title = function(field)
{
   EVR.Graphic.call(this, field, null, null, ALIGN_TOP);
   this.field = field;
   this.words = [];
   this.setAttributes();
   this.append();
   this.addWords();
}
EVR.Title.prototype = new EVR.Graphic;
EVR.Title.prototype.setAttributes = function()
{
   this.element.id = "title";
   this.set_proportions(TITLE_WIDTH, TITLE_HEIGHT);
   this.place(0, TITLE_MARGIN);
}
EVR.Title.prototype.addWords = function()
{
   var words = this.words;
   words.push(new EVR.Title.Word(this, "EMOTICON", TITLE_EMOTICON_FONT_SIZE));
   words.push(new EVR.Title.Word(this, "VERSUS", TITLE_VERSUS_FONT_SIZE));
   words.push(new EVR.Title.Word(this, "RAINBOW", TITLE_RAINBOW_FONT_SIZE));
   this.words = words;
}
EVR.Title.prototype.draw = function()
{
   EVR.Graphic.prototype.draw.call(this);
   var words = this.words;
   for (var ii = 0; ii < words.length; ii++)
   {
      words[ii].draw();
   }
}
EVR.Title.prototype.toString = function()
{
   return "[object EVR.Title]";
}
EVR.include("title/word/Glyph.js");
EVR.Title.Word = function(title, word, font_size)
{
   this.title = title;
   this.word = word;
   this.font_size = font_size;
   this.glyphs = [];
   this.setElement();
   this.addGlyphs();
   this.setFontSize();
}
EVR.Title.Word.prototype.setElement = function()
{
   var element = document.createElement("span");
   element.id = this.word;
   element.className = "word";
   this.title.element.appendChild(element);
   this.element = element;
}
EVR.Title.Word.prototype.addGlyphs = function()
{
   var word = this.word;
   var glyphs = this.glyphs;
   for (var ii = 0; ii < word.length; ii++)
   {
      glyphs.push(new EVR.Title.Word.Glyph(this, word.charAt(ii)));
   }
   this.glyphs = glyphs;
}
EVR.Title.Word.prototype.setFontSize = function()
{
   var dimensions = this.title.field.get_dimensions();
   var modifier = dimensions[1] / dimensions[0];
   var basis = dimensions[0] * modifier;
   var style = this.element.style;
   style.fontSize = parseInt(basis * this.font_size) + "px";
   modifier = dimensions[0] / dimensions[1];
   style.letterSpacing = parseInt(modifier * TITLE_LETTER_SPACING) + "px";
}
EVR.Title.Word.prototype.draw = function()
{
   this.setFontSize();
}
EVR.Title.Word.Glyph = function(word, character)
{
   this.word = word;
   this.character = character;
   this.setElement();
   this.addBackground();
   this.addForeground();
}
EVR.Title.Word.Glyph.prototype.setElement = function()
{
   var element = document.createElement("span");
   element.id = this.character;
   this.word.element.appendChild(element);
   this.element = element;
}
EVR.Title.Word.Glyph.prototype.addForeground = function()
{
   var element = document.createElement("span");
   element.innerHTML = this.character;
   element.className = "foreground";
   this.element.appendChild(element);
}
EVR.Title.Word.Glyph.prototype.addBackground = function()
{
   var element = document.createElement("span");
   element.innerHTML = this.character;
   element.className = "background";
   this.element.appendChild(element);
}
EVR.include("level/cluster/Cluster.js");
EVR.include("level/loader/Loader.js");
EVR.include("level/road/Road.js");
EVR.include("level/Clock.js");
EVR.include("level/register/Register.js");
EVR.include("level/meter/Meter.js");
EVR.include("level/map/Map.js");
EVR.include("level/countdown/Countdown.js");
EVR.include("level/Prompt.js");
EVR.include("level/streak/Streak.js");
EVR.include("level/cheers/Cheers.js");
EVR.include("level/Delegate.js");
EVR.include("level/indicators/Indicators.js");
EVR.include("level/summary/Summary.js");
EVR.include("level/records/Records.js");
EVR.Level = function(evr, container, id, practice)
{
   this.evr = evr;
   this.container = container;
   this.id = parseInt(id);
   this.practice = practice;
   this.sound = evr.sound;
   this.initialize_states();
   this.load()
   this.add_children();
}
EVR.Level.prototype.initialize_states = function()
{
   this.states = [];
   this.states[LEVEL_STATE_WAITING] = true;
   this.states[LEVEL_STATE_RACING] = false;
   this.states[LEVEL_STATE_PAUSED] = false;
   this.states[LEVEL_STATE_SUMMARIZING] = false;
   this.states[LEVEL_STATE_FINISHED] = false;
}
EVR.Level.prototype.load = function()
{
   this.loader = new EVR.Level.Loader(this);
   this.loader.load();
   this.container.set_colors(this.sky);
}
EVR.Level.prototype.add_children = function()
{
   this.road = new EVR.Level.Road(this);
   this.clock = new EVR.Level.Clock(this);
   this.register = new EVR.Level.Register(this);
   this.meter = new EVR.Level.Meter(this);
   this.map = new EVR.Level.Map(this);
   this.prompt = new EVR.Level.Prompt(this);
   this.streak = new EVR.Level.Streak(this);
   this.cheers = new EVR.Level.Cheers(this);
   this.add_countdown();
   this.delegate = new EVR.Level.Delegate(this);
   this.add_indicators();
}
EVR.Level.prototype.add_countdown = function()
{
   var current = this;
   var action = function() { current.start() };
   this.countdown = new EVR.Level.Countdown(this, this.container, action);
}
EVR.Level.prototype.add_indicators = function()
{
   var record_count = this.evr.history.count_records();
   if (this.id == 1 && record_count < LEVEL_INDICATOR_DISPLAY_THRESHOLD)
   {
      this.indicators = new EVR.Level.Indicators(this);
   }
}
EVR.Level.prototype.draw = function()
{
   var states = this.states;
   if (states[LEVEL_STATE_RACING] && !states[LEVEL_STATE_PAUSED])
   {
      this.pause();
   }
   this.road.draw();
   this.clock.attached && this.clock.draw();
   this.register.attached && this.register.draw();
   this.meter.attached && this.meter.draw();
   this.map.attached && this.map.draw();
   this.prompt.attached && this.prompt.draw();
   this.streak.draw();
   this.cheers.draw();
   this.countdown.draw();
   !!this.summary && this.summary.draw();
   !!this.records && this.records.attached && this.records.draw();
   !!this.indicators && this.indicators.draw();
}
EVR.Level.prototype.start = function()
{
   var current = this;
   window.setTimeout(
      function()
      {
	 current.road.path.play();
	 current.clock.start();
// 	 !!current.indicators && current.indicators.remove();
	 current.set_state(LEVEL_STATE_RACING, true);
      }, LEVEL_START_DELAY);
}
EVR.Level.prototype.count_lanes = function()
{
   return !!this.beams && this.beams.length;
}
EVR.Level.prototype.finish = function()
{
   this.set_state(LEVEL_STATE_RACING, false);
   if (this.practice)
   {
      this.set_state(LEVEL_STATE_FINISHED, true);
      this.prompt.set_finish_text();
      this.prompt.toggle();
   }
   else
   {
      var road = this.road;
      road.path.remove();
      road.racer.remove();
      road.ghost.remove();
      !!this.indicators && this.indicators.remove();
      this.map.remove();
      this.register.remove();
      this.meter.remove();
      this.clock.remove();
      this.set_progress();
      this.update_expert_progress();
      this.initialize_history();
      this.save_trail();
      this.cheers.scroll();
      this.set_state(LEVEL_STATE_FINISHED, true);
      this.display_summary();
   }
}
EVR.Level.prototype.set_progress = function()
{
   var query = null;
   if (this.goal_cleared())
   {
      query = "clear=" + this.id;
   }
   var path = SOURCE_PATH + "level/update_progress.php";
   this.progress = parseInt(new EVR.Requester(path, query, true).execute());
}
EVR.Level.prototype.goal_cleared = function()
{
   return this.clock.time.get() <= this.goal.get();
}
EVR.Level.prototype.update_expert_progress = function()
{
   if (this.expert_goal_cleared())
   {
      var query = "id=" + this.id;
      var path = SOURCE_PATH + "level/update_expert_progress.php";
      new EVR.Requester(path, query, true).execute();
   }
}
EVR.Level.prototype.expert_goal_cleared = function()
{
   return this.clock.time.get() <= this.advanced.get();
}
EVR.Level.prototype.initialize_history = function()
{
   var history = this.evr.history;
   history.set_level(this);
   history.store_newest_record();
   this.history = history;
}
EVR.Level.prototype.save_trail = function()
{
   var best = this.history.get_best_time();
   if (best == null || this.clock.time.get() <= best)
   {
      this.road.path.trail.save();
   }
}
EVR.Level.prototype.display_summary = function()
{
   this.set_state(LEVEL_STATE_SUMMARIZING, true);
   this.summary = new EVR.Level.Summary(this);
}
EVR.Level.prototype.set_state = function(name, state)
{
   this.states[name] = !!state ? state : !this.states[name];
}
EVR.Level.prototype.remove = function()
{
   this.road.remove();
   this.prompt.attached && this.prompt.remove();
   !!this.indicators && this.indicators.remove();
   this.streak.clear();
   this.cheers.remove();
}
EVR.Level.prototype.pause = function()
{
   this.clock.toggle();
   this.road.path.toggle();
   this.set_state(LEVEL_STATE_PAUSED);
   if (this.states[LEVEL_STATE_PAUSED])
   {
      this.prompt.append();
   }
   else
   {
      this.prompt.remove();
   }
}
EVR.Level.prototype.is_clear = function()
{
   return this.progress >= this.id;
}
EVR.Level.prototype.next_level_is_available = function()
{
   return this.is_clear() && this.id < LEVEL_LIMIT;
}
EVR.Level.prototype.show_records = function()
{
   this.summary.remove();
   this.set_state(LEVEL_STATE_SUMMARIZING, false);
   this.records = new EVR.Level.Records(this);
}
EVR.Level.prototype.toString = function()
{
   return "[object EVR.Level]";
}
44.192.38.49
44.192.38.49
44.192.38.49
 
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.