2A News

Brady Blasts DOJ Reforms Restoring Second Amendment Rights

Reading Time: 1:54 min

Brady United is one of a handful of anti-Second Amendment outfits that attack gun rights and lament even the slightest reform to roll back previous constitutional overreaches. They became accustomed…

View post

Ohio 2A Community Awaits State House Vote on Suppressors

Reading Time: 2:5 min

There has doubtlessly been improvement recently in removing restrictions on the availability of hearing-protecting suppressors. The DOJ and ATF sent strong signals that federal registration requirements are a thing of…

View post

Report: Startup Creates Technology to Prevent 3D Printing Gun Parts

Reading Time: 3:28 min

Opponents of 3D-printed firearm parts, beyond the legality of such restrictions, face the real challenge of blocking this capability on privately owned printers without also stopping ordinary, non-weapon applications. New…

View post

SAF Cites Confusion After NFA Registration Ruled Unconstitutional

Reading Time: 2:7 min

To be sure, there is much excitement in the sporting community following the permanent injunction against NFA registration and the Department of Justice’s (DOJ) initial decision not to appeal the…

View post

OLC: Post Office Carry Ban Cannot Be Enforced

Reading Time: 1:58 min

Between federal law and U.S. Postal Service rules, law-abiding gun owners have, for decades, effectively been prohibited from possessing weapons when conducting affairs on their property. If the final nail…

View post

DOJ Creates Pathway for Restoring Second Amendment Rights

Reading Time: 3:32 min

No one wants weapons kept out of the wrong hands more than the shooting community. However, for far too long a person who lost these rights had virtually no recourse…

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>