
Colourful, touch-driven screen transition that pulls toward the trigger then emits a leaning wave, leaving colour on edges; supports vertical, horizontal and center origins, overlay and revealed content.
[!NOTE] A Compose Multiplatform port of Distortion Waves by Jakub Antalik:
A colourful wave that carries one screen into the next. The screen pulls toward the button first, then the wave leaves from where it was touched, leaning that way, and leaves its colour on the edges. Vertical, horizontal and center. React and SwiftUI.
repositories {
mavenCentral()
}
dependencies {
implementation("at.florianschuster.distortionwaves:distortion-waves:$version")
}Runs on Android, iOS, desktop and Wasm. On Android the wave needs Android 13. Below that, and when the system asks for less motion, it is a crossfade.
var sent by remember { mutableStateOf(false) }
DistortionWave(
revealed = sent,
modifier = Modifier.fillMaxSize(),
overlay = {
Button(
onClick = { sent = !sent },
modifier = Modifier
.align(alignment = Alignment.BottomCenter)
.distortionWaveSource(),
) {
Text(text = if (sent) "Done" else "Confirm")
}
},
revealedContent = { Receipt() },
content = { Review() },
)Check out the distortion-waves skill to implement distortion-waves with your AI agents. It also documents DistortionWaveContent, DistortionWaveState, styling and platform support.
visit my website.
[!NOTE] A Compose Multiplatform port of Distortion Waves by Jakub Antalik:
A colourful wave that carries one screen into the next. The screen pulls toward the button first, then the wave leaves from where it was touched, leaning that way, and leaves its colour on the edges. Vertical, horizontal and center. React and SwiftUI.
repositories {
mavenCentral()
}
dependencies {
implementation("at.florianschuster.distortionwaves:distortion-waves:$version")
}Runs on Android, iOS, desktop and Wasm. On Android the wave needs Android 13. Below that, and when the system asks for less motion, it is a crossfade.
var sent by remember { mutableStateOf(false) }
DistortionWave(
revealed = sent,
modifier = Modifier.fillMaxSize(),
overlay = {
Button(
onClick = { sent = !sent },
modifier = Modifier
.align(alignment = Alignment.BottomCenter)
.distortionWaveSource(),
) {
Text(text = if (sent) "Done" else "Confirm")
}
},
revealedContent = { Receipt() },
content = { Review() },
)Check out the distortion-waves skill to implement distortion-waves with your AI agents. It also documents DistortionWaveContent, DistortionWaveState, styling and platform support.
visit my website.