2A News

DOJ Sues Denver and Colorado Over ‘Assault Weapons’ and Magazine Bans

Reading Time: 2:6 min

The new and somewhat improved Department of Justice (DOJ) took a stand on Wednesday, when the historically embattled agency sued the state of Colorado after filing similar litigation against the…

View post

National Gun Sales Increase in April as Virginia’s Soar

Reading Time: 1:54 min

The always-interesting data on firearm and firearm-related sales across the nation are in for April, and they reveal a clear truth. The American public continues to support the Second Amendment…

View post

Man Pays Price for Alleged Break-In at Estranged Wife’s Boyfriend’s Home

Reading Time: 2:6 min

Divorce is a messy business, but the battles should be fought in a courtroom between lawyers. The regrettable choice that some who are going through this trauma decide to take…

View post

Texas Father Shoots Alleged Carjacker to Protect Family

Reading Time: 2:13 min

It was the middle of a likely hot afternoon on Sunday when a Texas family of eight who stopped into a Garland convenience store encountered what would make every good…

View post

SAF Warns SCOTUS That Courts are Circumventing Bruen

Reading Time: 1:56 min

The Second Amendment Foundation (SAF) joined the National Rifle Association (NRA) and multiple other advocacy groups and filed an amicus brief with the U.S. Supreme Court. The issue is complex…

View post

Graham Urges ‘Second Amendment Solution’ For Iran

Reading Time: 2:2 min

To be clear, the Second Amendment was never primarily about hunting or shooting cans off of a fencepost. The Founding Fathers lived under a tyrannical regime firsthand, and they repeatedly…

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>