Skip to content

Commit

Permalink
More js changes
Browse files Browse the repository at this point in the history
  • Loading branch information
atishay committed Nov 4, 2018
1 parent fa0ecf9 commit e7e719e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ function enableScrollUp(){if(eleScrollUp.classList.contains('hidden')){eleScroll
function disableScrollUp(){if(!eleScrollUp.classList.contains('hidden')){eleScrollUp.classList.add('hidden');}}
function pin(){if(eleHeader.classList.contains(classes.unpinned)){eleHeader.classList.remove(classes.unpinned);eleHeader.classList.add(classes.pinned);}}
function unpin(){if(eleHeader.classList.contains(classes.pinned)||!eleHeader.classList.contains(classes.unpinned)){eleHeader.classList.remove(classes.pinned);eleHeader.classList.add(classes.unpinned);}}
document.addEventListener("turbolinks:load",function(){eleCheckbox=document.getElementsByClassName('hamburger')[0];eleHeader=document.getElementById('header');eleScrollUp=document.getElementsByClassName('scrollUp')[0];document.addEventListener('scroll',onScroll,false);onScroll();});})();document.addEventListener("DOMContentLoaded",()=>{document.getElementsByClassName('scrollUp')[0].addEventListener('click',(e)=>{e.preventDefault();window.scrollTo({top:0,left:0,behavior:'smooth'});});});!function(){"use strict";function o(){var o=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==o.__forceSmoothScrollPolyfill__)){var l,e=o.HTMLElement||o.Element,r=468,i={scroll:o.scroll||o.scrollTo,scrollBy:o.scrollBy,elementScroll:e.prototype.scroll||n,scrollIntoView:e.prototype.scrollIntoView},s=o.performance&&o.performance.now?o.performance.now.bind(o.performance):Date.now,c=(l=o.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(l)?1:0);o.scroll=o.scrollTo=function(){void 0!==arguments[0]&&(!0!==f(arguments[0])?h.call(o,t.body,void 0!==arguments[0].left?~~arguments[0].left:o.scrollX||o.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:o.scrollY||o.pageYOffset):i.scroll.call(o,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:o.scrollX||o.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:o.scrollY||o.pageYOffset))},o.scrollBy=function(){void 0!==arguments[0]&&(f(arguments[0])?i.scrollBy.call(o,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(o,t.body,~~arguments[0].left+(o.scrollX||o.pageXOffset),~~arguments[0].top+(o.scrollY||o.pageYOffset)))},e.prototype.scroll=e.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==f(arguments[0])){var o=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===o?this.scrollLeft:~~o,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},e.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==f(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},e.prototype.scrollIntoView=function(){if(!0!==f(arguments[0])){var l=function(o){var l,e,r,i;do{l=(o=o.parentNode)===t.body}while(!1===l&&!1===(r=p(e=o,"Y")&&a(e,"Y"),i=p(e,"X")&&a(e,"X"),r||i));return l=null,o}(this),e=l.getBoundingClientRect(),r=this.getBoundingClientRect();l!==t.body?(h.call(this,l,l.scrollLeft+r.left-e.left,l.scrollTop+r.top-e.top),"fixed"!==o.getComputedStyle(l).position&&o.scrollBy({left:e.left,top:e.top,behavior:"smooth"})):o.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function n(o,t){this.scrollLeft=o,this.scrollTop=t}function f(o){if(null===o||"object"!=typeof o||void 0===o.behavior||"auto"===o.behavior||"instant"===o.behavior)return!0;if("object"==typeof o&&"smooth"===o.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+o.behavior+" is not a valid value for enumeration ScrollBehavior.")}function p(o,t){return"Y"===t?o.clientHeight+c<o.scrollHeight:"X"===t?o.clientWidth+c<o.scrollWidth:void 0}function a(t,l){var e=o.getComputedStyle(t,null)["overflow"+l];return"auto"===e||"scroll"===e}function d(t){var l,e,i,c,n=(s()-t.startTime)/r;c=n=n>1?1:n,l=.5*(1-Math.cos(Math.PI*c)),e=t.startX+(t.x-t.startX)*l,i=t.startY+(t.y-t.startY)*l,t.method.call(t.scrollable,e,i),e===t.x&&i===t.y||o.requestAnimationFrame(d.bind(o,t))}function h(l,e,r){var c,f,p,a,h=s();l===t.body?(c=o,f=o.scrollX||o.pageXOffset,p=o.scrollY||o.pageYOffset,a=i.scroll):(c=l,f=l.scrollLeft,p=l.scrollTop,a=n),d({scrollable:c,method:a,startTime:h,startX:f,startY:p,x:e,y:r})}}"object"==typeof exports&&"undefined"!=typeof module?module.exports={polyfill:o}:o()}();document.getElementsByTagName('html')[0].classList.remove('no-js');console.log("%c Welcome to my website","padding:20px; font: 38px Impact, sans-serif; color: #ddd; text-shadow: 0 1px 1px #bbb,0 2px 0 #999, 0 3px 0 #888, 0 4px 0 #777, 0 5px 0 #666, 0 6px 0 #555, 0 7px 0 #444, 0 8px 0 #333, 0 9px 7px #302314;");console.log("If you find something cool and would like to learn more, please contact me using the contact page. Will love to hear from a fellow developer");Turbolinks.start();
document.addEventListener("turbolinks:load",function(){eleCheckbox=document.getElementsByClassName('hamburger')[0];eleHeader=document.getElementById('header');eleScrollUp=document.getElementsByClassName('scrollUp')[0];document.addEventListener('scroll',onScroll,false);onScroll();});})();document.addEventListener("DOMContentLoaded",()=>{document.getElementsByClassName('scrollUp')[0].addEventListener('click',(e)=>{e.preventDefault();window.scrollTo({top:0,left:0,behavior:'smooth'});});});document.getElementsByTagName('html')[0].classList.remove('no-js');console.log("%c Welcome to my website","padding:20px; font: 38px Impact, sans-serif; color: #ddd; text-shadow: 0 1px 1px #bbb,0 2px 0 #999, 0 3px 0 #888, 0 4px 0 #777, 0 5px 0 #666, 0 6px 0 #555, 0 7px 0 #444, 0 8px 0 #333, 0 9px 7px #302314;");console.log("If you find something cool and would like to learn more, please contact me using the contact page. Will love to hear from a fellow developer");Turbolinks.start();
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Target":"js/main.min.b8d871be6a5fe05e8ac9b19298b7854c4517428c3a10a979d775fe001942312dbce4d2118cae650f3c5d4c6777bdfb9d50a6b18b509ef740485067d21cf31997.js","MediaType":"application/javascript","Data":{"Integrity":"sha512-uNhxvmpf4F6KybGSmLeFTEUXQow6EKl513X+ABlCMS285NIRjK5lDzxdTGd3vfudUKaxi1Ce90BIUGfSHPMZlw=="}}
{"Target":"js/main.min.09354428a84f7865cd4e85611ec24b363e460f9fb4250a9ed1b1519d022e62ca1ecbe7ab2131877e8717e38815283110b002981cdf84264f9d9352d0cda89b5b.js","MediaType":"application/javascript","Data":{"Integrity":"sha512-CTVEKKhPeGXNToVhHsJLNj5GD5+0JQqe0bFRnQIuYsoey+erITGHfocX44gVKDEQsAKYHN+EJk+dk1LQzaibWw=="}}

0 comments on commit e7e719e

Please sign in to comment.