2A News

FIND Act Would Protect Gun Industry from Anti-Second Amendment Radicals

Reading Time: 3:2 min

The forces lined up to snatch away Second Amendment freedoms have several foes that must stand united. The first is the Constitution itself, which clearly grants the right to keep…

View post

MSU Rock Becomes Flashpoint for Gun Rights Debate

Reading Time: 3:18 min

The aftermath of the Michigan State University shooting that left three dead and five critically injured further stirred the debate over gun rights. Mixed in with the predictable calls for…

View post

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
<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>