2A News

Alabama Gun Owners May Enjoy Second Amendment Sales Tax Holiday

Reading Time: 1:57 min

While some states continue to launch attacks on fundamental Second Amendment rights, Alabama is a leader in defending the ability to keep and bear arms.  That includes the right to…

View post

Bill to Restore Young Adults’ Rifle and Shotgun Rights Stymied in Florida Senate

Reading Time: 1:58 min

Legislation to restore Second Amendment rights for Florida’s young adults ran into an unexpected roadblock last week.  State lawmakers who support the right to keep and bear arms are busy…

View post

NRA Files 3rd Lawsuit Against NFA Registration Requirement

Reading Time: 1:60 min

The venerable National Rifle Association (NRA) announced last week the filing of a third lawsuit challenging the controversial National Firearms Act of 1934 (NFA). There has doubtlessly been progress on…

View post

Georgia Lawmakers Attempt to Strengthen State’s ‘Stand Your Ground’ Law

Reading Time: 2:5 min

Georgia is not the first state that comes to mind when considering where Second Amendment rights need to be enhanced, but it is on the list. For all the pro-gun…

View post

Oregon House Approves Bill to Double Gun Permit Fees

Reading Time: 2:0 min

Oregon’s contentious scheme to more than double the cost of firearm permits is a step closer to reality after the state House passed a bill to implement it.  Ballot Measure…

View post

Walz Introduces Package Including Tax on Firearms and Ammunition

Reading Time: 1:57 min

Minnesota Gov. Tim Walz surprised exactly no one on Tuesday when he introduced an expansive new gun control package to the state legislature. And while he claims to be a…

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>