2A News

Federal Court: Ban on Firearms in Post Offices Unconstitutional

Reading Time: 1:53 min

The cumulative effect of years of waging battles with anti-gun politicians means that there are some restrictions still on the books that need to be abolished. A step in that…

View post

Colt Canada Denies Involvement in Confiscation Scheme

Reading Time: 1:57 min

The pervasiveness of the internet in modern life means that rumors may quickly take on a life of their own and spread around the globe—even when there is no validity…

View post

Gun Rights Take Center Stage in Pennsylvania House

Reading Time: 1:60 min

Second Amendment advocates scored significant victories in their battle against yet more gun control in the Pennsylvania House, but there was also a major defeat to absorb. Representatives last week…

View post

LA Sheriff’s Department Rips DOJ For Pending Investigation into Gun Carry Permit Applications

Reading Time: 1:53 min

Under California’s gun control regime, Second Amendment enthusiasts meet official resistance at every turn. State residents are forced to plead with the government for a concealed carry weapons (CCW) permit,…

View post

SCOTUS Takes Case Challenging Hawaii’s ‘Vampire Rule’

Reading Time: 1:58 min

The U.S. Supreme Court will wade into Second Amendment waters again after granting certiorari in Wolford v. Lopez on Friday. This edition of the high court generally favored gun rights…

View post

Federal Judge Rules in Favor of Carry Ban on Public Land

Reading Time: 1:59 min

A federal judge on Tuesday struck a blow against gun rights for outdoor enthusiasts in what can only be described as a shocking ruling against constitutional liberties. U.S. District Judge…

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>