Warning: Undefined array key "yPBFjS" in /home/ic3/domains/ic3.info/public_html/wp-includes/kses.php on line 1
HEX
HEX
Server: LiteSpeed
System: Linux control5.webnow.vn 4.18.0-553.83.1.lve.el8.x86_64 #1 SMP Wed Nov 12 10:04:12 UTC 2025 x86_64
User: ic3 (1169)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /home/ic3/public_html/wp-content/themes/graceful-nova-blog/assets/js/nova-slider.js
/*
** Nova Post Slider =====
*/
jQuery(document).ready(function($) {
	var $slider = $('.nova-slider-carousel');
	$slider.owlCarousel({
		items: 1,
		loop: true,
		autoplay: true,
		nav: false,
		dots: false,
		animateOut: 'fadeOut',
		animateIn: 'fadeIn',
	});

	$('.nova-prev').click(function() {
		$slider.trigger('prev.owl.carousel');
	});
	$('.nova-next').click(function() {
		$slider.trigger('next.owl.carousel');
	});
});

/*
** ColorThief =====
*/
document.addEventListener('DOMContentLoaded', function () {
	const colorThief = new ColorThief();

	document.querySelectorAll('.nova-slide').forEach(function (slide) {
		const img = slide.querySelector('.nova-slide-image');
		const left = slide.querySelector('.nova-slide-left');

		if (img && img.complete) {
			applyColor(img, left);
		} else if (img) {
			img.addEventListener('load', function () {
				applyColor(img, left);
			});
		}
	});

	function applyColor(img, target) {
		try {
			let [r, g, b] = colorThief.getColor(img);
			const brightness = (r * 299 + g * 587 + b * 114) / 1000;

			if (brightness < 160) {
				[r, g, b] = [r, g, b].map(c => Math.min(255, c + 80));
			}

			target.style.backgroundColor = `rgb(${r}, ${g}, ${b})`;
		} catch (e) {
			console.warn('Color extraction failed:', e);
		}
	}
});