fix order of trails

This commit is contained in:
Alexander Gudev 2025-01-19 14:43:26 +02:00
commit 5552973bbd

View file

@ -54,8 +54,8 @@ trails trailDur raw = mkAnimation (duration raw) $ \t ->
fps = 200
construct :: [Int] -> SVG
construct = foldl' go (mkGroup []) where
go acc idx = mkGroup $ [reduceOpacity acc, getFrame idx]
construct = foldr go (mkGroup []) where
go idx acc = mkGroup $ [reduceOpacity acc, getFrame idx]
reduceOpacity = withGroupOpacity (fromIntegral trailFrames / fromIntegral (trailFrames + 1))
getFrame idx = frames V.! (idx `mod` nFrames)