2A News

Oregon House Approves Bill to Double Gun Permit Fees

Reading Time: 2:0 min

Oregon’s contentious scheme to more than double the cost of firearm permits is a step closer to reality after the state House passed a bill to implement it.  Ballot Measure…

View post

Walz Introduces Package Including Tax on Firearms and Ammunition

Reading Time: 1:57 min

Minnesota Gov. Tim Walz surprised exactly no one on Tuesday when he introduced an expansive new gun control package to the state legislature. And while he claims to be a…

View post

Apartment Resident Shoots 22-Year-Old Allegedly Impersonating a Police Officer

Reading Time: 1:56 min

Imagine the fear and uncertainty when confronted by a police officer—only to realize that the person representing law enforcement is actually a violent criminal seeking entry to your home. Now…

View post

Semi-Automatic Firearm Ban Shot Down in Minnesota

Reading Time: 1:53 min

The all-out sprint to enact as many gun restrictions as possible for Minnesota residents hit a speed bump this week. The darling of anti-Second Amendment state lawmakers, HF 3434, is…

View post

Grand Rapids Mayor Declares Gun Owners ‘Should Be Ashamed’

Reading Time: 1:59 min

Gun control radicals don’t even bother with a pretense of moderation anymore. Instead, they trot out their anti-Second Amendment policies as if they will somehow magically transform violent criminals into…

View post

Gun Rights Opponents Throw Fit Over New Mexico Gun Control Defeat

Reading Time: 3:33 min

No matter where you stand on any prominent issue, there are likely to be victories to celebrate and defeats to ponder. But for something as clear-cut as the Second Amendment’s…

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>