Conversation
| val confettiColors = remember { listOf(Color.Red, Color.Green, Color.Blue, Color.Yellow) } | ||
|
|
||
| val infiniteTransition = rememberInfiniteTransition() | ||
| val alpha by infiniteTransition.animateFloat( |
There was a problem hiding this comment.
Gotta remind me to swap out the infiniteTransition for a normal animation. It's easier to test if you can let it loop, but no reason to leave it like that.
Plastix
left a comment
There was a problem hiding this comment.
This is awesome! Another idea would be to animate the line height on the confetti so it looks like it is "fluttering". Some ideas: https://github.com/DanielMartinus/Konfetti
| import kotlin.math.cos | ||
| import kotlin.math.sin | ||
|
|
||
| data class Projectile(val origin: Offset, val angle: Float, val speed: Float, val color: Color, val gravity: Float) { |
There was a problem hiding this comment.
How about making these data classes and helper functions private?
| is PuzzleDetailViewState.Loading -> PuzzleDetailLoadingState() | ||
| is PuzzleDetailViewState.Success -> { | ||
| val gameState = state.boardGameState | ||
| // ConfettiCanvas(gameState.activeWordToast != null) |
There was a problem hiding this comment.
I love the Confetti canvas! It would be nice if the animation duration wasn't tied to word toast length
| is PuzzleDetailViewState.Success -> { | ||
| val gameState = state.boardGameState | ||
| // ConfettiCanvas(gameState.activeWordToast != null) | ||
| FireworksCanvas(gameState.activeWordToast != null) |
There was a problem hiding this comment.
I think we want to put this after the dialog code in this block so the confetti renders over all the other UI elements
|
|
||
| val confettiColors = remember { listOf(Color.Red, Color.Green, Color.Blue, Color.Yellow) } | ||
| val states = mutableListOf<ConfettiState>() | ||
| val n = 10; |
| for (i in 0..n) { | ||
| states += rememberConfettiState( |
There was a problem hiding this comment.
val states = List(n) { i ->
rememberConfettiState(
A bit wacky right now as it runs on every submission. Needs to be restricted to valid words (or maybe even just to pangrams)