Advertisement
artemsemkin

Asli HTML -> WP #4

Jul 6th, 2023
864
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.86 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * Enqueue Theme JS Files
  5.  */
  6. add_action( 'wp_enqueue_scripts', 'arts_enqueue_js', 50 );
  7. function arts_enqueue_js() {
  8.   // GSAP libraries
  9.   $gsap_libraries_version = '3.12.2';
  10.   $vendor_scripts_path    = ARTS_THEME_URL . '/js/vendor/';
  11.  
  12.   wp_enqueue_script( 'gsap', $vendor_scripts_path . 'gsap.min.js', array(), $gsap_libraries_version, true );
  13.   wp_enqueue_script( 'drawsvg-plugin', $vendor_scripts_path . 'DrawSVGPlugin.min.js', array( 'gsap' ), $gsap_libraries_version, true );
  14.   wp_enqueue_script( 'morphsvg-plugin', $vendor_scripts_path . 'MorphSVGPlugin.min.js', array( 'gsap' ), $gsap_libraries_version, true );
  15.   wp_enqueue_script( 'scroll-to-plugin', $vendor_scripts_path . 'ScrollToPlugin.min.js', array( 'gsap' ), $gsap_libraries_version, true );
  16.   wp_enqueue_script( 'split-text', $vendor_scripts_path . 'SplitText.min.js', array( 'gsap' ), $gsap_libraries_version, true );
  17.   wp_enqueue_script( 'scrolltrigger', $vendor_scripts_path . 'ScrollTrigger.min.js', array( 'gsap' ), $gsap_libraries_version, true );
  18.  
  19.   wp_enqueue_script( 'deepmerge', $vendor_scripts_path . 'deepmerge.min.js', array(), ARTS_THEME_VERSION, true );
  20.   wp_enqueue_script( 'distribute-by-position', $vendor_scripts_path . 'distributeByPosition.js', array(), ARTS_THEME_VERSION, true );
  21.   wp_enqueue_script( 'lazy-load', $vendor_scripts_path . 'lazyload.min.js', array(), ARTS_THEME_VERSION, true );
  22.  
  23.   wp_enqueue_script(
  24.     'asli-framework',
  25.     ARTS_THEME_URL . '/js/framework.js',
  26.     array(
  27.       'gsap',
  28.       'drawsvg-plugin',
  29.       'morphsvg-plugin',
  30.       'scroll-to-plugin',
  31.       'split-text',
  32.       'scrolltrigger',
  33.       'deepmerge',
  34.       'distribute-by-position',
  35.       'lazy-load',
  36.     ),
  37.     ARTS_THEME_VERSION,
  38.     true
  39.   );
  40.  
  41.   wp_enqueue_script( 'asli-app', ARTS_THEME_URL . '/js/app.js', array( 'asli-framework' ), ARTS_THEME_VERSION, true );
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement