2A News

Appeals Court Upholds Illinois Gun Ban as SCOTUS Decision Looms

Reading Time: 2:12 min

It will be months before the U.S. Supreme Court hears arguments in two challenges to state bans on AR-15s and similar firearms, but the stakes are sky-high and getting higher.…

View post

Judge Rejects DOJ Request for TRO Against Golden State Glock Ban

Reading Time: 2:4 min

The U.S. Department of Justice (DOJ) must be applauded for its newfound belief in Second Amendment rights, clearly demonstrated by several recent actions. It just takes one judge, however, to…

View post

FPC, CSSA Sue Over Denver Gun Ban, City and State Magazine Bans

Reading Time: 2:7 min

When the U.S. Supreme Court recently agreed to hear two important challenges to “assault weapon” bans, Viramontes v. Cook County and Grant v. Higgins, Second Amendment groups were emboldened to…

View post

NSSF: June Firearm Sales Soar Past 2025 Mark

Reading Time: 1:55 min

There are few ways to rile up law-abiding citizens more strongly than threatening fundamental freedoms guaranteed by the U.S. Constitution.  June’s gun sales, in the midst of looming deadlines to…

View post

GOA Accuses ATF of Perpetuating ‘Engaged in the Business’ Rule

Reading Time: 2:5 min

GOA Accuses ATF of Perpetuating ‘Engaged in the Business’ Rule There are time-tested and easily documented reasons why wise observers rely on what is done rather than what is said. …

View post

Dhillon: DOJ’s Protection of 2A Rights ‘Never Been Done Before’

Reading Time: 1:59 min

The Department of Justice (DOJ) is busy suing states over Second Amendment rights, and the official leading the charge said that the federal effort is without precedent. Assistant Attorney General…

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>