Advertisement
ArtSemkin

Untitled

Jul 23rd, 2020
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. /**
  2. * Page Load Strategy
  3. */
  4. window.$window.on('load', function () {
  5.  
  6. new Animations();
  7.  
  8. // load fonts first
  9. fontObserver()
  10. // prepare all the texts
  11. .then(() => SetText.splitText({
  12. target: window.$document.find('.js-split-text')
  13. }))
  14. .then(() => SetText.setLines({
  15. target: window.$document.find('.split-text[data-split-text-set="lines"]')
  16. }))
  17. .then(() => SetText.setWords({
  18. target: window.$document.find('.split-text[data-split-text-set="words"]')
  19. }))
  20. .then(() => SetText.setChars({
  21. target: window.$document.find('.split-text[data-split-text-set="chars"]')
  22. }))
  23. // init template components
  24. .then(() => {
  25. new LazyLoad({
  26. scope: window.$document,
  27. setPaddingBottom: true,
  28. run: true
  29. });
  30. initComponents(window.$document);
  31. })
  32. .then(() => window.PagePreloader.finish())
  33. .then(() => {
  34. // init cursor only on non-touch browsers
  35. if (window.theme.cursorFollower.enabled && !window.Modernizr.touchevents) {
  36. new Cursor({
  37. scope: window.$document,
  38. target: $('#js-cursor'),
  39. cursorElements: '[data-arts-cursor]',
  40. highlightElements: 'a:not(a[data-arts-cursor]):not(.social__item a):not(.section-video__link):not(.no-highlight), button:not(button[data-arts-cursor]), .filter__item, .section-nav-projects__header', // links to highlight
  41. highlightScale: 1.5, // default highlight scaling
  42. magneticElements: '[data-arts-cursor-magnetic]', // magnetic elements
  43. magneticScaleCursorBy: 1.3, // default magnetic scaling
  44. animDuration: 0.25,
  45. });
  46. }
  47. // begin animations
  48. window.SMController.enabled(true);
  49. window.SMController.update(true);
  50. });
  51.  
  52. // init AJAX navigation
  53. if (window.theme.ajax.enabled) {
  54. new PJAX({
  55. target: window.$barbaWrapper,
  56. scope: window.$document
  57. });
  58. }
  59.  
  60. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement