@redocly/theme
Version:
Shared UI components lib
15 lines • 672 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.enhancedSmoothstep = enhancedSmoothstep;
/**
* Enhanced smoothstep function for smooth interpolation with configurable threshold.
* Used in active heading detection to create virtual positions for better scroll behavior.
*/
function enhancedSmoothstep(input, threshold = 0.4) {
if (input <= threshold) {
return 0;
}
const normalizedValue = Math.min(Math.max((input - threshold) / (1 - threshold), 0), 1);
return (3 * normalizedValue * normalizedValue - 2 * normalizedValue * normalizedValue * normalizedValue);
}
//# sourceMappingURL=enhanced-smoothstep.js.map