2A News

California Gov. Newsom Signs ‘Glock Ban’ Legislation into Law

Reading Time: 1:51 min

California added to its growing gun control mess on Friday when Gov. Gavin Newsom (D) signed Assembly Bill 1127, the controversial “Glock Ban,” into law. New sales of these wildly…

View post

2A Coalition Files Suit Challenging National Firearms Act

Reading Time: 3:45 min

The National Firearms Act of 1934 (NFA) is a legal corpse that has not fallen over yet, and gun rights groups want to give it that final shove into the…

View post

Publix Grocery Stores in Florida Now Welcome Open Carry

Reading Time: 1:59 min

Florida’s shiny new status as a constitutional carry state is paying dividends for law-abiding citizens who want to protect themselves while away from home.  It was long overdue for laws…

View post

Judge Dismisses PLCAA Lawsuit Against Century Arms

Reading Time: 1:59 min

A tragic shooting at the 2019 Gilroy Garlic Festival in Gilroy, California, left three people dead and seventeen others wounded. The unhinged criminal then committed suicide after a shootout with…

View post

Shock: Federal Judge Orders 2A Groups to Hand Over Membership Rolls

Reading Time: 2:7 min

There are times when the judiciary resembles a three-ring circus more than a serious American legal institution. That description is applicable to Caleb Reese v. Bureau of Alcohol, Tobacco, Firearms,…

View post

Gun Rights Groups Join Forces to Support Challenge to Switchblade Ban

Reading Time: 3:31 min

The U.S. Supreme Court in 2008’s District of Columbia v. Heller determined that the Second Amendment protects the right to keep and bear arms “in common use.” Subsequent court rulings…

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>