{"size": 1453, "ext": "js", "max_stars_repo_path": "script.js", "max_stars_repo_name": "reyvanth08/personal-portfolio", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "script.js", "max_issues_repo_name": "reyvanth08/personal-portfolio", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "script.js", "max_forks_repo_name": "reyvanth08/personal-portfolio", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.8196721311, "max_line_length": 86, "alphanum_fraction": 0.5450791466}
$(function() {
  $("#effect").typed({
    strings: ["graduate engineer.", "photography enthusiast.", "front-end designer."],
    stringsElement: null,
    typeSpeed: 45,
    startDelay: 1300,
    backSpeed: 15,
    backDelay: 900,
    loop: true,
    loopCount: false,
    showCursor: false,
    cursorChar: "|",
    attr: null,
    contentType: "html",
    callback: function() {},
    preStringTyped: function() {},
    onStringTyped: function() {},
    resetCallback: function() {}
  });
});

$(document).ready(function() {
  $("a").on("click", function(event) {
    if (this.hash !== "") {
      event.preventDefault();

      var hash = this.hash;

      $("html, body").animate(
        {
          scrollTop: $(hash).offset().top
        },
        800,
        function() {
          window.location.hash = hash;
        }
      );
    } 
  });
});

var sections = $("section"),
  nav = $("nav"),
  nav_height = nav.outerHeight();

$(window).on("scroll", function() {
  var cur_pos = $(this).scrollTop();

  sections.each(function() {
    var top = $(this).offset().top - nav_height,
      bottom = top + $(this).outerHeight();

    if (cur_pos >= top && cur_pos <= bottom) {
      nav.find("a").removeClass("active"); // remove active from all links
      sections.removeClass("active");

      $(this).addClass("active"); // add active to current link
      nav.find('a[href="#' + $(this).attr("id") + '"]').addClass("active");
    }
  });
});