2A News

Indiana Homeowner Shoots Alleged Home Intruder in Self Defense

Reading Time: 3:9 min

The narrative has become quite familiar. A violent criminal believes that an intended victim will cower in the corner and submit to their every demand. But when the attack begins,…

View post

LA Rams Promote Gun Control Group in Aftermath of Lunar New Year Rampage

Reading Time: 3:7 min

It’s a familiar refrain that Second Amendment advocates are accustomed to.  A violent criminal commits a horrific act, and before the dust settles and even sometimes before the assailant is…

View post

Ohio Teen Uses Mother’s Gun to Protect Home from Intruder

Reading Time: 3:11 min

Having an armed good guy save the day is something to celebrate, but for one Ohio mother, when that good guy turned out to be her son it was extra…

View post

West Virginia Strikes Back at Credit Card Companies for Tracking Firearms Purchases

Reading Time: 3:7 min

The war between credit card companies and legal gun owners in America is heating up. Last week West Virginia State Treasurer Riley Moore introduced legislation to outlaw credit and debit…

View post

In the Line of Duty — 2022 a Deadly Year for Law Enforcement

Reading Time: 2:53 min

2022 was a particularly dangerous year to have a decidedly dangerous job. The National Fraternal Order of Police (FOP) reports that 331 police officers were shot last year, and 62…

View post

New Jersey Homeowner Fires Shot and Scares Away Car Thief

Reading Time: 3:6 min

A homeowner in Roseland, New Jersey, put an end to a home break-in and attempted car theft on Monday when he produced a legally owned weapon and fired a shot.…

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>