GithubHelp home page GithubHelp logo

hhy5277 / logincritter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cgoldsby/logincritter

0.0 2.0 0.0 11.65 MB

An animated avatar that responds to text field interactions

License: MIT License

Ruby 9.82% Swift 90.18%

logincritter's Introduction

Login Critter

An animated avatar that responds to text fields interactions ๐Ÿป

Demo gif

Inspired by the amazing work done by other designers and developers, specifically Darin Senneff's amazing work. ๐ŸŽฉ๐ŸŒŸ I wanted to try and create a similar animated "Login avatar" in Swift.

The Login Critter uses several UIPropertyAnimator. The head rotation is controlled by updating the fractionComplete property for an animator. As the user types, the animator's fraction complete is calculated by text width / text field width.

Avatar Assets

The Login Critter assets are broken down in to "Parts": body, head, eyes, ears, nose, muzzle, etc. Each "Part" can be individually animated. They are just vector PDFs because I wanted to focus on the animations and not worry about creating shapes programmatically.

I used Affinity Designer for creating the mock up and assets. (I'm falling in love with this program. ๐Ÿ˜) I've included the raw asset in this repo.

Avatar States

The Login Critter has a neutral, active, ecstatic, and shy state.

For simplicity, the neutral state is just the identity transform for all the Part layers. The neutral state can be triggered by tapping the background.

The active state has two phases a start and end. The start and end active phases corresponds to the avatar turning from left to right. The active state can be triggered by tapping the email text field.

The ecstatic state is unique because it can be used in combination with all other states, i.e. the avatar can be both ecstatic and neutral. The ecstatic state can be triggered by typing @ in the email text field.

The shy state is only used in combination with the neutral state and can be triggered by tapping the password text field.

The peek state is only used in combination with the shy state and can be toggled On or Off using the "show password" button in the password text field.

There is also a "saved" state. The "saved" state is the current active transformation that is stored when returning to the neutral state. For example, if the active state is 50% complete, the avatar is looking straight down, and transitions to the neutral state, then when returning to the active state the avatar will animate to 50% complete instead of 0% complete.

Neutral Active Ecstatic Shy Peek
Neutral png Active png Ecstatic png Shy png Peek png

The "Parts" transformations for each state begin with it's identity, the neutral state, then scale, rotate and/or translate is applied.

Debug Mode

There is a debug mode flag that when set to true it will show a debug UI. But, be wary, strange behavior might occur if you use both the text field and the debug UI. It's best to use either the text field or debug UI when testing.

Meta

It's rare that I get a chance to do animations and thought this might be a fun little project. Thanks for checking it out! ๐Ÿ™‡โ€

Chris Goldsby โ€“ @goldsbychris

Distributed under the MIT license. See LICENSE for more information.

Questions? Comments? I would love to hear your feedback. โค๏ธ

logincritter's People

Contributors

cgoldsby avatar dsrijan avatar tejas-ardeshna avatar

Watchers

 avatar  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.