2A News

ATF Promises Clarity on Murky Suppressor Sales Status

Reading Time: 2:7 min

Second Amendment enthusiasts were buoyed by the Aug. 5 court ruling in favor of the plaintiffs in the consolidated Silencer Shop Foundation v. ATF and Jensen v. ATF cases.  But…

View post

SAF Files Opening Brief in Challenge to ‘Assault Weapon’ Bans

Reading Time: 2:0 min

The Second Amendment community is cautiously optimistic after the U.S. Supreme Court agreed to hear two cases challenging semi-automatic weapons bans in Illinois and Connecticut. With September here, the approaching…

View post

Survey: Americans Own Over 460 million Firearms

Reading Time: 1:48 min

The political candidate who either aggressively attacks or simply ignores law-abiding gun owners does so at their own peril. Such approaches may work in New York City or Chicago, but…

View post

Court Upholds California’s 24/7 Video/Audio Gun Shop Surveillance

Reading Time: 1:53 min

The second time wasn’t the charm for opponents of California’s oppressive law mandating 24/7 video AND audio surveillance of gun shops. A three-judge panel of the Ninth Circuit Court of…

View post

SC Homeowner Kills Teenage Suspect in Alleged Break-In

Reading Time: 1:59 min

That thing that never happens happened again early Sunday morning, and this time it was a South Carolina resident who lived to tell the tale. According to authorities, a teen…

View post

Virginia Gun Shops Resume AR-15 Sales–For Now

Reading Time: 2:6 min

Federal Firearm License (FFL) holders in Virginia may be excused for being dazed and confused as they deal with the whiplash that is the commonwealth’s new and treacherous gun control…

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>