2A News

Firearm Used to Halt Apparent Bar Rampage in Indiana

Reading Time: 2:1 min

Every responsible gun owner knows that alcohol and firearms don’t mix. However, a recent altercation at an Indiana drinking establishment demonstrated yet again how having a legal and ready firearm…

View post

SCOTUS Rejects NRA-ILA Challenge to Controversial NFA Restrictions

Reading Time: 1:57 min

The U.S. Supreme Court on Monday turned aside the latest challenge to the National Firearms Act of 1934 (NFA). The National Rifle Association-Institute for Legislative Action (NRA-ILA) petitioned for certiorari…

View post

OCC: Wall Street Giants Discriminated Against Weapons Industry

Reading Time: 2:1 min

Financial services are the lifeblood of any major business enterprise, and the firearms industry is no exception. In recent years, anti-gunners conspired to strangle the constitutionally protected sector through a…

View post

Australia’s Response to Apparent Terror Attack? Yet More Gun Control

Reading Time: 1:56 min

The first step to solving a problem is identifying precisely what the problem is. That is a simple premise that officials in Australia struggle with in the wake of an…

View post

GOA Warns Miami’s Incoming Mayor is Virulently Anti-Second Amendment

Reading Time: 1:58 min

Even as the Department of Justice (DOJ) and several states strengthen their commitments to Second Amendment rights, there is a troubling trend in major cities nationwide. Voters are sending leaders…

View post

Anti-Gunners Misplace Blame After Brown, Australia Shootings

Reading Time: 3:59 min

A suspect on Saturday killed two people and injured nine others in a senseless attack at Brown University. This was followed shortly after by the terrorist attack on Australia’s Bondi…

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>