2A News

Sheriff: Neighborhood ‘Safer’ After Elderly Woman Shoots Alleged Armed Intruder

Reading Time: 3:3 min

A neighborhood in Interlachen, Florida, is safer after a 67-year-old woman opened fire on an alleged armed intruder at about 3 a.m. Wednesday morning. That’s the word from Putnam County…

View post

NFL Great Marcellus Wiley: ‘We’ve Got to Stop Blaming the Gun’

Reading Time: 3:3 min

Former NFL Pro Bowl defensive end and current broadcaster Marcellus Wiley unquestionably ruffled some feathers with his video response to the horrific Michigan State University shooting. Three people died in…

View post

Armed Carjacker Stopped by Legally Armed Defender in Philadelphia

Reading Time: 3:23 min

Carjackings and other violent crimes have become a way of life across the U.S. Criminals believe they act with impunity and will easily get away with their crimes against defenseless…

View post

Armed Civilian Fatally Shoots Suspected Carjacker at St. Louis Gas Station

Reading Time: 3:14 min

Of all the cities in the U.S. one could choose to live, the most dangerous is St. Louis, Missouri. That is the finding from last year’s WalletHub report that ranked…

View post

Uncertainty Plagues Gun Laws New and Old After Supreme Court Ruling

Reading Time: 3:10 min

Enemies of the Second Amendment are increasingly worried over the impact of last summer’s landmark Supreme Court ruling in New York State Rifle and Pistol Association v. Bruen. An exhaustive…

View post

Lawmakers Want to Use ‘Star Trek’ Technology to Track Your Guns

Reading Time: 3:20 min

Science fiction can be loads of fun. It creates fantasy worlds that allow our imaginations to explore extreme possibilities that we never encounter in our day-to-day lives. But the reality…

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>