main.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. Intensify by TEMPLATED
  3. templated.co @templatedco
  4. Released for free under the Creative Commons Attribution 3.0 license (templated.co/license)
  5. */
  6. (function($) {
  7. skel.breakpoints({
  8. xlarge: '(max-width: 1680px)',
  9. large: '(max-width: 1280px)',
  10. medium: '(max-width: 980px)',
  11. small: '(max-width: 736px)',
  12. xsmall: '(max-width: 480px)'
  13. });
  14. $(function() {
  15. var $window = $(window),
  16. $body = $('body'),
  17. $header = $('#header');
  18. // Disable animations/transitions until the page has loaded.
  19. $body.addClass('is-loading');
  20. $window.on('load', function() {
  21. window.setTimeout(function() {
  22. $body.removeClass('is-loading');
  23. }, 100);
  24. });
  25. // Fix: Placeholder polyfill.
  26. $('form').placeholder();
  27. // Prioritize "important" elements on medium.
  28. skel.on('+medium -medium', function() {
  29. $.prioritize(
  30. '.important\\28 medium\\29',
  31. skel.breakpoint('medium').active
  32. );
  33. });
  34. // Scrolly.
  35. $('.scrolly').scrolly({
  36. offset: function() {
  37. return $header.height();
  38. }
  39. });
  40. // Menu.
  41. $('#menu')
  42. .append('<a href="#menu" class="close"></a>')
  43. .appendTo($body)
  44. .panel({
  45. delay: 500,
  46. hideOnClick: true,
  47. hideOnSwipe: true,
  48. resetScroll: true,
  49. resetForms: true,
  50. side: 'right'
  51. });
  52. });
  53. })(jQuery);