bla bla

Neverenough scripts

<script type="text/javascript" src="//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
const carousel = document.querySelector('#carousel');
const carouselInner = carousel.querySelector('.carousel-inner');
const slides = carouselInner.querySelectorAll('.item');

// Create the indicators container
const indicatorsContainer = document.createElement('ol');
indicatorsContainer.classList.add('carousel-indicators');
carousel.insertBefore(indicatorsContainer, carouselInner);

// Create indicators based on the number of slides
slides.forEach((slide, index) => {
const indicator = document.createElement('li');
indicator.setAttribute('data-target', '#carousel');
indicator.setAttribute('data-slide-to', index);
if (index === 0) {
indicator.classList.add('active');
}
indicatorsContainer.appendChild(indicator);
});

// Handle indicator click events
indicatorsContainer.addEventListener('click', (event) => {
if (event.target.tagName === 'LI') {
const slideTo = event.target.getAttribute('data-slide-to');
$('#carousel').carousel(parseInt(slideTo));
}
});

// Custom cursor functionality
let cursor = document.querySelector('.item.active .extended-banner-link');

function moveCursor(e) {
if (cursor) {
cursor.style.top = (e.pageY - 10) + "px";
cursor.style.left = (e.pageX - 10) + "px";
}
}

function attachMouseEvents() {
if (cursor) {
cursor.style.visibility = 'visible';
document.addEventListener('mousemove', moveCursor);
}
}

function detachMouseEvents() {
if (cursor) {
cursor.style.visibility = 'hidden';
document.removeEventListener('mousemove', moveCursor);
}
}

function handleSlideChange() {
detachMouseEvents(); // Detach mouse events before slide change

// Find the new active slide
const newActiveSlide = document.querySelector('.carousel-inner .item.active .extended-banner-link');
if (newActiveSlide) {
cursor = newActiveSlide;
}

// Reattach mouse events after a short delay to ensure they're applied on the new slide
setTimeout(() => {
attachMouseEvents();
}, 100); // Adjust the delay as needed, depending on the slide transition time
}

// Initial setup for the first active slide
attachMouseEvents();

// Listen for the 'slid.bs.carousel' event
$('#carousel').on('slid.bs.carousel', function() {
handleSlideChange();
});

// Fallback for manual slide changes (if any custom carousel logic exists)
const observer = new MutationObserver(() => {
setTimeout(handleSlideChange, 100); // Adjust the delay as needed
});

observer.observe(carouselInner, { attributes: true, subtree: true, attributeFilter: ['class'] });
});
</script>
<script>
$(window).scroll(function () {
if ($(this).scrollTop() > 27) {
$('body').addClass('sticky');
} else {
$('body').removeClass('sticky');
}
});
</script>
<script>
$(document).ready(function() {
function adjustMenu() {
var $menuItems = $(".menu-level-1 > li:not(.splitted)");
var totalWidth = 0;
$menuItems.each(function() {
totalWidth += $(this).outerWidth(true);
});
var effectiveWidth = totalWidth - 150;
var halfWidth = effectiveWidth / 2;
var accumulatedWidth = 0;
var middleIndex;

$menuItems.each(function(index) {
accumulatedWidth += $(this).outerWidth(true);
if (accumulatedWidth >= halfWidth) {
middleIndex = index;
return false;
}
});
var leftWidth = 0;
var rightWidth = 0;
$menuItems.each(function(index) {
if (index <= middleIndex) {
leftWidth += $(this).outerWidth(true);
} else {
rightWidth += $(this).outerWidth(true);
}
});
console.log("Left Width: " + leftWidth + "px");
console.log("Right Width: " + rightWidth + "px");
$menuItems.eq(middleIndex).css("margin-right", "150px");
if (leftWidth < rightWidth) {
$menuItems.last().addClass("short-last");
} else {
$menuItems.eq(middleIndex).addClass("short-last");
}
var marginValue = leftWidth - rightWidth;
$menuItems.last().css("margin-right", marginValue + "px");
}
adjustMenu();
$(window).resize(adjustMenu);
});
</script>

<script>
document.querySelectorAll('details').forEach(detail => {
detail.addEventListener('click', function() {
document.querySelectorAll('details[open]').forEach(openDetail => {
if (openDetail !== detail) {
openDetail.removeAttribute('open');
}
});
});
});
</script>

<script>
var event = ('ontouchstart' in window) ? 'touchstart' : 'mouseenter';
var boo = new Audio("/user/documents/upload/res2024/neverenough/neverenough-boo.ogg");
$('#header .site-name a').on(event, function () {
boo.play();
});
</script>

<script>
$(window).scroll(function () {
if ($(this).scrollTop() > 27) {
$('body').addClass('sticky');
} else {
$('body').removeClass('sticky');
}
});
</script>

<script>
var added_signature = '<div class="kn_made_by" style="color: #000;margin:9px 20px 10px 7px;"><style>#signature {text-align: right;}</style><span style="white-space: nowrap;margin-right: 10px; color: #787878;">& upravil </span><a href="http://kubanavratil.com/" target="blank_"><img src='https://cdn.myshoptet.com/usr/242285.myshoptet.com/user/documents/upload/signature_white.svg'></a></div>';
$(added_signature).appendTo('.container.footer-bottom');
</script>

<script>
$(document).ready(function () {
const uniqueUrls = [];
$(".p-thumbnails-inner a").each(function () {
const href = $(this).attr("href");
if (!uniqueUrls.includes(href)) {
uniqueUrls.push(href);
}
});
uniqueUrls.forEach((url, index) => {
const newAnchor = $("<a>", {
href: url,
class: "p-main-image cloud-zoom",
});
const newImage = $("<img>", { src: url, alt: `Product image ${index + 1}` });
newAnchor.append(newImage);
$(".p-image").append(newAnchor);
});
$(".p-image").slick({
dots: false,
arrows: true,
infinite: true,
slidesToShow: 3,
slidesToScroll: 1,
autoplay: true,
autoplaySpeed: 3000,
responsive: [
{
breakpoint: 1920,
settings: {
slidesToShow: 2,
slidesToScroll: 1
}
},
{
breakpoint: 1200,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
});
});
</script>

<script>
document.addEventListener('DOMContentLoaded', function () {
document.querySelectorAll('.slick-prev, .slick-next').forEach(button => {
button.addEventListener('click', function () {
console.log("Button clicked:", this.className);
const originalBg = getComputedStyle(this).backgroundImage;
console.log("Original Background:", originalBg);
const newBg = this.classList.contains('slick-prev')
? 'url("/user/documents/upload/res2024/neverenough/boney_arrow_left_click.svg")'
: 'url("/user/documents/upload/res2024/neverenough/boney_arrow_right_click.svg")';
console.log("New Background to Apply:", newBg);
this.style.backgroundImage = newBg;
setTimeout(() => {
console.log("Reverting Background to:", originalBg);
this.style.backgroundImage = originalBg;
}, 200);
});
});
});
</script>