2A News

Hawaii Man Successfully Challenges Denial of “Permit to Acquire” Firearm

Reading Time: 1:53 min

Anti-gun states such as California, Illinois, and New York regularly draw the ire of those who value the fundamental right to keep and bear arms. But for pure animosity toward…

View post

Report: Pro-2A AGs Ask SCOTUS to Rule in Favor of Standard Capacity Magazines

Reading Time: 1:57 min

Two high-profile state attorneys general filed a brief on Thursday imploring the U.S. Supreme Court to take a stand for standard capacity gun magazines under attack by anti-Second Amendment lawmakers.…

View post

Minnesota Lawmakers Support Impeding 2A Rights for Victims of Domestic Violence

Reading Time: 2:8 min

Should victims of domestic abuse be forced to wait 30 days and undergo firearm training to exercise their Second Amendment right to self-defense at this most critical time? Yes, according…

View post

NY School District Rejects Fundraising by Local Gun Shop

Reading Time: 2:3 min

It is perfectly natural for any good parent to want to support their child’s endeavors, and this certainly extends to school athletics. For one New York state gun shop owner,…

View post

Wisconsin Lawmakers Seek Blanket Ban of Campus Carry

Reading Time: 1:52 min

Campus carry is back in the spotlight in Wisconsin as anti-gun officials once again seek to encroach on Second Amendment rights. This week, lawmakers introduced a bill that would create…

View post

Senior Citizen Wields Firearm to Save Himself from Alleged Intruder

Reading Time: 1:59 min

Arkansas authorities are investigating a violent incident in which an elderly man apparently used his firearm to shoot and kill an intruder. It was Wednesday evening when the homeowner was…

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>