2A News

Virginia Authorities Retreat After Admonishment from Court

Reading Time: 1:57 min

A court order is not something to be taken lightly, even if you are politically powerful and have a rabid base that you constantly need to appease. This hard lesson…

View post

FPC Files Lawsuit Against California Cities’ Handgun Rationing

Reading Time: 1:54 min

California’s anti-Second Amendment establishment faces yet another strong legal challenge after gun rights groups last week filed a lawsuit challenging two cities’ handgun rationing scheme. The Firearms Policy Coalition (FPC),…

View post

Anti-2A Radicals Blow Gasket Over ATF Reform

Reading Time: 1:57 min

Handling disappointment when things don’t go your way is an incredibly valuable life skill that can do wonders for your prospects for a happy and successful future. Then there’s the…

View post

Marine Vet Seizes Pistol and Holds Off Four Alleged Attackers

Reading Time: 2:8 min

As the fundamental factor in real estate is location, the prime objective of violent criminals should be to choose the correct targets. In a recent case that exploded in Oxon…

View post

California Homeowner Shoots Alleged Intruder Wielding Shotgun

Reading Time: 2:3 min

It is said that the only thing a professional sniper fears is another professional sniper. For violent criminals, it’s past time they realized and responded to the tens of millions…

View post

AG Declares Florida’s 3-Day Waiting Period Unconstitutional

Reading Time: 1:56 min

Another day, another win in the ongoing and fierce battle to protect Second Amendment rights from those who would destroy them. After Florida lawmakers enacted a 3-day waiting period for…

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>