Hi There, I’m Felix

I make useful, fast, and beautiful software for the web.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
app = { init: function() { this.wid.init(); }, wid: { // some global options for the type simulation options: { addDelay: 80, // between adding new chars removeDelay: 10, // between removing chars varation: 10, // varation limit for delays fullMsgTime: 1000, // time a full msg is shown msgEndTime: 300, // time before going to next msg loop: false, msgs: [ "I plan, design, and develop software" ], }, init: function() { this.writeMsg(0); }, writeMsg: function(msgIndex) { var self = this, writer = "", charIndex = 0, msg = this.options.msgs[msgIndex], overlapWithPrev = 0, overlapWithNext = 0; if (msgIndex > 0) { // if this is not the first msg, check overlap with the // previous msg overlapWithPrev = this.getOverlap(msg, this.options.msgs[msgIndex - 1]); } if (msgIndex < this.options.msgs.length - 1) { // if there is another msg in the queue, check overlap // with that next msg overlapWithNext = this.getOverlap(msg, this.options.msgs[msgIndex + 1]); } if (overlapWithPrev) { // in this case we dont start with an empty string // but with the part that overlapped with the // previous message writer = msg.substring(0, overlapWithPrev); charIndex += overlapWithPrev; } this.modifyMsg(msgIndex, writer, charIndex, overlapWithNext); },