2A News

Police: Armed Driver Tried to De-escalate with Road Rager, Didn’t Work

Reading Time: 2:11 min

Road rage is all too common in the modern world, but it is generally confined to language the kids shouldn’t hear or to middle fingers. However, when it escalates, it…

View post

Gun Rights Groups Ask Appeals Court to Rule Against SBR Restrictions

Reading Time: 2:5 min

Second Amendment supporters rightly celebrated when Congress eliminated the long-standing $200 tax on National Firearms Act (NFA)- governed items, which include short-barreled rifles (SBRs). But the mission is far from…

View post

Bipartisan Bill to Protect Gun Owners’ Purchasing Data Clears House

Reading Time: 2:1 min

Gun rights opponents habitually label any bill with the slightest support from the other side of the aisle as “bipartisan,” so it is reasonable that Second Amendment supporters may do…

View post

Kentucky’s Young Adults on Brink of Gaining Concealed Carry Rights

Reading Time: 2:13 min

The obvious disconnect between the Kentucky General Assembly’s overwhelming majority and Gov. Andy Beshear (D) goes on full display this week.  That’s when law-abiding young adults in the Bluegrass State,…

View post

Anti-2A Organizations Rage Against ATF Reforms

Reading Time: 1:56 min

The Bureau of Alcohol, Tobacco, Firearms, and Explosives (ATF) is undertaking much-needed reform to shift its mission from persecuting gun owners to assuring that the federal government enforces Second Amendment…

View post

Manufacturer Will Not Sell AR-15s to Agencies That Enforce Ban

Reading Time: 2:7 min

When a major business takes an honorable stand for what is right, even though it will likely hit its bottom line, it is worth noting and celebrating. CMMG, the Missouri-based…

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>