2A News

Lawmakers Override Kentucky Governor’s Vetoes of 2A Bills

Reading Time: 3:25 min

With Virginia’s frantic slide into the Second Amendment abyss, it is refreshing to note that one of its close colleagues stood up to the governor and defended the right to…

View post

Final Rule Ends Banking Discrimination Against Weapons Industry

Reading Time: 1:55 min

Wall Street giants in recent years have made no secret that many do not want to provide essential financial services to the firearms industry. They used the nebulous “reputational risk”…

View post

Maryland Lawmakers Send Glock Ban to Governor’s Desk

Reading Time: 1:54 min

It’s that time of year, unfortunately, when anti-Second Amendment lawmakers trot out more tired proposals intended to infringe on the right to keep and bear arms. And increasingly, state officials…

View post

Mistaken Identity Leads to Fatal Shooting by Gun Shop Employee

Reading Time: 1:56 min

In retrospect, gun shop employees are likely not the best targets for a violent criminal mob—especially when they were not even the people the group intended to confront. A worker…

View post

Florida Man Shoots Home Invasion Suspect Found in Apartment

Reading Time: 1:54 min

Just because a dangerous situation is typical, it doesn’t mean that’s how encounters with criminals will always play out. Sometimes, these critical incidents pop up when least expected, which means…

View post

Spanberger Signs Gun Control Bills, DOJ Promises War

Reading Time: 2:4 min

Virginia Gov. Abigail Spanberger (D) fulfilled her campaign pledge to Second Amendment opponents when she signed a slew of new gun control bills into law. That action, however, is hardly…

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>