Giter VIP home page Giter VIP logo

zepcode's Introduction

Built with Zero

Zeplin Extension

Generates Swift snippets from colors, fonts and layers.

Features

  • ๐Ÿ– Color pallette for iOS

    Example
    import UIKit
    
    extension UIColor {
    
        static let electricBlue = UIColor(red: 0/255, green: 86/255, blue: 255/255, alpha: 1)
    }
  • โœ๏ธ Fonts for iOS

    Example
    import UIKit
    
    extension UIFont {
    
        static func BloggerSansBold(ofSize: CGFloat) -> UIFont {
            return UIFont(name: "BloggerSans-Bold", size: size)!
        }
    }
  • ๐Ÿšง Snippets for borders and corner radius

    Example
    view.layer.borderWidth = 4
    view.layer.borderColor = UIColor.white.cgColor
    view.layer.cornerRadius = 40
  • ๐ŸŒš Snippets for shadows

    Example
    view.layer.shadowColor = UIColor.black8.cgColor
    view.layer.shadowOffset = CGSize(width: 0, height: 4)
    view.layer.shadowRadius = 8
  • ๐ŸŽจ Gradients (Work in progress)

    Linear gradient example
    let gradientLayer = CAGradientLayer()
    gradientLayer.frame = view.bounds
    gradientLayer.startPoint = CGPoint(x: 0.0, y: 0.5)
    gradientLayer.endPoint = CGPoint(x: 1.0, y: 0.5)
    gradientLayer.colors = [UIColor.lightishRed.cgColor, UIColor.barbiePink.cgColor]
    gradientLayer.locations = [0, 1]
    view.layer.insertSublayer(gradientLayer, at: 0)
    Radial gradient example
    final class RadialGradientView: UIView {
    
        private var radius: CGFloat {
            return min(bounds.width / 2, bounds.height / 2)
        }
    
        private let colors = [UIColor.red.cgColor, UIColor.neonGreen.cgColor]
    
        override init(frame: CGRect) {
            super.init(frame: frame)
            clipsToBounds = true
        }
    
        required init?(coder aDecoder: NSCoder) {
            fatalError("init(coder:) has not been implemented")
        }
    
        override func layoutSubviews() {
            super.layoutSubviews()
            layer.cornerRadius = radius
        }
    
        override func draw(_ rect: CGRect) {
            let context = UIGraphicsGetCurrentContext()
    
            let colorSpace = CGColorSpaceCreateDeviceRGB()
            let colorsCount = colors.count
            var locations = (0...colorsCount - 1).map { i in
                return CGFloat(i) / CGFloat(colorsCount)
            }
    
            guard let gradient = CGGradient(colorsSpace: colorSpace, colors: colors as CFArray, locations: locations) else {
                return
            }
    
            context?.drawRadialGradient(gradient,
                                       startCenter: center,
                                       startRadius: 0,
                                       endCenter: center,
                                       endRadius: radius,
                                       options: CGGradientDrawingOptions(rawValue: 0))
            }
    }

Options

Use color names

Use color names from Color Palette or default UIColor(red:green:blue:alpha:) initializers.

How to Install

Download and unzip the latest release. Follow the instruction from official tutorial.

How to make a changes

First, you need last stable Node.js ^8.9.4. Follow this guide if you don't have any.

Next, install project dependencies:

npm i

To start developing run:

npm start

And finally, to make a production ready build run:

npm run build

Authors

Artem Novichkov, [email protected] Get help on Codementor

Baybara Pavel, [email protected]

License

Zepcode is available under the MIT license. See the LICENSE file for more info.

zepcode's People

Contributors

artemnovichkov avatar baybara-pavel avatar ignatovsa 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.