Coder Social home page Coder Social logo

augmify / motionblur Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fastred/motionblur

0.0 0.0 0.0 843 KB

MotionBlur allows you to add motion blur effect to iOS animations.

Home Page: http://holko.pl/2014/07/21/motion-blur/

License: MIT License

motionblur's Introduction

MotionBlur

MotionBlur allows you to add motion blur effect to your animations (currently only position's change). See the accompanying blog post to learn how it's implemented.

Demo GIF

Note how the text and icons on the menu get blurred when it slides in and out.

Usage

First, import it with:

#import "UIView+MotionBlur.h"

then use it with:

[yourView enableBlurWithAngle:M_PI_2 completion:^{
    [UIView animateWithDuration:0.5
                          delay:0
         usingSpringWithDamping:0.8
          initialSpringVelocity:0.3
                        options:UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionBeginFromCurrentState
                     animations:^{

        CGRect f = yourView.frame;
        f.origin = CGPointMake(0, 300);
        yourView.frame = f;
    } completion:^(BOOL finished) {
        [yourView disableBlur];
    }];
}];

Snapshot and blur are computed before the animation, that's why the API is asynchronous. You should also see the example project and read comments in the header file: Classes/UIView+MotionBlur.h.

Demo

To run the example project; clone the repo and open Example/MotionBlur.xcodeproj.

Requirements

  • iOS 8 and above

Installation

Copy files from Classes/ to your project. CocoaPod will be made available when iOS 8 comes out.

Author

Arkadiusz Holko:

motionblur's People

Contributors

fastred avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.