Furniture Appliances Electronics Mattresses Flooring Sale
electronics | tvs | 4k
Sort by:
Elevate your gaming experience with Nvidia G Sync monitors, designed to deliver seamless visuals and unparalleled performance. These cutting-edge displays synchronize refresh rates with your GPU, ensuring smooth gameplay without screen tearing or stuttering. Whether you're a competitive gamer or simply enjoy immersive graphics, G Sync technology provides the clarity and responsiveness you need for an edge in any virtual world. Explore our selection of monitors that blend state-of-the-art technology with sleek design, perfect for both professional setups and home gaming stations. Dive into the action with confidence, knowing your display is optimized for the ultimate gaming adventure.
Web Exclusive
Gaming Monitors
Shop Now
OLED Monitors
Shop Now
Gaming Laptops
Shop Now
Desk Monitors
Shop Now
` : filter.name === 'Price' ? `
0 2000
` : `
`}`; }).join(''); return `
${valuesHTML}
`; } function updateSlider(priceMin, priceMax, originalMin, originalMax) { const lowerHandle = document.querySelector('.noUi-handle-lower'); const upperHandle = document.querySelector('.noUi-handle-upper'); const sliderBase = document.querySelector('.noUi-base'); // Calculate percentage positions for the slider handles based on the price values const lowerPercentage = ((priceMin - originalMin) / (originalMax - originalMin)) * 100; const upperPercentage = ((priceMax - originalMin) / (originalMax - originalMin)) * 100; // Update the slider handle positions lowerHandle.parentNode.style.left = `${lowerPercentage}%`; upperHandle.parentNode.style.left = `${upperPercentage}%`; // Update the displayed values for min and max prices document.querySelector('.price-min').textContent = priceMin; document.querySelector('.price-max').textContent = priceMax; } function updateSidebarFacets(filters) { const sidebarFacets = document.getElementById('productNarrows'); // Store the state of open accordions const openAccordions = Array.from(sidebarFacets.getElementsByClassName('accordion-collapse')) .filter(accordion => accordion.classList.contains('show')) .map(accordion => accordion.id); sidebarFacets.innerHTML = ''; filters.forEach(facet => { const facetHTML = generateSidebarFacetHTML(facet); sidebarFacets.innerHTML += facetHTML; }); if (lastPriceMin && lastPriceMax) { updateSlider(lastPriceMin, lastPriceMax, 0, 2000); } // Add event listeners to checkboxes const checkboxes = sidebarFacets.querySelectorAll('.type-checkbox'); checkboxes.forEach(checkbox => { checkbox.addEventListener('change', handleCheckboxChange); }); // Restore the state of open accordions openAccordions.forEach(id => { const accordion = document.getElementById(id); if (accordion) { accordion.classList.add('show'); const button = accordion.previousElementSibling.querySelector('button'); if (button) { button.classList.remove('collapsed'); button.setAttribute('aria-expanded', 'true'); } } }); if (filters?.length === 0) { sidebarFacets.innerHTML = `
` } } function handleCheckboxChange(event) { const checkbox = event.target; toggleFacet(checkbox); } function toggleFacet(checkbox) { const facetId = checkbox.getAttribute('data-facet-id'); const value = checkbox.getAttribute('data-value'); const isSelected = checkbox?.checked; const store = window.store; const state = store.get('state'); const filterIndex = state.filters.findIndex(f => f.id === facetId); let updatedFilters = [...state.filters]; if (filterIndex > -1) { const valueIndex = updatedFilters[filterIndex].values.findIndex(val => val.value === value); if (valueIndex > -1) { updatedFilters[filterIndex].values[valueIndex].selected = isSelected; } else { updatedFilters[filterIndex].values.push({ value: value, selected: isSelected }); } } else { updatedFilters.push({ id: facetId, values: [{ value, selected: isSelected }] }); } // Update the state and re-render the facets updateState({ filters: updatedFilters, pageNumber: 1 }); } function clearAllFilter() { updateState({ filters: [], pageNumber: 1 }); } function updateMainButtonsFacets(filters) { const mainFacets = document.getElementById('filterChild'); mainFacets.innerHTML = `
View Filters`; filters.forEach(facet => { mainFacets.innerHTML += generateFilterButtonsHTML(facet); }); } function generateFilterButtonsHTML(filter) { return ` `; } function updateFacets(facets) { updateSidebarFacets(facets); updateMainButtonsFacets(facets); appendClearFiltersButton(facets); } function appendClearFiltersButton(filters) { const productList = document.querySelector('#productList'); // Create a container for the clear filters buttons const container = document.createElement('div'); container.id = 'clearFiltersContainer'; container.classList.add('mt-1', 'overflow-x-auto', 'custom-scroll-bar', 'text-nowrap'); filters.forEach(filter => { filter.values.forEach(value => { if (value.selected) { // Create the clear filter button const clearButton = document.createElement('a'); clearButton.classList.add('btn', 'btn-light', 'text-black', 'text-nowrap', 'me-2', 'mb-1', 'text-capitalize'); clearButton.href = 'javascript:void(0);'; clearButton.innerHTML = `${value.value} `; // Add event listener to clear the filter when clicked clearButton.addEventListener('click', () => { const dummyCheckbox = { getAttribute: (attr) => { if (attr === 'data-facet-id') return filter.id; if (attr === 'data-value') return value.value; }, checked:false }; toggleFacet(dummyCheckbox); }); // Append the clear button to the container container.appendChild(clearButton); } }); }); // Clear any existing clear filters buttons and append the new container const existingContainer = productList.querySelector('#clearFiltersContainer'); if (existingContainer) { productList.removeChild(existingContainer); } productList.appendChild(container); }