-
Notifications
You must be signed in to change notification settings - Fork 0
/
minjs.js
1 lines (1 loc) · 2.95 KB
/
minjs.js
1
function showPage(){$("body").css("display","inline")}function fixHeights(){winHeight=$(window).height(),$(".backdrop").height(winHeight),$(".mobileNav").height(winHeight/30)}function navFunc(){width=$(window).width(),width<=775?($(".nav").css("display","none"),$(".mobileNav").css("display","flex")):($(".nav").css("display","flex"),$(".mobileNav").css("display","none"))}function sideBarOpen(){$(".sideBar").fadeIn()}function sideBarClose(){$(".sideBar").fadeOut()}function smoothScroll(){$("a").on("click",function(a){if(""!==this.hash){a.preventDefault();var b=this.hash;$("html, body").animate({scrollTop:$(b).offset().top},800,function(){window.location.hash=b})}})}function animateBioBorderScroll(){headerPos=$("#bioHead").position(),periodPos=$("#bioPeriod").position(),w=periodPos.left-headerPos.left+$("#bioPeriod").width(),$(".bioBorder").animate({width:w+"px"},300)}function animateSkillsBorderScroll(){headerPos=$("#skillsHead").position(),periodPos=$("#skillsPeriod").position(),w=periodPos.left-headerPos.left+$("#skillsPeriod").width(),$(".skillsBorder").animate({width:w+"px"},300)}function animateFindMeBorderScroll(){headerPos=$("#findMeHead").position(),periodPos=$("#findMePeriod").position(),w=periodPos.left-headerPos.left+$("#skillsPeriod").width(),$("#findMeBorder").animate({width:w+"px"},300)}function animateEduBorderScroll(){headerPos=$("#eduHead").position(),periodPos=$("#eduPeriod").position(),w=periodPos.left-headerPos.left+$("#eduPeriod").width(),$(".educationBorder").animate({width:w+"px"},300)}function animateEmploymentBorderScroll(){headerPos=$("#employHead").position(),periodPos=$("#employPeriod").position(),w=periodPos.left-headerPos.left+$("#employPeriod").width(),$(".employmentBorder").animate({width:w+"px"},300)}function hideSM(){w=$(window).width(),w<774?($(".jobTitle").css("text-align","center"),$(".hideSM").css("display","none"),$(".jobTitle").css("width","50%"),$(".job").css("flex-direction","column")):($(".hideSM").css("display","inline"),$(".jobTitle").css("width","15%"),$(".job").css("flex-direction","row"),$(".jobTitle").css("text-align","left"))}function shrinkIcons(){$(window).width()<=500?$(".findMeLinks").css("font-size","2.5em"):$(".findMeLinks").css("font-size","4em")}$(document).ready(function(){fixHeights(),navFunc(),smoothScroll(),hideSM(),shrinkIcons(),showPage()}),$(window).resize(function(){hideSM(),shrinkIcons()}),$(document).scroll(function(){bioHeight=$(".aboutMe").position(),eduHeight=$(".education").position(),employHeight=$(".employment").position(),skillHeight=$(".skills").position(),findMeHeight=$(".findMe").position(),$(document).scrollTop()>=bioHeight.top-500&&animateBioBorderScroll(),$(document).scrollTop()>=eduHeight.top-500&&animateEduBorderScroll(),$(document).scrollTop()>=employHeight.top-500&&animateEmploymentBorderScroll(),$(document).scrollTop()>=skillHeight.top-600&&animateSkillsBorderScroll(),$(document).scrollTop()>=findMeHeight.top-700&&animateFindMeBorderScroll()}),$(window).resize(function(){navFunc()});