From 32be3aeceb8eab7081b0200b71f64f8f3176c7e3 Mon Sep 17 00:00:00 2001 From: Michael Verges Date: Sat, 1 Aug 2020 13:59:24 -0500 Subject: [PATCH] Update README.md --- README.md | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 136 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9e0a542..b1064b5 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,138 @@ # Shiny -A description of this package. + + +#### Add motion-based texture to your SwiftUI views + +Draw attention to important interface elements with `.shiny()`. Shiny uses your gyroscope to simulate lighting and motion affects on colors. It works on almost every native SwiftUI View. Try it on Text, Toggle, or a VStack. Just add `.shiny()` to get started! + +#### 💳 Inspired by the Apple Cash Card + +## Contents + +- [Add the Package](#package) +- [Examples](#examples) +- [Usage](#usage) +- [Gradients](#gradients) + - [`.rainbow`](#rainbow) + - [`.iridescent`](#iridescent) + - [`.matte`](#matte) + - [`.glossy`](#glossy) + - [`.hyperGlossy`](#hyper-glossy) + - [`Custom`](#custom) +- [More](#more) +- [Credits](#credits) + +## Package + +Add a dependency in your your `Package.swift` + +```swift +.package(url: "https://github.com/maustinstar/shiny.git", from: "0.0.1"), +``` + +## Examples + +#### Rainbow text on silver card + + + +```swift +Text("shiny") + .font(.largeTitle) + .fontWeight(.bold).shiny() + .background( + RoundedRectangle(cornerRadius: 14.0) + .frame(width: 200.0, height: 70.0) + .shiny(.hyperGlossy(UIColor.systemGray5))) +``` + +#### Glossy text on matte card + + + +```swift +Text("shiny") + .font(.largeTitle) + .fontWeight(.bold).shiny(.glossy(.black)) + .background( + RoundedRectangle(cornerRadius: 14.0) + .frame(width: 200.0, height: 70.0) + .shiny(.matte(.black)) +``` + +#### Iridescent text on glossy card + + + +```swift +Text("shiny") + .font(.largeTitle) + .fontWeight(.bold).shiny(.iridescent) + .background( + RoundedRectangle(cornerRadius: 14.0) + .frame(width: 200.0, height: 70.0) + .shiny(.glossy(.black)) +``` + +## Usage + +Just import Shiny and modify your view with `.shiny()` to get started. + +```swift +Text("Hello, shiny world! ✨").shiny() +``` + +## Gradients + +The `.shiny()` view modifier takes a gradient parameter to define the shiny surface. By default, `.shiny()` uses `Gradient.rainbow`. + +### Rainbow + +#### 🌈 `.shiny(.rainbow)` + +Cycles through the system colors in rainbow order. + +### Iridescent + +#### 💎 `.shiny(.iridescent)` + +Cycles through translucent blues and purples that add an extra sparkle to your views. + +### Matte + +#### 🟨 `.shiny(.matte(UIColor))` + +Generates a matte surface from a given color, modeling a dispersed light source. + +### Glossy + +#### 🔵 `.shiny(.glossy(UIColor))` + +Generates a matte surface from a given color, modeling a focused light source. + +### Hyper Glossy + +#### 🔦 `.shiny(.hyperGlossy(UIColor))` + +Generates a matte surface from a given color, modeling an intense light source. + +### Custom + +#### ⚙️ `.shiny(Gradient(...))` + +Write your own gradient for a shiny view. + +### More + +### 🚀 Looking for more fun SwiftUI Packages? + + + + + +## Credits + +* [**Michael Verges**](https://github.com/maustinstar) - *Initial work* - mverges3@gatech.edu + +