2A News

NAGR: Minnesota Officials Ramming Sweeping Gun Control Through Legislature

Reading Time: 1:56 min

Minnesota citizens are certainly accustomed to turmoil and controversy, and now some lawmakers are shoving through a controversial bill to decimate gun rights that has a chance to succeed. Members…

View post

North Carolina May FINALLY Join Constitutional Carry Club

Reading Time: 2:15 min

The game of back-and-forth surrounding North Carolina’s attempt to enact long-overdue constitutional carry may soon draw to a close. There appears to be movement in the House deadlock over Senate…

View post

Maryland High Court Erases Most of Montgomery County’s Gun Control Regime

Reading Time: 1:56 min

It wasn’t the Earth-shattering type of victory that leaves every goal accomplished and no foes standing. Still, the Maryland Supreme Court gave gun rights supporters reason to celebrate when the…

View post

Gun Rights Opponents Turn to AI to Suppress 2A Freedoms

Reading Time: 2:6 min

For better or worse, artificial intelligence is here to stay. And while some movie aficionados anxiously await Skynet’s arrival and the subjugation of the human species, hopefully, that can be…

View post

Anti-Gunners Furious Over Gun Policy Shift

Reading Time: 1:54 min

No sooner than the ink dried on Wednesday’s welcome Department of Justice (DOJ) announcements rolling back gun rights infringements did the anti-Second Amendment lobby recoil in horror. Long-overdue adjustments to…

View post

Maryland High Court Erases Most of Montgomery County’s Gun Control Regime

Reading Time: 1:56 min

It wasn’t the Earth-shattering type of victory that leaves every goal accomplished and no foes standing. Still, the Maryland Supreme Court gave gun rights supporters reason to celebrate when the…

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>