2A News

Broad Daylight Crime in California Shows Why AR-15s Are Essential

Reading Time: 4:10 min

Broad daylight crime in California shows why AR-15s are essential, and the latest smash-and-grab robbery proves it better than any debate ever could. The next time somebody asks you, “Why…

View post

SAF Files Brief in Case Challenging Hawaii’s Ridiculous Gun Control Regime

Reading Time: 1:54 min

Hawaii’s gun control apparatus is extreme by any reasonable measure, and it is now under fire from gun rights groups which have banded together to topple the regime. The Second…

View post

Gun Sales Rebound in August but Still Lag Behind Recent Levels

Reading Time: 1:51 min

U.S. gun sales surged past a notable threshold in August but still reflected the steady decline of past months. According to the National Shooting Sports Foundation (NSSF), the industry trade…

View post

11-Year-Old Shot Playing Ding Dong Ditch TikTok Prank

Reading Time: 4:6 min

An 11-year-old boy is dead after what started as a late-night prank, leaving a family shattered and a homeowner facing the possibility of life in prison. The tragedy unfolded during…

View post

2A Rights Group Challenges Colorado’s Gun Control Regime

Reading Time: 2:2 min

Colorado’s shooting community is not taking the state’s latest round of Second Amendment infringements lying down. A prominent 2A advocacy group filed a legal challenge to protect gun rights for…

View post

Chicago is Bleeding Out: 54 Shot, 7 Killed Over Labor Day Weekend

Reading Time: 3:58 min

Chicago is bleeding out: 54 shot, 7 killed over Labor Day weekend. Over the span of just three days, at least 32 separate shootings tore through the city, leaving dozens…

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>