source/Plx.js
function getClasses(lastSegmentScrolledBy, isInSegment, parallaxData) {
  let cssClasses = null;

  if (lastSegmentScrolledBy === null) {
    cssClasses = 'Plx--above';
  } else if (lastSegmentScrolledBy === parallaxData.length - 1 && !isInSegment) {
    cssClasses = 'Plx--below';
  } else if (lastSegmentScrolledBy !== null && isInSegment) {
    const segmentName = parallaxData[lastSegmentScrolledBy].name || lastSegmentScrolledBy;

    cssClasses = `Plx--active Plx--in Plx--in-${ segmentName }`;
  } else if (lastSegmentScrolledBy !== null && !isInSegment) {
    const segmentName = parallaxData[lastSegmentScrolledBy].name || lastSegmentScrolledBy;
    const nextSegmentName = parallaxData[lastSegmentScrolledBy + 1].name || lastSegmentScrolledBy + 1;

    cssClasses = `Plx--active Plx--between Plx--between-${ segmentName }-and-${ nextSegmentName }`;
  }

  return cssClasses;
}
function getClasses(lastSegmentScrolledBy, isInSegment, parallaxData) {
  let cssClasses = null;

  if (lastSegmentScrolledBy === null) {
    cssClasses = 'Plx--above';
  } else if (lastSegmentScrolledBy === parallaxData.length - 1 && !isInSegment) {
    cssClasses = 'Plx--below';
  } else if (lastSegmentScrolledBy !== null && isInSegment) {
    const segmentName = parallaxData[lastSegmentScrolledBy].name || lastSegmentScrolledBy;

    cssClasses = `Plx--active Plx--in Plx--in-${ segmentName }`;
  } else if (lastSegmentScrolledBy !== null && !isInSegment) {
    const segmentName = parallaxData[lastSegmentScrolledBy].name || lastSegmentScrolledBy;
    const nextSegmentName = parallaxData[lastSegmentScrolledBy + 1].name || lastSegmentScrolledBy + 1;

    cssClasses = `Plx--active Plx--between Plx--between-${ segmentName }-and-${ nextSegmentName }`;
  }

  return cssClasses;
}
function getClasses ( lastSegmentScrolledBy , isInSegment , parallaxData ) { let cssClasses = null ; if ( lastSegmentScrolledBy === null ) { cssClasses = 'Plx--above' ; } else if ( lastSegmentScrolledBy === parallaxData . length - 1 && ! isInSegment ) { cssClasses = 'Plx--below' ; } else if ( lastSegmentScrolledBy !== null && isInSegment ) { const segmentName = parallaxData [ lastSegmentScrolledBy ] . name || lastSegmentScrolledBy ; cssClasses = ` ${ segmentName } ` ; } else if ( lastSegmentScrolledBy !== null && ! isInSegment ) { const segmentName = parallaxData [ lastSegmentScrolledBy ] . name || lastSegmentScrolledBy ; const nextSegmentName = parallaxData [ lastSegmentScrolledBy + 1 ] . name || lastSegmentScrolledBy + 1 ; cssClasses = ` ${ segmentName } ${ nextSegmentName } ` ; } return cssClasses ; }
Returns CSS classes based on animation state
Returns CSS classes based on animation state