2A News

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

Indiana Puts the Brakes on Local Firearm Restrictions

Reading Time: 1:53 min

Indiana officials have had enough of belligerent local governments telling upstanding residents that the Second Amendment does not protect them. Last week, a ceremonial signing of SEA 176 was held…

View post

Arkansas Officials Seek Answers to Deadly ATF Raid

Reading Time: 2:9 min

A bipartisan group of 30 Arkansas state senators demanded an investigation into the tragically botched raid two years ago by the Bureau of Alcohol, Tobacco, Firearms, and Explosives (ATF) that…

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>