{"id":19096959,"url":"https://github.com/shoheiyokoyama/gemini","last_synced_at":"2025-05-14T22:08:17.579Z","repository":{"id":37742792,"uuid":"93924821","full_name":"shoheiyokoyama/Gemini","owner":"shoheiyokoyama","description":"Gemini is rich scroll based animation framework for iOS, written in Swift.","archived":false,"fork":false,"pushed_at":"2023-08-27T20:40:59.000Z","size":3707,"stargazers_count":3281,"open_issues_count":18,"forks_count":196,"subscribers_count":55,"default_branch":"master","last_synced_at":"2025-05-14T22:08:09.744Z","etag":null,"topics":["animation-3d","animation-effects","animation-library","carthage","cocoapods","ios","ios-animation","swift","swift-library","uicollectionview"],"latest_commit_sha":null,"homepage":"https://www.youtube.com/watch?v=bPtq5E6lKzw\u0026utm_content=bufferfa3fd\u0026utm_medium=social\u0026utm_source=twitter.com\u0026utm_campaign=buffer","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/shoheiyokoyama.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-06-10T08:00:56.000Z","updated_at":"2025-05-09T13:01:15.000Z","dependencies_parsed_at":"2022-08-03T13:00:36.937Z","dependency_job_id":"b17aeeac-aeef-48fa-8e94-617a7fb01c56","html_url":"https://github.com/shoheiyokoyama/Gemini","commit_stats":{"total_commits":72,"total_committers":5,"mean_commits":14.4,"dds":0.05555555555555558,"last_synced_commit":"2484f5ce073d35ebe2440c09f8864f6fb0bce37a"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shoheiyokoyama%2FGemini","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shoheiyokoyama%2FGemini/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shoheiyokoyama%2FGemini/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shoheiyokoyama%2FGemini/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shoheiyokoyama","download_url":"https://codeload.github.com/shoheiyokoyama/Gemini/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235700,"owners_count":22036964,"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":["animation-3d","animation-effects","animation-library","carthage","cocoapods","ios","ios-animation","swift","swift-library","uicollectionview"],"created_at":"2024-11-09T03:38:18.955Z","updated_at":"2025-05-14T22:08:12.568Z","avatar_url":"https://github.com/shoheiyokoyama.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/shoheiyokoyama/Assets/blob/master/Gemini/logo.png\" width=\"500\"\u003e\n\u003c/p\u003e\n\n# Overview\n\n\u003cimg src=\"https://github.com/shoheiyokoyama/Assets/blob/master/Gemini/demo-circle-rotation.gif\" align=\"left\"\u003e\n\n## What is the `Gemini`?\n\n`Gemini` is rich scroll based animation framework for iOS, written in Swift. You can easily use `GeminiCollectionView`, which is a subclass of `UICollectionView`.\n\nIt enables you to make multiple animation which has various and customizable properties, and moreover can create your own custom scroll animation. \n\n`Gemini` also provides a fluent interface based on method chaining. you can use this intuitively and simply.\n\n\n```swift\ncollectionView.gemini\n    .circleRotationAnimation()\n    .radius(400)\n    .rotateDirection(.clockwise)\n```\n\n# Features\n\n![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat\n)\n[![Cocoapods](https://img.shields.io/badge/Cocoapods-compatible-brightgreen.svg)](https://img.shields.io/badge/Cocoapods-compatible-brightgreen.svg)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-Compatible-brightgreen.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![License](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat\n)](http://mit-license.org)\n![Swift](https://img.shields.io/badge/swift-5.0-orange.svg)\n![pod](https://img.shields.io/badge/pod-v1.4.0-red.svg)\n\n\u003cimg src=\"https://github.com/shoheiyokoyama/Assets/blob/master/Gemini/demo-yaw-rotation.gif\" align=\"right\"\u003e\n\n- [x] Rich animation with scrolling\n- [x] Easily usable\n- [x] Highly customizable\n- [x] Several types of animations and properties\n- [x] Supports vertical and horizontal flow layout\n- [x] Supports easing function\n- [x] Supports `Swift5.0`\n- [x] Fluent interfaces based on method chaining\n- [x] Compatible with `Carthage`\n- [x] Compatible with `CocoaPods`\n- [x] Example project with lots of stock animations\n- [x] And More...\n\n# Contents\n- [Animation Types and properties](#anmation-types)\n- [Usage](#usage)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Author](#author)\n\n# \u003ca name=\"anmation-types\"\u003e Animation Types and properties\n\nThe following animation types are available. See sample code [here](https://github.com/shoheiyokoyama/Gemini/tree/master/Example/Gemini) for details.\n\n- [Cube](#cube)\n- [Circle Rotation](#circle-rotation) You can configure direction of rotation using the `CircleRotationDirection`\n- [3D vector rotation](#3d-vector-rotation) Each rotation types provide multiple rotation effect\n  - [Roll Rotation](#roll-rotation)\n  - [Pitch Rotation](#pitch-rotation)\n  - [Yaw Rotation](#yaw-rotation)\n- [Scale](#scale)\n- [Custom](#custom) You can create your own custom scroll animation using multiple properties, rotation, scale, translation, etc.\n\nIn addition, you can also customize the following properties for the above animation types.\n\n- BackgroundColor\n- CornerRadius\n- Alpha\n- [Easings](#easing-function)\n- [Shadow Effect](#shadow-effect)\n\n## \u003ca name=\"cube\"\u003e Cube\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/shoheiyokoyama/Assets/blob/master/Gemini/cube-horizontal.gif\"\u003e\n  \u003cimg src=\"https://github.com/shoheiyokoyama/Assets/blob/master/Gemini/cube-vertical.gif\"\u003e\n\u003c/p\u003e\n\nIt's a cube animation like Instagram.\nIf you would like to customize the cube animation, change `cubeDegree`. \nIf `cubeDegree` is 90, it moves like a regular hexahedron.\n\n```swift\ncollectionView.gemini\n    .cubeAnimation()\n    .cubeDegree(90)\n```\n\n## \u003ca name=\"circle-rotation\"\u003e CircleRotation\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/shoheiyokoyama/Assets/blob/master/Gemini/circle-horizontal.gif\"\u003e\n  \u003cimg src=\"https://github.com/shoheiyokoyama/Assets/blob/master/Gemini/circle-vertical.gif\"\u003e\n\u003c/p\u003e\n\nAn animation moves in a circle. You can change `circleRadius` and `CircleRotationDirection`.\n\n```swift\ncollectionView.gemini\n    .circleRotationAnimation()\n    .radius(450) // The radius of the circle\n    .rotateDirection(.clockwise) // Direction of rotation. \n    .itemRotationEnabled(true) // Whether the item rotates or not.\n```\n\n## \u003ca name=\"3d-vector-rotation\"\u003e 3D vector rotation\n\nAvailable for `Roll`, `Pitch` and `Yaw` animation. These rotation animation are designed based on 3-Dimensional vector. Figure-1 shows direction of rotation based on device.\n\n###### ***Figure-1*** Pitch, roll, and yaw axes ######\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/shoheiyokoyama/Assets/blob/master/Gemini/attitude_rotation.png\" width=\"350\"\u003e\n\u003c/p\u003e\n\n###### Reference: [Event Handling Guide for UIKit Apps](https://developer.apple.com/library/content/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/HandlingProcessedDeviceMotionData.html#//apple_ref/doc/uid/TP40009541-CH27-SW1)\n\n### \u003ca name=\"roll-rotation\"\u003e Roll Rotation\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/shoheiyokoyama/Assets/blob/master/Gemini/roll-horizontal.gif\"\u003e\n  \u003cimg src=\"https://github.com/shoheiyokoyama/Assets/blob/master/Gemini/roll-vertical.gif\"\u003e\n\u003c/p\u003e\n\n### \u003ca name=\"pitch-rotation\"\u003e Pitch Rotation\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/shoheiyokoyama/Assets/blob/master/Gemini/pitch-horizontal.gif\"\u003e\n  \u003cimg src=\"https://github.com/shoheiyokoyama/Assets/blob/master/Gemini/pitch-vertical.gif\"\u003e\n\u003c/p\u003e\n\n### \u003ca name=\"yaw-rotation\"\u003e Yaw Rotation\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/shoheiyokoyama/Assets/blob/master/Gemini/yaw-horizontal.gif\"\u003e\n  \u003cimg src=\"https://github.com/shoheiyokoyama/Assets/blob/master/Gemini/yaw-vertical.gif\"\u003e\n\u003c/p\u003e\n\n\nEach types of rotation animation has `RotationEffect`(e.g. `RollRotationEffect`) and degree of rotation.\n\nCustomize `RotationEffect` (`up`, `down`, `sineWave`, `reverseSineWave`) and degree of rotation.\n\nIn the case of `rollRotation`, like this:\n```swift\ncollectionView.gemini\n    .rollRotationAnimation()\n    .degree(45)\n    .rollEffect(.rollUp)\n```\n\n## \u003ca name=\"scale\"\u003e Scale\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/shoheiyokoyama/Assets/blob/master/Gemini/scale-up.gif\"\u003e\n  \u003cimg src=\"https://github.com/shoheiyokoyama/Assets/blob/master/Gemini/scale-down.gif\"\u003e\n\u003c/p\u003e\n\nThe `scaleUp` gradually increases frame size, `scaleDown` decreases.\n\n```swift\ncollectionView.gemini\n    .scaleAnimation()\n    .scale(0.75)\n    .scaleEffect(.scaleUp) // or .scaleDown\n```\n\n## \u003ca name=\"custom\"\u003e Custom\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/shoheiyokoyama/Assets/blob/master/Gemini/custom1.gif\"\u003e\n  \u003cimg src=\"https://github.com/shoheiyokoyama/Assets/blob/master/Gemini/custom2.gif\"\u003e\n\u003c/p\u003e\n\nYou can flexibly and easily customize scroll animation. Customize properties of `GeminiAnimation.custom` such as `scale`, `scaleEffect`, `rotationAngle`, `translation`, `easing`, `shadowEffect`, `alpha`, `cornerRadius`, `backgroundColor`, `anchorPoint`, etc.\n\nThe animation of gif is customized in the following way:\n\n```swift\ncollectionView.gemini\n    .customAnimation()\n    .translation(y: 50)\n    .rotationAngle(y: 13)\n    .ease(.easeOutExpo)\n    .shadowEffect(.fadeIn)\n    .maxShadowAlpha(0.3)\n```\n\nOr right side of gifs is customized as follows:\n\n```swift\ncollectionView.gemini\n    .customAnimation()\n    .backgroundColor(startColor: lightGreenColor, endColor: lightBlueColor)\n    .ease(.easeOutSine)\n    .cornerRadius(75)\n```\n\nThere are more sample code at [CustomAnimationViewController.swift](https://github.com/shoheiyokoyama/Gemini/blob/master/Example/Gemini/ViewControllers/CustomAnimationViewController.swift).\n\n## \u003ca name=\"easing-function\"\u003e Easing function\n`Gemini` supports various easing functions based on distance of scroll.\n\n- linear\n- easeInQuad\n- easeOutQuad\n- easeInOutQuad\n- easeInCubic\n- easeOutCubic\n- easeInOutCubic\n- easeInQuart\n-  easeOutQuart\n- easeInOutQuart\n- easeInQuint\n- easeOutQuint\n- easeInOutQuint\n- easeInSine\n- easeOutSine\n- easeInOutSine\n- easeInExpo\n- easeOutExpo\n- easeInOutExpo\n- easeInCirc\n- easeOutCirc\n- easeInOutCirc\n\n## \u003ca name=\"shadow-effect\"\u003e Shadow effect\nDefault value is `ShadowEffect.none`. Return `shadowView` in your custom class, which is a subclass of `GeminiCell`.\n\n- fadeIn\n- nextFadeIn\n- previousFadeIn\n- fadeOut\n- none\n\n```swift\nclass CustomCollectionViewCell: GeminiCell {\n    @IBOutlet weak var customShadowView: UIView!\n    override var shadowView: UIView? {\n        return customShadowView\n    }\n}\n```\n\n# \u003ca name=\"usage\"\u003e Usage\n\n1. ***Use Gemini classes***\n\n`Gemini` is designed to be easy to use. Use `GeminiCollectionView` and `GeminiCell`. These classes is subclass of `UICollectionView`, `UICollectionViewCell`.\n\n2. ***Configure animation***\n\nConfigure animation with fluent interface based on method chaining. You can develop expressive code that enhances readability.\n\n3. ***Call function for animation***\n\nFinally, call `animateVisibleCells()` in `scrollViewDidScroll(_:)`\n\n\u003e NOTE: If you want to adapt animation immediately after view is displayed, call `animateCell(_:)` in `collectionView(_:cellForItemAt:)` and `collectionView(_:willDisplay:forItemAt:)`.\n\n\n```swift\n// Import Gemini\nimport Gemini\n\n// Inherite GeminiCell\nclass CustomCell: GeminiCell {\n    ...\n}\n\n// Conform to UICollectionViewDelegate and UICollectionViewDataSource\nclass CustomViewController: UIViewController: UICollectionViewDelegate, UICollectionViewDataSource {\n\n    // Inherite GeminiCollectionView\n    @IBOutlet weak var collectionView: GeminiCollectionView!\n\n    ...\n\n    // Configure animation and properties\n    func configureAnimation() {\n        collectionView.gemini\n            .circleRotationAnimation()\n            .radius(400)\n            .rotateDirection(.clockwise)\n    }\n\n    // Call animation function\n    func scrollViewDidScroll(_ scrollView: UIScrollView) {\n        collectionView.animateVisibleCells()\n    }\n\n    func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {\n        if let cell = cell as? GeminiCell {\n            self.collectionView.animateCell(cell)\n        }\n    }\n\n    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -\u003e UICollectionViewCell {\n        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: \"CustomCell\", for: indexPath) as! CustomCell\n        self.collectionView.animateCell(cell)\n        return cell\n    }\n```\n\nSee [Example](https://github.com/shoheiyokoyama/Gemini/tree/master/Example/Gemini), for more details.\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## \u003ca name=\"requirements\"\u003e Requirements\n\n- Xcode 10.2.1\n- Swift 5.0\n\n## \u003ca name=\"installation\"\u003e Installation\n\n### CocoaPods\n\nGemini is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"Gemini\"\n```\n\n### Carthage\n\nAdd the following line to your `Cartfile`:\n\n```ruby\ngithub \"shoheiyokoyama/Gemini\"\n```\n\n## \u003ca name=\"author\"\u003e Author\n\nShohei Yokoyama\n\n- [GitHub](https://github.com/shoheiyokoyama)\n- [Facebook](https://www.facebook.com/shohei.yokoyama.96)\n- [Twitter](https://twitter.com/shoheiyokoyam)\n- Gmail: shohei.yok0602@gmail.com\n\n## License\n\nGemini is available under the MIT license. See the [LICENSE file](https://github.com/shoheiyokoyama/Gemini/blob/master/LICENSE) for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshoheiyokoyama%2Fgemini","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshoheiyokoyama%2Fgemini","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshoheiyokoyama%2Fgemini/lists"}