{"size": 7873, "ext": "js", "max_stars_repo_path": "js/timeline.min.js", "max_stars_repo_name": "salahudinalyb/resume", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "js/timeline.min.js", "max_issues_repo_name": "salahudinalyb/resume", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "js/timeline.min.js", "max_forks_repo_name": "salahudinalyb/resume", "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": 874.7777777778, "max_line_length": 7713, "alphanum_fraction": 0.7264067065}
/**
 * Timeline - a horizontal / vertical timeline component
 * v. 1.1.1
 * Copyright Mike Collins
 * MIT License
 */
"use strict";var _slicedToArray=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],n=!0,l=!1,r=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(i.push(a.value),!t||i.length!==t);n=!0);}catch(e){l=!0,r=e}finally{try{!n&&s.return&&s.return()}finally{if(l)throw r}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function timeline(e,h){var g=[],p="Timeline:",t=window.innerWidth,i=void 0,d=0,y={forceVerticalMode:{type:"integer",defaultValue:600},horizontalStartPosition:{type:"string",acceptedValues:["bottom","top"],defaultValue:"top"},mode:{type:"string",acceptedValues:["horizontal","vertical"],defaultValue:"vertical"},moveItems:{type:"integer",defaultValue:1},verticalStartPosition:{type:"string",acceptedValues:["left","right"],defaultValue:"left"},verticalTrigger:{type:"string",defaultValue:"15%"},visibleItems:{type:"integer",defaultValue:3}};function n(e,t,i){t.classList.add(i),e.parentNode.insertBefore(t,e),t.appendChild(e)}function l(e,t){var i=e.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,l=y.verticalTrigger.defaultValue.match(/(\d*\.?\d*)(.*)/),r=t.unit,a=t.value,s=n;if("px"===r&&n<=a){console.warn('The value entered for the setting "verticalTrigger" is larger than the window height. The default value will be used instead.');var o=_slicedToArray(l,3);a=o[1],r=o[2]}return"px"===r?s=parseInt(s-a,10):"%"===r&&(s=parseInt(s*((100-a)/100),10)),i.top<=s&&i.left<=(window.innerWidth||document.documentElement.clientWidth)&&0<=i.top+i.height&&0<=i.left+i.width}function m(e){var t="translate3d(-"+e.items[d].offsetLeft+"px, 0, 0)";e.scroller.style.webkitTransform=t,e.scroller.style.msTransform=t,e.scroller.style.transform=t}function r(e){var i,n,l,t,r,a,s,o,c;e.timelineEl.classList.add("timeline--horizontal"),i=e,window.innerWidth>i.settings.forceVerticalMode&&(i.itemWidth=i.wrap.offsetWidth/i.settings.visibleItems,i.items.forEach(function(e){e.style.width=i.itemWidth+"px"}),i.scrollerWidth=i.itemWidth*i.items.length,i.scroller.style.width=i.scrollerWidth+"px",l=n=0,i.items.forEach(function(e,t){e.style.height="auto";var i=e.offsetHeight;t%2==0?l=l<i?i:l:n=n<i?i:n}),i.items.forEach(function(e,t){t%2==0?(e.style.height=l+"px","bottom"===i.settings.horizontalStartPosition?(e.classList.add("timeline__item--bottom"),e.style.transform="translateY("+l+"px)"):e.classList.add("timeline__item--top")):(e.style.height=n+"px","bottom"!==i.settings.horizontalStartPosition?(e.classList.add("timeline__item--bottom"),e.style.transform="translateY("+l+"px)"):e.classList.add("timeline__item--top"))}),i.scroller.style.height=l+n+"px"),m(e),function(e){if(e.items.length>e.settings.visibleItems){var t=document.createElement("button"),i=document.createElement("button"),n=e.items[0].offsetHeight;t.className="timeline-nav-button timeline-nav-button--prev",i.className="timeline-nav-button timeline-nav-button--next",t.textContent="Previous",i.textContent="Next",t.style.top=n+"px",i.style.top=n+"px",0===d?t.disabled=!0:d+1===e.items.length&&(i.disabled=!0),e.timelineEl.appendChild(t),e.timelineEl.appendChild(i)}}(e),function(e){e.timelineEl.querySelector(".timeline-divider")&&e.timelineEl.querySelector(".timeline-divider").remove();var t=e.items[0].offsetHeight,i=document.createElement("span");i.className="timeline-divider",i.style.top=t+"px",e.timelineEl.appendChild(i)}(e),r=(t=e).timelineEl.querySelectorAll(".timeline-nav-button"),a=t.timelineEl.querySelector(".timeline-nav-button--prev"),s=t.timelineEl.querySelector(".timeline-nav-button--next"),o=t.items.length-t.settings.visibleItems,c=parseInt(t.settings.moveItems,10),[].forEach.call(r,function(e){e.addEventListener("click",function(e){e.preventDefault(),0===(d=this.classList.contains("timeline-nav-button--next")?d+=c:d-=c)||d<0?(d=0,a.disabled=!0,s.disabled=!1):d===o||o<d?(d=o,a.disabled=!1,s.disabled=!0):(a.disabled=!1,s.disabled=!1),m(t)})})}function a(){g.forEach(function(e){e.timelineEl.style.opacity=0,e.timelineEl.classList.contains("timeline--loaded")||e.items.forEach(function(e){n(e.querySelector(".timeline__content"),document.createElement("div"),"timeline__content__wrap"),n(e.querySelector(".timeline__content__wrap"),document.createElement("div"),"timeline__item__inner")}),function(e){d=0,e.timelineEl.classList.remove("timeline--horizontal","timeline--mobile"),e.scroller.removeAttribute("style"),e.items.forEach(function(e){e.removeAttribute("style"),e.classList.remove("animated","fadeIn","timeline__item--left","timeline__item--right")});var t=e.timelineEl.querySelectorAll(".timeline-nav-button");[].forEach.call(t,function(e){e.parentNode.removeChild(e)})}(e),window.innerWidth<=e.settings.forceVerticalMode&&e.timelineEl.classList.add("timeline--mobile"),"horizontal"===e.settings.mode&&window.innerWidth>e.settings.forceVerticalMode?r(e):function(i){var n=0;i.items.forEach(function(e,t){e.classList.remove("animated","fadeIn"),!l(e,i.settings.verticalTrigger)&&0<t?e.classList.add("animated"):n=t,t%2==("left"===i.settings.verticalStartPosition?1:0)&&window.innerWidth>i.settings.forceVerticalMode?e.classList.add("timeline__item--right"):e.classList.add("timeline__item--left")});for(var e=0;e<n;e+=1)i.items[e].classList.remove("animated","fadeIn");window.addEventListener("scroll",function(){i.items.forEach(function(e){l(e,i.settings.verticalTrigger)&&e.classList.add("fadeIn")})})}(e),e.timelineEl.classList.add("timeline--loaded"),setTimeout(function(){e.timelineEl.style.opacity=1},500)})}e.length&&[].forEach.call(e,function(e){var t=e.id?"#"+e.id:"."+e.className,i="could not be found as a direct descendant of",n=e.dataset,l=void 0,r=void 0,a=void 0,s={};try{if(!(l=e.querySelector(".timeline__wrap")))throw new Error(p+" .timeline__wrap "+i+" "+t);if(!(r=l.querySelector(".timeline__items")))throw new Error(p+" .timeline__items "+i+" .timeline__wrap");a=[].slice.call(r.children,0)}catch(e){return console.warn(e.message),!1}Object.keys(y).forEach(function(e){var t,i;s[e]=y[e].defaultValue,n[e]?s[e]=n[e]:h&&h[e]&&(s[e]=h[e]),"integer"===y[e].type?s[e]&&(t=s[e],i=e,"number"==typeof t||t%1==0||(console.warn(p+' The value "'+t+'" entered for the setting "'+i+'" is not an integer.'),0))||(s[e]=y[e].defaultValue):"string"===y[e].type&&y[e].acceptedValues&&-1===y[e].acceptedValues.indexOf(s[e])&&(console.warn(p+' The value "'+s[e]+'" entered for the setting "'+e+'" was not recognised.'),s[e]=y[e].defaultValue)});var o=y.verticalTrigger.defaultValue.match(/(\d*\.?\d*)(.*)/),c=s.verticalTrigger.match(/(\d*\.?\d*)(.*)/),d=_slicedToArray(c,3),m=d[1],u=d[2],f=!0;if(m||(console.warn(p+" No numercial value entered for the 'verticalTrigger' setting."),f=!1),"px"!==u&&"%"!==u&&(console.warn(p+" The setting 'verticalTrigger' must be a percentage or pixel value."),f=!1),"%"===u&&(100<m||m<0)?(console.warn(p+" The 'verticalTrigger' setting value must be between 0 and 100 if using a percentage value."),f=!1):"px"===u&&m<0&&(console.warn(p+" The 'verticalTrigger' setting value must be above 0 if using a pixel value."),f=!1),!1===f){var v=_slicedToArray(o,3);m=v[1],u=v[2]}s.verticalTrigger={unit:u,value:m},s.moveItems>s.visibleItems&&(console.warn(p+' The value of "moveItems" ('+s.moveItems+') is larger than the number of "visibleItems" ('+s.visibleItems+'). The value of "visibleItems" has been used instead.'),s.moveItems=s.visibleItems),g.push({timelineEl:e,wrap:l,scroller:r,items:a,settings:s})}),a(),window.addEventListener("resize",function(){clearTimeout(i),i=setTimeout(function(){var e=window.innerWidth;e!==t&&(a(),t=e)},250)})}window.jQuery&&(window.jQuery.fn.timeline=function(e){return timeline(this,e),this});
//# sourceMappingURL=timeline.min.js.map
