Capo

Capo is a custom library used to add animation and effects to button with just one line of code.


Keywords
animation, animations, capo, convenient, custom-library, flash, gradient-background, pulse, swift5, uibutton, uikit, xcode
License
MIT
Install
pod try Capo

Documentation

Capo

CI Status Version Badge Platform

About 📒

So Capo is a custom Library used to apply various animations and effect to a button.Capo reduces your 10-12 lines of code to 1 line making it more convenient to read and execute. Capo comes with various animations like pulse, flash and effects like applying gradient background and etc. So capo doesn't require any additional dependency's ,its a small and optimized library to make your work more convenient, easy, optimised and easy to understand too.

Idea ❤️

So while coding I found whenever it was about applying animations and effects we were supposed to write same lines of code multiple time, this made my coding frequency slow and even making the code appearance bad. So I thought to make a library which would make my work easy eventually making others work too. So this is the idea behind creation of Capo.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Device running on iOS/iPadOS 12.0+ versions 📱.

Installation

Capo is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Capo'

How To Use 📁 ?

Apply CornerRadius, BorderWidth and BorderColor

CapoTuner.tune(button: UIButton ,cornerRadius: CGFloat, borderWidth: CGFloat, borderColor: UIColor )

Apply Gradient Background

CapoTuner.applyGradient(button:UIButton, color1: UIColor, color2: UIColor, cornerRadius: CGFloat) 

Apply Shadow Effect

CapoTuner.applyShadow(button: UIButton, color: UIColor, width: Double, height: Double, Radius: CGFloat, opacity: Float)

Apply Pulse Animation

CapoTuner.pulsate(button: UIButton, duration: CFTimeInterval, from: CFTimeInterval, to: CFTimeInterval, autoReverse: Bool = false, repeatCount: Float = 0,velocity: CGFloat, damping: CGFloat)

Apply Flash Aimation

CapoTuner.flash(button: UIButton, duration: CFTimeInterval, from: CFTimeInterval, to: CFTimeInterval, autoReverse: Bool = false, repeatCount: Float = 0)

Apply PopColor Animation

CapoTuner.popColors(button: UIButton,fromColor: UIColor, toColor: UIColor, cornerRadius:CGFloat = 0,duration: CFTimeInterval, autoReverse: Bool = false, repeatCount: Float = 0)

Snapshots 🌉

Effect 1 Effect 2 Effect 3
Screenshot 2020-12-27 at 2 22 23 PM Screenshot 2020-12-27 at 2 27 41 PM Screenshot 2020-12-27 at 2 27 41 PM
Effect 4 Effect 5 Effect 6
  • Sample animations given above are made with arbitrary values, you can change it according to your need 🎛.
  • Above given animations are applied on UIButtons!.

Author 🖊

Gokul R Nair

License

Capo is available under the MIT license. See the LICENSE for more info.

How to Contribute ✍️

  • Install the pod - Steps mentioned above
  • If you face issues in any step open a new issue.
  • To fix issues: Fork this repository, make your changes and make a Pull Request.

Note 🔴

  • By default the "autoreverse" function for animations are kept false.

Updates ⚠️

Right now capo comes with limited features, it will be updated with future releases, So stay tuned to know more about Capo.

Like the Project ?

If you like using any of my projects or like what I'm doing, please consider backing me with appreciating my work: Message me🥰

BMC logo+wordmark - Black

OR

Drop a star if you find this project interesting!

Made with ❤️ in 🇮🇳 By Gokul Nair