script.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. (function ($) {
  2. 'use strict';
  3. // Preloader js
  4. $(window).on('load', function () {
  5. $('.preloader').fadeOut(300);
  6. });
  7. // headroom js
  8. $('.navigation').headroom();
  9. // Background-images
  10. $('[data-background]').each(function () {
  11. $(this).css({
  12. 'background-image': 'url(' + $(this).data('background') + ')'
  13. });
  14. });
  15. $('.featured-post-slider').slick({
  16. dots: false,
  17. speed: 300,
  18. autoplay: true,
  19. arrows: false,
  20. slidesToShow: 4,
  21. slidesToScroll: 1,
  22. responsive: [{
  23. breakpoint: 1024,
  24. settings: {
  25. slidesToShow: 2
  26. }
  27. },
  28. {
  29. breakpoint: 600,
  30. settings: {
  31. slidesToShow: 2
  32. }
  33. },
  34. {
  35. breakpoint: 480,
  36. settings: {
  37. slidesToShow: 1
  38. }
  39. }
  40. ]
  41. });
  42. // Masonry
  43. setTimeout(function(){
  44. $('.masonry-container').masonry({
  45. itemSelector: '.masonry-container > div',
  46. columnWidth: 1
  47. });
  48. }, 500);
  49. // instafeed
  50. if (($('#instafeed').length) !== 0) {
  51. var accessToken = $('#instafeed').attr('data-accessToken');
  52. var userFeed = new Instafeed({
  53. get: 'user',
  54. resolution: 'low_resolution',
  55. accessToken: accessToken,
  56. template: '<div class="instagram-post"><a href="{{link}}" target="_blank"><img class="img-fluid w-100" src="{{image}}" alt="instagram-image"></a></div>'
  57. });
  58. userFeed.run();
  59. }
  60. setTimeout(function () {
  61. $('.instagram-slider').slick({
  62. dots: false,
  63. speed: 300,
  64. autoplay: true,
  65. arrows: false,
  66. slidesToShow: 6,
  67. slidesToScroll: 1,
  68. responsive: [{
  69. breakpoint: 1024,
  70. settings: {
  71. slidesToShow: 4
  72. }
  73. },
  74. {
  75. breakpoint: 600,
  76. settings: {
  77. slidesToShow: 3
  78. }
  79. },
  80. {
  81. breakpoint: 480,
  82. settings: {
  83. slidesToShow: 2
  84. }
  85. }
  86. ]
  87. });
  88. }, 1500);
  89. // article reading time
  90. $('article').each(function () {
  91. let _this = $(this);
  92. _this.readingTime({
  93. readingTimeTarget: _this.find('.eta'),
  94. remotePath: _this.attr('data-file'),
  95. remoteTarget: _this.attr('data-target')
  96. });
  97. });
  98. })(jQuery);