Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apply the .kenBurns() modifier to any Image or View you want to animate. Ensure the view has a size defined by its parent container (e.g., a .frame() or VStack/HStack constraint).

import SwiftUI
import KenBurns

struct ContentView: View {
    var body: some View {
        Image("CoolImage")
            .resizable()
            .scaledToFill() // Optional: Ensures it covers the frame completely
            .frame(width: 400, height: 400) // Define the frame for the animation area
            
            // Apply the Ken Burns effect
            .kenBurns(duration: 15.0, maxScale: 1.3)
            
            .clipped() // Important to prevent overflow
    }
}

About

A simple KenBurns Effect for SwiftUI Views

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages