Files
parenthese/landing/src/heroGraphMath.js
T
IliesAllaliandClaude Opus 5 e8e2485dcd Parenthèse
Galaxie familiale : personnes, unions et filiations, photos, vidéos et voix sur chaque personne,
partage par lien avec consultation sans compte et contributions validées par le propriétaire.
Auto-hébergeable avec Docker. Licence PolyForm Noncommercial 1.0.0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-14 15:49:05 +02:00

23 lines
638 B
JavaScript

export function easeOutCubic(t) {
return 1 - Math.pow(1 - t, 3)
}
export function getEntranceProgress(elapsed, startMs, duration, reducedMotion = false) {
if (reducedMotion) return 1
if (elapsed < startMs) return 0
if (elapsed >= startMs + duration) return 1
return easeOutCubic((elapsed - startMs) / duration)
}
export function seededFloat(id, salt = 0) {
let hash = 2166136261 + salt
for (let i = 0; i < id.length; i += 1) {
hash = Math.imul(hash ^ id.charCodeAt(i), 16777619)
}
return (hash >>> 0) / 4294967295
}
export function lerp(current, target, factor) {
return current + (target - current) * factor
}