2A News

Homeowner Shoots and Kills Suspected Burglar in Atlanta Suburb

Reading Time: 1:54 min

The Second Amendment exists for many reasons, and one of the primary purposes is to afford law-abiding citizens the fundamental right to defend themselves against violent attack. Whether in a…

View post

NJ School District Rolls Out AI Firearm Detection System

Reading Time: 1:54 min

School safety is on the front burner as deranged shooters increasingly attack “soft targets.” Responses to the dangers vary wildly, but one New Jersey school district believes it has implemented…

View post

Appeals Court: NYC Gun Restrictions Will Remain While Legal War Rages

Reading Time: 1:53 min

Unable to ban guns outright and confiscate all in circulation, anti-gunners in recent years have busily chipped away at Second Amendment rights until there are large swaths of the nation…

View post

DOJ Backs NRA Challenge to New Jersey’s Gun Control Regime

Reading Time: 1:53 min

New Jersey is one of several anti-gun-dominated states that threw a political temper tantrum at the U.S. Supreme Court recently. When justices corrected the decades-long trend of suppressing gun rights…

View post

Federal Judge Dismisses Truckers’ Case Against Minnesota Gun Law

Reading Time: 1:55 min

Truck drivers are only too familiar with the dangers of the open road, and many choose to arm themselves to be ready for incidents categorized as unexpected but increasingly common.…

View post

Armed Illinois Man Fights Off Alleged Attack in Storage Building

Reading Time: 1:56 min

The need for situational awareness is obvious when at an ATM at night or perhaps at a gas station. That protocol now applies to storage buildings in the early morning…

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>