mirror of
https://github.com/IliesAllali/parenthese.git
synced 2026-11-12 00:12:14 +00:00
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>
23 lines
638 B
JavaScript
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
|
|
}
|