Skip to content

Instantly share code, notes, and snippets.

@rjcoupe
Created January 6, 2016 11:51
Show Gist options
  • Save rjcoupe/31bc6f17ae46379d5c52 to your computer and use it in GitHub Desktop.
Save rjcoupe/31bc6f17ae46379d5c52 to your computer and use it in GitHub Desktop.
wefwegf
(function(){"use strict";var a,b,c,d,e,f,g,h,i,j,k;b=992,$(function(){return g(),h(),k(),j(),$("#blankout").fadeOut(1e3)}),j=function(){return e(),f(),i(),g(),d()},$(window).on("resize",$.debounce(250,j)),a=function(){return device.ios()&&(device.ipad()&&window.orientation%180===0||!device.ipad()&&90===Math.abs(window.orientation))?window.screen.availWidth:window.screen.availHeight},d=window.retriggerWaypoints=function(){return $(window).scrollTop($(window).scrollTop())},e=function(){var c,d,e,f,g,h;return d=h=$(window).height(),f=device.mobile()?"min-height":"height",(device.mobile()||device.tablet())&&(h=a(),d=.8*h,$("#go-down-row").hide()),$("#signup-page").css(f,h),$("#intro").css(f,d),e=h-$(".standard-header-top").height()-$(".standard-header-bottom").height(),$(".page-height").css("height",e),$(window).width()>=b?($(".page-height-gte-md").css("height",e),g=0,c=$("#gemini-page-4").find("h3"),c.each(function(){var a;return a=$(this).height(),a>g?g=a:void 0}),c.height(g)):$(".page-height-lt-md").css("height",e)},g=function(){return device.tablet()||device.mobile()?$(".parallax").addClass("no-parallax"):$(".parallax").each(function(){return $(this).parallax("50%",.1)})},c=function(){var a;return a=$(".standard-header-top"),a.css({position:"absolute",display:"block",top:"0",height:"110px","padding-top":"40px"})},f=function(){var b,d,e,f,g,h,i;return g=$(".standard-header-top"),b=$(".standard-header-bottom"),c(),f=$(".page-section").first(),f.waypoint("destroy"),f.waypoint({handler:function(a){console.log("page1 w",a),"down"===a?(g.css({position:"fixed",display:"none",top:"0",height:"70px","padding-top":"20px"}),g.fadeIn()):c()},offset:g.height()+50}),h=device.mobile()||device.tablet()?a():$(window).height(),i=h-b.height(),e=$(".standard-header-bottom-wrap"),e.css("top",h),e.waypoint("destroy"),e.waypoint({handler:function(a){"down"===a?b.addClass("stuck"):b.removeClass("stuck")},offset:i}),d=$(".standard-header-bottom-stop"),d.waypoint("destroy"),d.waypoint({handler:function(a){return"down"===a?(g.css({position:"absolute",top:$(window).scrollTop()}),b.fadeOut()):(g.css({position:"fixed",height:"70px","padding-top":"20px",top:"0"}),b.fadeIn())},offset:"bottom-in-view"})},i=function(){var a,b;return a=$("#traveling-vertical-bar"),b=function(b,c){return b.waypoint("destroy"),b.waypoint({handler:function(d){var e;d===c?(e=($(window).height()-$(".standard-header-bottom").height()-a.height()+$(".standard-header-top").height())/2,a.css("top",e),a.css("left",b.offset().left-$(window).scrollLeft()),a.height(b.height()),a.addClass("on-the-move"),b.removeClass("vertical-bar")):(b.addClass("vertical-bar"),a.removeClass("on-the-move"))},offset:function(){return($(window).height()-$(this).height())/2}})},b($("#top-vertical-bar"),"down"),b($("#bottom-vertical-bar"),"up")},k=function(){return $("a, button").on("touchend",function(){var a;return a=this,setTimeout(function(){var b,c;return c=a.parentNode,b=a.nextSibling,c.removeChild(a),setTimeout(function(){return c.insertBefore(a,b)},0)},500),!0})},h=function(){return $(".scroll").smoothScroll({speed:800,afterScroll:function(){return d()}}),$("#go-down").on("click",function(){return $(".standard-header-top").fadeIn()}),$("#go-down").smoothScroll("options",{offset:-$(".standard-header-top").height(),easing:"easeInOutCirc"})}}).call(this),function(a){"use strict";function b(b){function e(){this.x=Math.random()*b.width,this.y=Math.random()*b.height,this.vx=d.config.velocity-.3*Math.random(),this.vy=d.config.velocity-.3*Math.random(),this.radius=Math.random()*d.config.star.maxRadius}var f=18e3,g=.1,h=a(b).width(),i=a(b).height(),j=Math.round(i*h/f),k=b.getContext("2d");return d.config={star:{color:"rgba(80, 199, 227, 0.5)",maxRadius:3},line:{color:"rgba(80, 199, 227, 0.5)",width:.5},position:{x:.5*b.width,y:.5*b.height},velocity:g,length:j,distance:120,radius:150,stars:[]},e.prototype={create:function(){k.beginPath(),k.arc(this.x,this.y,this.radius,0,2*Math.PI,!1),k.fill()},animate:function(){var a;for(a=0;a<d.config.length;a+=1){var c=d.config.stars[a];c.y<0||c.y>b.height?(c.vx=c.vx,c.vy=-c.vy):(c.x<0||c.x>b.width)&&(c.vx=-c.vx,c.vy=c.vy),c.x+=c.vx,c.y+=c.vy}},line:function(){var a,b,c,e,f=d.config.length;for(c=0;f>c;c+=1)for(e=0;f>e;e+=1)a=d.config.stars[c],b=d.config.stars[e],a.x-b.x<d.config.distance&&a.y-b.y<d.config.distance&&a.x-b.x>-d.config.distance&&a.y-b.y>-d.config.distance&&a.x-d.config.position.x<d.config.radius&&a.y-d.config.position.y<d.config.radius&&a.x-d.config.position.x>-d.config.radius&&a.y-d.config.position.y>-d.config.radius&&(k.beginPath(),k.moveTo(a.x,a.y),k.lineTo(b.x,b.y),k.stroke(),k.closePath())}},d.createStars=function(){var a,c,f=d.config.length;for(k.clearRect(0,0,b.width,b.height),c=0;f>c;c+=1)d.config.stars.push(new e),a=d.config.stars[c],a.create();a.line(),a.animate()},d.setCanvas=function(){b.width=a(b).width(),b.height=a(b).height()},d.setContext=function(){k.fillStyle=d.config.star.color,k.strokeStyle=d.config.line.color,k.lineWidth=d.config.line.width},d.loop=function(a){a(),c(function(){d.loop(function(){a()})})},d.bind=function(){var c=a(b).offset().top;a(window).on("mousemove",function(a){d.config.position.x=a.pageX,d.config.position.y=a.pageY-c})},d.init=function(){d.setCanvas(),d.setContext(),d.loop(function(){d.createStars()}),d.bind()},d}var c=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)},d={};a(function(){var c=a("body"),d=function(e){"mousemove"===e.type&&b(a("canvas.dots")[0]).init(),c.off("mousemove touchstart",d)};c.on("mousemove touchstart",d)})}(window.jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment