Save
This commit is contained in:
16
wp-content/themes/hello-elementor/assets/css/custom.css
Normal file
16
wp-content/themes/hello-elementor/assets/css/custom.css
Normal file
@@ -0,0 +1,16 @@
|
||||
.swiper-pagination.swiper-pagination-bullets .swiper-pagination-bullet {
|
||||
border-radius: 2px;
|
||||
width: 10px;
|
||||
transition: all 250ms ease-in-out;
|
||||
}
|
||||
.swiper-pagination.swiper-pagination-bullets .swiper-pagination-bullet:hover {
|
||||
background: var(--e-n-carousel-dots-normal-color);
|
||||
}
|
||||
.swiper-pagination.swiper-pagination-bullets .swiper-pagination-bullet-active {
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
.parallax-box {
|
||||
height: 480px;
|
||||
overflow: hidden;
|
||||
}/*# sourceMappingURL=custom.css.map */
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["custom.scss","custom.css"],"names":[],"mappings":"AAEE;EACC,kBAAA;EACA,WAAA;EACA,iCAAA;ACDH;ADGG;EACC,iDAAA;ACDJ;ADIE;EACC,WAAA;ACFH;;ADOA;EACC,aAAA;EACA,gBAAA;ACJD","file":"custom.css"}
|
||||
21
wp-content/themes/hello-elementor/assets/css/custom.scss
Normal file
21
wp-content/themes/hello-elementor/assets/css/custom.scss
Normal file
@@ -0,0 +1,21 @@
|
||||
.swiper-pagination {
|
||||
&.swiper-pagination-bullets {
|
||||
.swiper-pagination-bullet {
|
||||
border-radius: 2px;
|
||||
width: 10px;
|
||||
transition: all 250ms ease-in-out;
|
||||
|
||||
&:hover {
|
||||
background: var(--e-n-carousel-dots-normal-color);
|
||||
}
|
||||
}
|
||||
.swiper-pagination-bullet-active {
|
||||
width: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.parallax-box {
|
||||
height: 480px;
|
||||
overflow: hidden;
|
||||
}
|
||||
23
wp-content/themes/hello-elementor/assets/js/custom.js
Normal file
23
wp-content/themes/hello-elementor/assets/js/custom.js
Normal file
@@ -0,0 +1,23 @@
|
||||
jQuery(function ($) {
|
||||
$(window).on('scroll', function () {
|
||||
$('.parallax-box').each(function () {
|
||||
var box = $(this)
|
||||
var img = box.find('.parallax-box-img')
|
||||
|
||||
var boxTop = box.offset().top
|
||||
var boxHeight = box.outerHeight()
|
||||
var scrollTop = $(window).scrollTop()
|
||||
var windowHeight = $(window).height()
|
||||
|
||||
if (scrollTop + windowHeight > boxTop && scrollTop < boxTop + boxHeight) {
|
||||
var percentSeen =
|
||||
(scrollTop + windowHeight - boxTop) / (windowHeight + boxHeight)
|
||||
percentSeen = Math.min(Math.max(percentSeen, 0), 1)
|
||||
|
||||
var translateY = (percentSeen - 0.5) * 400
|
||||
|
||||
img.css('transform', 'translateY(' + translateY + 'px)')
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -271,3 +271,24 @@ if ( ! function_exists( 'hello_elementor_body_open' ) ) {
|
||||
require HELLO_THEME_PATH . '/theme.php';
|
||||
|
||||
HelloTheme\Theme::instance();
|
||||
|
||||
function my_custom_styles() {
|
||||
wp_enqueue_style(
|
||||
'custom-style',
|
||||
get_template_directory_uri() . '/assets/css/custom.css',
|
||||
array(),
|
||||
filemtime(get_template_directory() . '/assets/css/custom.css')
|
||||
);
|
||||
}
|
||||
add_action('wp_enqueue_scripts', 'my_custom_styles');
|
||||
|
||||
function my_custom_js() {
|
||||
wp_enqueue_script(
|
||||
'custom-script',
|
||||
get_template_directory_uri() . '/assets/js/custom.js',
|
||||
array('jquery'),
|
||||
filemtime(get_template_directory() . '/assets/js/custom.js'),
|
||||
true
|
||||
);
|
||||
}
|
||||
add_action('wp_enqueue_scripts', 'my_custom_js');
|
||||
|
||||
Reference in New Issue
Block a user