{"id":13700392,"url":"https://github.com/kgellci/Shift","last_synced_at":"2025-05-04T18:35:11.620Z","repository":{"id":62455287,"uuid":"91874425","full_name":"kgellci/Shift","owner":"kgellci","description":"Animate gradient changes with time or motion for iOS Swift","archived":false,"fork":false,"pushed_at":"2019-03-29T11:03:52.000Z","size":3363,"stargazers_count":183,"open_issues_count":2,"forks_count":19,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-04T00:46:34.635Z","etag":null,"topics":["gradient","ios","ios-animation","swift-3","swift-framework","swift3"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kgellci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-20T08:00:54.000Z","updated_at":"2025-04-03T10:30:30.000Z","dependencies_parsed_at":"2022-11-01T23:45:52.222Z","dependency_job_id":null,"html_url":"https://github.com/kgellci/Shift","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgellci%2FShift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgellci%2FShift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgellci%2FShift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgellci%2FShift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kgellci","download_url":"https://codeload.github.com/kgellci/Shift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252383206,"owners_count":21739288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gradient","ios","ios-animation","swift-3","swift-framework","swift3"],"created_at":"2024-08-02T20:00:55.274Z","updated_at":"2025-05-04T18:35:06.606Z","avatar_url":"https://github.com/kgellci.png","language":"Swift","readme":"# Shift\n\n![Swift](https://img.shields.io/badge/Swift-3.0-orange.svg)\n[![Platform](https://img.shields.io/cocoapods/p/Pastel.svg?style=flat)](http://cocoapods.org/pods/Pastel)\n[![CI Status](http://img.shields.io/travis/kgellci/Shift.svg?style=flat)](https://travis-ci.org/kgellci/Shift)\n[![Version](https://img.shields.io/cocoapods/v/Shift.svg?style=flat)](http://cocoapods.org/pods/Shift)\n[![License](https://img.shields.io/cocoapods/l/Shift.svg?style=flat)](http://cocoapods.org/pods/Shift)\n[![Platform](https://img.shields.io/cocoapods/p/Shift.svg?style=flat)](http://cocoapods.org/pods/Shift)\n\n![Shift_gif.gif](README/Shift_gif.gif)\n![handle_logo_gradient.gif](README/handle_logo_gradient.gif)\n\nInspired by Pastel: https://github.com/cruisediary/Pastel\n\nShift allows you to do gradient color animations on your UI using either a timed animation or the device tilting motion.\n\nYou can also easily mask the gradient animation to images or text.  Couple this with the motion based animation and \nyou will get an effect similar to the Robinhood app.\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n```swift\nlet view = ShiftView()\n\n// set colors\nview.setColors([UIColor.orange,\nUIColor.red,\nUIColor.blue,\nUIColor.purple])\n\n// set animation duration\nview.animationDuration(3.0)\n\n// start animation\nview.startTimedAnimation()\n\n```\n\nYou can also start a motion based animation. The device accelerometer is used to shift the color as the device is tilted.\nNote that accelerometers are not available is the simulator.\n\n```swift\nview.startMotionAnimation()\n```\n\nYou can instantate a Button and animate the gradient color on the text only\n\nThis is similar to the gold reflection animations in the Robinhood app\n\n![shift_gold_gif.gif](README/shift_gold_gif.gif)\n\n```swift\nlet button = ShiftButton()\nbutton.setTitle(\"Hello!\", for: .normal)\n\n// Custom gradient direction\nbutton.start(shiftPoint: .topLeft)\nbutton.end(shiftPoint: .bottomRight)\n\n// Show the gradient on the text only\nbutton.maskToText = true\nbutton.startMotionAnimation()\n```\nHere is a list of available UI Classes\n\n```swift\nShiftView()\n\n// maskable to text or image\nShiftButton()\n\nShiftLabel()\n\n// Maskable to text\nShiftMaskableLabel()\n\nShiftTextfield()\n\nShiftTextView()\n\n// Maskable to image\nShiftImageView()\n```\n\nEach UI class has an Objective-C equivalent, just add _Objc to the class name, ShiftView_Objc\n\n## Requirements\n\nSwift 4.0, iOS 8.  Compatible with Obj-c\n\n## Installation\n\nShift is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"Shift\"\n```\n\n## Author\n\nkgellci, kgellci@gmail.com, @kgellci\n\n## License\n\nShift is available under the MIT license. See the LICENSE file for more info.\n","funding_links":[],"categories":["Gradient","Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgellci%2FShift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkgellci%2FShift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgellci%2FShift/lists"}