geeparts-js 1.4.4 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +68 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1863,6 +1863,74 @@ if (window.matchMedia('(min-width: 768px)').matches) {
|
|
|
1863
1863
|
}
|
|
1864
1864
|
}
|
|
1865
1865
|
|
|
1866
|
+
const sliderContainer = document.querySelector(
|
|
1867
|
+
'.js-home-slider .swiper-slide.slide-container[data-swiper-slide-index="0"] .js-slider-slide'
|
|
1868
|
+
)
|
|
1869
|
+
|
|
1870
|
+
const sliderContainerMobile = document.querySelector(
|
|
1871
|
+
'.js-home-slider-mobile .swiper-slide.slide-container[data-swiper-slide-index="0"] .js-slider-slide'
|
|
1872
|
+
)
|
|
1873
|
+
|
|
1874
|
+
const countdownWrapper = `
|
|
1875
|
+
<div class="countdown-wrapper">
|
|
1876
|
+
<div class="countdown" id="countdown">
|
|
1877
|
+
<div class="countdown-item">
|
|
1878
|
+
<span class="countdown-number" id="days">00</span>
|
|
1879
|
+
<span class="countdown-label">Días</span>
|
|
1880
|
+
</div>
|
|
1881
|
+
<div class="countdown-item">
|
|
1882
|
+
<span class="countdown-number" id="hours">00</span>
|
|
1883
|
+
<span class="countdown-label">Horas</span>
|
|
1884
|
+
</div>
|
|
1885
|
+
<div class="countdown-item">
|
|
1886
|
+
<span class="countdown-number" id="minutes">00</span>
|
|
1887
|
+
<span class="countdown-label full">Minutos</span>
|
|
1888
|
+
<span class="countdown-label short">M</span>
|
|
1889
|
+
</div>
|
|
1890
|
+
<div class="countdown-item">
|
|
1891
|
+
<span class="countdown-number" id="seconds">00</span>
|
|
1892
|
+
<span class="countdown-label full">Segundos</span>
|
|
1893
|
+
<span class="countdown-label short">S</span>
|
|
1894
|
+
</div>
|
|
1895
|
+
</div>
|
|
1896
|
+
</div>
|
|
1897
|
+
`
|
|
1898
|
+
|
|
1899
|
+
if (sliderContainer) {
|
|
1900
|
+
sliderContainer.insertAdjacentHTML('beforeend', countdownWrapper)
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
if (sliderContainerMobile) {
|
|
1904
|
+
sliderContainerMobile.insertAdjacentHTML('beforeend', countdownWrapper)
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
const blackDaysDate = new Date(2025, 10, 28, 0, 0, 0).getTime()
|
|
1908
|
+
|
|
1909
|
+
function updateCountdown() {
|
|
1910
|
+
const now = new Date().getTime()
|
|
1911
|
+
const distance = blackDaysDate - now
|
|
1912
|
+
|
|
1913
|
+
if (distance < 0) {
|
|
1914
|
+
document.getElementById('countdown').innerHTML =
|
|
1915
|
+
'<h2 style="color: #FFD700; font-size: 3rem; text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);">¡BLACK DAYS YA ESTÁ AQUÍ!</h2>'
|
|
1916
|
+
return
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
const days = Math.floor(distance / (1000 * 60 * 60 * 24))
|
|
1920
|
+
const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
|
|
1921
|
+
const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60))
|
|
1922
|
+
const seconds = Math.floor((distance % (1000 * 60)) / 1000)
|
|
1923
|
+
|
|
1924
|
+
document.getElementById('days').textContent = String(days).padStart(2, '0')
|
|
1925
|
+
document.getElementById('hours').textContent = String(hours).padStart(2, '0')
|
|
1926
|
+
document.getElementById('minutes').textContent = String(minutes).padStart(2, '0')
|
|
1927
|
+
document.getElementById('seconds').textContent = String(seconds).padStart(2, '0')
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
// Actualizar cada segundo
|
|
1931
|
+
updateCountdown()
|
|
1932
|
+
setInterval(updateCountdown, 1000)
|
|
1933
|
+
|
|
1866
1934
|
const footer = document.querySelector('.js-footer')
|
|
1867
1935
|
|
|
1868
1936
|
if (footer) {
|