2A News

NSSF Petitions SCOTUS in Lawsuit vs. NY Gun Control Regime

Reading Time: 1:58 min

New York State’s temper tantrum over its inability to destroy the weapons industry is in the crosshairs of the National Shooting Sports Foundation’s (NSSF) current lawsuit before the U.S. Supreme…

View post

West Virginia Lawmakers Propose State Machine Gun Sales to Public

Reading Time: 2:1 min

Second Amendment advocates in West Virginia are moving to restore the right to lawfully own a machine gun, and supporters base this push on established federal law. Despite the 1986…

View post

Justice Alito’s Rumored Retirement May Create Opportunity for Gun Rights

Reading Time: 1:58 min

Second Amendment advocates know well that the ideological makeup of the U.S. Supreme Court is critical for defending gun rights in the 21st century.  With some notable exceptions, the high…

View post

Florida AG Declares ‘Nondangerous’ Felons Retain Gun Rights

Reading Time: 2:5 min

Florida’s pro-Second Amendment Attorney General, James Uthmeier (R), issued a powerful response last week in a pivotal case with broad implications. The controversy, which is hardly limited to the Sunshine…

View post

Florida Bill Allows Houses of Worship to Deploy Armed Volunteers

Reading Time: 2:3 min

The sad reality of modern America is that institutions such as schools and churches now must ensure that they can withstand a violent attack and are no longer “soft targets.”…

View post

Current Boyfriend Shoots Former Boyfriend During Alleged Attack

Reading Time: 1:52 min

The right to keep and bear arms is fundamental to everything from hunting to put food on the table to target shooting and preserving rich traditions for future generations. At…

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>