2A News

Oakland Pawn Shop Workers Stop Massive Attack on Store

Reading Time: 1:51 min

For future reference, a pawn shop might not be the wisest target for violent criminals, even in large groups. Two California robbery suspects paid for their mistake with their lives,…

View post

Judge Upholds Constitutionality of Illinois Suppressor Ban

Reading Time: 2:3 min

Illinois residents are under some of the harshest anti-gun laws in the nation, and one of the oppressive measures was just upheld by a district judge. The state has the…

View post

Appeals Court Rules in Favor of Open Carry in Florida

Reading Time: 3:36 min

Sounds of celebration erupted in Florida this week after the First District Court of Appeals ruled on Wednesday that state citizens have the right to openly carry firearms for self-defense.…

View post

DOJ Seeks to Present Oral Arguments Before High Court on Illinois’ ‘Assault Weapon’ Ban

Reading Time: 1:53 min

It’s a new day for the Department of Justice (DOJ), and those of us who have become accustomed to seeing Second Amendment rights trampled on now have new cause to…

View post

Report: 26 AGs File Brief Before High Court Opposing Washington State’s Magazine Ban

Reading Time: 1:55 min

A majority of state attorneys general joined forces with the Arizona legislature to urge the U.S. Supreme Court to rule in favor of standard-capacity gun magazines. Breitbart News reported that…

View post

2A Groups Strongly Oppose Potential Trans Gun Ban

Reading Time: 3:25 min

Word came last week that the Department of Justice (DOJ) was considering banning transgender individuals from owning weapons.  This came in response to the mass shooting at a Minneapolis Catholic…

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>