2A News

Armed McDonald’s Employee Shoots Suspect Who Allegedly Threatened Him

Reading Time: 2:1 min

A Florida sheriff had a little fun with a confrontation that exploded at a Polk County McDonald’s last weekend, but the incident could have been far more serious without an…

View post

Associated Press Warns of ‘Surge’ in Homemade Weapons

Reading Time: 1:60 min

Leave it to the mainstream media to take a fundamental constitutional right and breathlessly transform it into a dangerous threat that must be confronted right now. That’s the tone of…

View post

Virginia Court Bars Enforcement of Universal Background Check Law

Reading Time: 1:52 min

Second Amendment advocacy groups carry the banner of gun rights as the rest of us go about our daily lives. Thankfully, they are increasingly successful due to tireless efforts and…

View post

Miami Gardens Homeowner Shoots Alleged Intruder Who Opened Bedroom Door

Reading Time: 1:51 min

An apparent daytime home invasion attempt in Florida did not go as planned as the resident’s use of a firearm injured one suspect and sent the other two on a…

View post

Armed Chicago Man Fires on Alleged Car Thief Who Attempted to Run Him Down

Reading Time: 1:51 min

Chicago’s crime dilemma has been in the national spotlight for weeks, and an explosive incident early Sunday morning is a stark reminder of just how dangerous the Windy City can…

View post

Massachusetts High Court Rejects Murder Conviction of Man Who Defended Himself

Reading Time: 2:3 min

Massachusetts is not known as a bastion of gun rights, and the state Supreme Judicial Court has a checkered history of not respecting the Second Amendment. That’s why this week’s…

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>