@arwes/text
Version:
Futuristic Sci-Fi UI Web Framework
10 lines (9 loc) • 425 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAnimationTextDuration = void 0;
const getAnimationTextDuration = (props) => {
const { length, maxDuration = 4, charactersPerSecond = 100 } = props;
const realDuration = ((1000 / charactersPerSecond) * length) / 1000;
return Math.min(realDuration, maxDuration);
};
exports.getAnimationTextDuration = getAnimationTextDuration;