script.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. function mCustomScrollbar() {
  2. $(window).on("load",function(){
  3. $(".content").mCustomScrollbar();
  4. });
  5. }
  6. function active() {
  7. $chapone = $('.section > div > .chap > a:nth-of-type(1)');
  8. $chap = $('.section > div > .chap > a');
  9. $chapone.addClass('active');
  10. $chap.click(function(event) {
  11. $(this).parent().children('a').removeClass('active');
  12. $(this).addClass('active');
  13. return false;
  14. });
  15. }
  16. function ScaleFirst() {
  17. var $bck = $('#start > .section');
  18. $bck.css( {
  19. 'transform': 'scale(0.95, 0.95)',
  20. 'transition': 'all 0.8s ease',
  21. });
  22. }
  23. function ScaleLast() {
  24. var $bck = $('#start > .section');
  25. $bck.css( {
  26. 'transform': 'scale(1, 1)',
  27. 'transition': 'all 0.8s ease',
  28. });
  29. }
  30. function scrollClick() {
  31. $('ul.navigation').singlePageNav({
  32. updateHash: false,
  33. currentClass: 'active',
  34. speed:1500,
  35. });
  36. }
  37. function scrollify() {
  38. $.scrollify({
  39. section : "#start .section",
  40. scrollSpeed:1500,
  41. touchScroll:true,
  42. overflowScroll: false,
  43. // before: function() {
  44. // ScaleFirst();
  45. // },
  46. // after: function() {
  47. // ScaleLast();
  48. // },
  49. });
  50. }
  51. function fixscroll() {
  52. $('#fullvideo, #vidéos, #videos, #vídeos')
  53. .click(function(){
  54. $(this).find('iframe').addClass('clicked')})
  55. .mouseleave(function(){
  56. $(this).find('iframe').removeClass('clicked')});
  57. }
  58. function hamburger(){
  59. var forEach=function(t,o,r){if("[object Object]"===Object.prototype.toString.call(t))for(var c in t)Object.prototype.hasOwnProperty.call(t,c)&&o.call(r,t[c],c,t);else for(var e=0,l=t.length;l>e;e++)o.call(r,t[e],e,t)};
  60. var hamburgers = document.querySelectorAll(".hamburger");
  61. if (hamburgers.length > 0) {
  62. forEach(hamburgers, function(hamburger) {
  63. hamburger.addEventListener("click", function() {
  64. this.classList.toggle("is-active");
  65. }, false);
  66. });
  67. }
  68. }
  69. function hambugeract(){
  70. var $act = $("button");
  71. var $nav = $(".catbox");
  72. var $li = $(".catlist a");
  73. $act.click(function(event) {
  74. $nav.toggleClass("active");
  75. });
  76. $li.click(function(event) {
  77. $nav.removeClass('active');
  78. $act.removeClass('is-active');
  79. });
  80. }
  81. $(document).ready(function() {
  82. mCustomScrollbar();
  83. fixscroll();
  84. active();
  85. scrollify();
  86. scrollClick();
  87. hamburger();
  88. hambugeract();
  89. });