Gear

2014 Gear Girl Calendar Trailer Promo Final

Reading Time: 0:27 min

She can get it, she can get it, and she can get it. That’s usually what goes through my mind when I watch videos like this. I’m rather unapologetic about…

View post

AR 15 Table Top Review: DDM4V1 From Daniel Defense

Reading Time: 5:1 min

There are “fancier” AR 15 rifles than the DDM4. There are AR-15 rifles with specks of gold flakes fire infused into the paint, barrels forged in the flames of hell,…

View post

Glock 19 Profile

Reading Time: 1:3 min

Glock 19s are like roaches, they’re everywhere. It’s the gun to get when you don’t know what to get, or the gun you come back to because you figured out it’s…

View post

Glock: The Rise of America’s Gun (Three Hours In)

Reading Time: 1:12 min

I listen to a lot of audiobooks because I do a lot of driving between cities. In my most recent trip, which I am still on, but about to drive…

View post

Colion Noir : The PMAG 40 from Magpul (Video)

Reading Time: 0:14 min

My Thoughts on the PMAG 40 From Magpul. There’s a little thing going on in the comment section on youtube about what thoughts went through my head after the end…

View post

Top 5 Guns to Carry While Wearing a Suit

Reading Time: 2:30 min

Don’t let James Bond fool you, carrying a gun while wearing a decently cut suit is a pain! Carrying while wearing  a well cut suit is almost impossible. However, there…

View post
<script>
  /*Source: https://github.com/Krzysztof-Antosik/Two-direction-Sticky-Sidebar*/
  
  // Verificar el ancho de pantalla al cargar y redimensionar
  function checkScreenWidth() {
    if (window.innerWidth <= 767) {
      // Si la pantalla es menor o igual a 676px, no ejecutar el código
      return;
    }

    const stickyElement = document.querySelector('.fb-sidebar__aside');
    const startPosition = stickyElement.getBoundingClientRect().top;

    let endScroll = window.innerHeight - stickyElement.offsetHeight - 500;
    let currPos = window.scrollY;
    let screenHeight = window.innerHeight;
    let stickyElementHeight = stickyElement.offsetHeight;
    let topGap = 40;
    let bottomGap = 40;

    setTimeout(() => {
      if (stickyElement.hasAttribute('data-top-gap')) {
        const dataTopGap = stickyElement.getAttribute('data-top-gap');
        topGap = dataTopGap === 'auto' ? startPosition : parseInt(dataTopGap);
      }

      if (stickyElement.hasAttribute('data-bottom-gap')) {
        bottomGap = parseInt(stickyElement.getAttribute('data-bottom-gap'));
      }
    }, 100);

    stickyElement.style.position = 'sticky';
    stickyElement.style.top = `${topGap}px`;
    stickyElement.style.height = 'fit-content';

    function positionStickySidebar() {
      endScroll = window.innerHeight - stickyElement.offsetHeight - bottomGap;
      const stickyElementTop = parseInt(stickyElement.style.top.replace('px', ''));

      if (stickyElementHeight + topGap + bottomGap > screenHeight) {
        if (window.scrollY < currPos) {
          if (stickyElementTop < topGap) {
            stickyElement.style.top = `${stickyElementTop + currPos - window.scrollY}px`;
          } else if (stickyElementTop >= topGap && stickyElementTop !== topGap) {
            stickyElement.style.top = `${topGap}px`;
          }
        } else {
          if (stickyElementTop > endScroll) {
            stickyElement.style.top = `${stickyElementTop + currPos - window.scrollY}px`;
          } else if (stickyElementTop < endScroll && stickyElementTop !== endScroll) {
            stickyElement.style.top = `${endScroll}px`;
          }
        }
      } else {
        stickyElement.style.top = `${topGap}px`;
      }
      currPos = window.scrollY;
    }

    function stickyElementToMe() {
      stickyElement.style.top = `${topGap}px`;
    }

    function updateSticky() {
      screenHeight = window.innerHeight;
      stickyElementHeight = stickyElement.offsetHeight;
      positionStickySidebar();
    }

    setTimeout(() => {
      window.addEventListener('resize', () => {
        currPos = window.scrollY;
        updateSticky();
      });

      document.addEventListener('scroll', updateSticky, {
        capture: true,
        passive: true
      });
    }, 1000);
  }

  // Verificar el ancho de pantalla al cargar y redimensionar
  window.addEventListener('load', checkScreenWidth);
  window.addEventListener('resize', checkScreenWidth);
</script>