2A News

11-Year-Old Shot Playing Ding Dong Ditch TikTok Prank

Reading Time: 4:6 min

An 11-year-old boy is dead after what started as a late-night prank, leaving a family shattered and a homeowner facing the possibility of life in prison. The tragedy unfolded during…

View post

2A Rights Group Challenges Colorado’s Gun Control Regime

Reading Time: 2:2 min

Colorado’s shooting community is not taking the state’s latest round of Second Amendment infringements lying down. A prominent 2A advocacy group filed a legal challenge to protect gun rights for…

View post

Chicago is Bleeding Out: 54 Shot, 7 Killed Over Labor Day Weekend

Reading Time: 3:58 min

Chicago is bleeding out: 54 shot, 7 killed over Labor Day weekend. Over the span of just three days, at least 32 separate shootings tore through the city, leaving dozens…

View post

Minnesota Governor Considers Emergency Session on Gun Control

Reading Time: 3:24 min

The aftershocks of last week’s horrific shooting at a Minneapolis Catholic school continue to reverberate. While some note the mental health issues surrounding the suspect, others want to focus on…

View post

Alleged Mistress Defends Herself from Enraged Wife

Reading Time: 1:54 min

A deadly early morning shooting in Nashville on Monday led investigators to uncover a love triangle that resulted in the alleged mistress using lethal force to defend herself from the…

View post

2A Groups Petition SCOTUS to Hear Challenge to Cook County’s AR-15 Ban

Reading Time: 2:14 min

Illinois’s most populous county has long prohibited its residents from exercising a right that is not only enjoyed by tens of millions of Americans but also protected by the Second…

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>