Initial commit xmarticaims
This commit is contained in:
+42
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Scroll-driven Anime.js animation for the front-page solutions title.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function xmartica_solutions_title_animation_assets() {
|
||||
if ( ! is_front_page() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$dir = get_template_directory() . '/parts/solutions-title-animation';
|
||||
$uri = get_template_directory_uri() . '/parts/solutions-title-animation';
|
||||
|
||||
wp_enqueue_style(
|
||||
'xmartica-solutions-title-animation',
|
||||
$uri . '/solutions-title-animation.css',
|
||||
array(),
|
||||
filemtime( $dir . '/solutions-title-animation.css' )
|
||||
);
|
||||
|
||||
wp_enqueue_script(
|
||||
'xmartica-solutions-title-animation',
|
||||
$uri . '/solutions-title-animation.js',
|
||||
array(),
|
||||
filemtime( $dir . '/solutions-title-animation.js' ),
|
||||
true
|
||||
);
|
||||
}
|
||||
add_action( 'wp_enqueue_scripts', 'xmartica_solutions_title_animation_assets' );
|
||||
|
||||
function xmartica_solutions_title_module_tag( $tag, $handle, $src ) {
|
||||
if ( 'xmartica-solutions-title-animation' !== $handle ) {
|
||||
return $tag;
|
||||
}
|
||||
|
||||
return '<script type="module" src="' . esc_url( $src ) . '"></script>';
|
||||
}
|
||||
add_filter( 'script_loader_tag', 'xmartica_solutions_title_module_tag', 10, 3 );
|
||||
Reference in New Issue
Block a user