2A News

DOJ Adds Liability Insurance Requirement to Lawsuit Against San Jose

Reading Time: 2:0 min

The Department of Justice (DOJ) on Tuesday expanded its recently announced lawsuit against San Jose, California’s highest-in-the-nation concealed carry license fee–nearly $1,600. The DOJ has now amended its complaint against…

View post

Feds Now Target Minnesota Over Lengthy Waiting Periods

Reading Time: 2:8 min

Another day, another Department of Justice (DOJ) lawsuit against a government entity that not only does not respect the Second Amendment but is openly hostile to the right to keep…

View post

TTAG: 40 million AR-15s Qualify as in ‘Common Use’

Reading Time: 3:26 min

It takes a magical Jedi mind trick even to suggest that the AR-15, the most popular sporting rifle in the U.S., is not in “common use.” After all, some 40…

View post

US Rep. Wants BB and Pellet Guns Classified as Firearms

Reading Time: 2:12 min

Few American companies are as tied to a rite of passage enjoyed by millions for decades as Daisy BB Guns. Their BB and pellet guns sparked many young people’s passion…

View post

Newsom Signs 10 New Gun Control Measures Into California Law

Reading Time: 2:2 min

When the prominent governor of the most populous U.S. state, who is widely believed to be eyeing a strong presidential bid in 2028, acts on gun control, those who prize…

View post

Illinois’ Wild Scheme to Bankrupt Firearm Industry

Reading Time: 2:15 min

As brain-addled ideas out of left field go, the Responsibility in Firearm Legislation (RIFL) Act is on par with the silliest suggestions anti-Second Amendment radicals have floated. You’d think the…

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>