All Projects → artemnovichkov → Zepcode

artemnovichkov / Zepcode

Licence: mit
⚗️ Zeplin extension that generates Swift snippets from colors, fonts, and layers

Programming Languages

javascript
184084 projects - #8 most used programming language
swift
15916 projects

Labels

Projects that are alternatives of or similar to Zepcode

Ublock
uBlock: a fast, lightweight, and lean blocker for Chrome, Firefox, and Safari.
Stars: ✭ 8,075 (+9628.92%)
Mutual labels:  extension
Survivio Plus
Easy chicken dinners, the hax way.
Stars: ✭ 72 (-13.25%)
Mutual labels:  extension
Rex Diagnostics
Unity extension that enables expression evaluation at runtime to facilitate testing and debugging.
Stars: ✭ 78 (-6.02%)
Mutual labels:  extension
File Extension List
Organised collection of common file extensions
Stars: ✭ 63 (-24.1%)
Mutual labels:  extension
Archiveweb.page
A High-Fidelity Web Archiving Extension for Chrome and Chromium based browsers!
Stars: ✭ 69 (-16.87%)
Mutual labels:  extension
Echofon Firefox Unofficial
Echofon Unofficial - maintained version of Echofon: full featured, super clean Twitter app for Firefox.
Stars: ✭ 73 (-12.05%)
Mutual labels:  extension
Ttkwidgets
A collection of widgets for Tkinter's ttk extensions by various authors
Stars: ✭ 57 (-31.33%)
Mutual labels:  extension
Obsidian Clipper
A Chrome extension that easily clips selections to Obsidian
Stars: ✭ 80 (-3.61%)
Mutual labels:  extension
Caddy V1 Service
⬛️ Run Caddy as a service
Stars: ✭ 69 (-16.87%)
Mutual labels:  extension
Podstation
podStation is a web podcast aggregator for Chrome.
Stars: ✭ 76 (-8.43%)
Mutual labels:  extension
Vscode Glua Enhanced
👨‍💻 Garry's Mod Lua VSCode Extension for enhanced auto completion, wiki integration, snippets, color palette, and much more...
Stars: ✭ 64 (-22.89%)
Mutual labels:  extension
Docker Php Extension Installer
Easily install PHP extension in Docker containers
Stars: ✭ 1,134 (+1266.27%)
Mutual labels:  extension
Uget Chrome Wrapper
Moved to https://github.com/ugetdm/uget-integrator and https://github.com/ugetdm/uget-extension
Stars: ✭ 74 (-10.84%)
Mutual labels:  extension
Pass For Macos
macOS wrapper for pass, the standard UNIX password manager
Stars: ✭ 62 (-25.3%)
Mutual labels:  extension
Chrome Extensions Examples
All Chrome Extension examples collected into one repository
Stars: ✭ 1,217 (+1366.27%)
Mutual labels:  extension
Calendarize
📆 Best TYPO3 Calendar ever 📆
Stars: ✭ 57 (-31.33%)
Mutual labels:  extension
Vscode Highlight
Advanced text highlighter based on regexes. Useful for todos, annotations etc.
Stars: ✭ 71 (-14.46%)
Mutual labels:  extension
Typo3scan
Scans TYPO3 extensions for usage of deprecated and or changed code
Stars: ✭ 83 (+0%)
Mutual labels:  extension
Wasavi
wasavi is an extension for Chrome, Firefox, and Opera. wasavi changes a textarea element to virtual vi editor which supports almost all the vi/ex commands.
Stars: ✭ 1,235 (+1387.95%)
Mutual labels:  extension
Vscode Vega Viewer
VSCode extension for Interactive Preview of Vega & Vega-Lite maps 🗺️ & graphs 📈
Stars: ✭ 75 (-9.64%)
Mutual labels:  extension

Zeplin Extension Build Status

Zeplin extension that 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)
    }
    
    Example with custom initializer
    import UIKit
    
    extension UIColor {
    
        convenience init(r red: Int, g green: Int, b blue: Int, a: CGFloat = 1) { // swiftlint:disable:this identifier_name
            self.init(red: CGFloat(red) / 255, 
                      green: CGFloat(green) / 255, 
                      blue: CGFloat(blue) / 255, 
                      alpha: a)
        }
    
        static let electricBlue = UIColor(r: 0, g: 86, b: 255)
    }
    
    Example with color literals
    import UIKit
    
    extension UIColor {
    
        static let electricBlue = #colorLiteral(red: 0, green: 0.337254902, blue: 1, 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(r: 0, g: 0, b: 0, a: 0.5).cgColor
    view.layer.shadowOpacity = 1
    view.layer.shadowOffset = CGSize(width: 0, height: 2)
    view.layer.shadowRadius = 4 / 2
    let rect = view.bounds.insetBy(dx: -2, dy: -2)
    view.layer.shadowPath = UIBezierPath(rect: rect).cgPath
    
  • 🎨 Gradients (Work in progress)

    Linear gradient example

    Check out LinearGradientPlayground and read explanation of the implementation here.

    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]
    
        var options: CGGradientDrawingOptions = CGGradientDrawingOptions(rawValue: 0)
    
        // MARK: - Lifecycle
    
        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).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: options)
            }
    }
    

Options

Use color names

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

Initializer style

  • Default — Use the default UIColor(red:green:blue:alpha:) initializer.
  • Custom — Use UIColor(r:g:b🅰️) initializer.
  • Literal — Use color literals #colorLiteral(red:green:blue:alpha:) that will appear in Xcode as a colored rect that presents a color picker.

Use layer extension for shadows

Use a function below for shadow parameters. Don't forget to add this extension to your project.

import UIKit

extension CALayer {

    func makeShadow(color: UIColor,
                    x: CGFloat = 0,
                    y: CGFloat = 0,
                    blur: CGFloat = 0,
                    spread: CGFloat = 0) {
        shadowColor = color.cgColor
        shadowOpacity = 1
        shadowOffset = CGSize(width: x, height: y)
        shadowRadius = blur / 2
        if spread == 0 {
            shadowPath = nil
        }
        else {
            let rect = bounds.insetBy(dx: -spread, dy: -spread)
            shadowPath = UIBezierPath(rect: rect).cgPath
        }
    }
}

How to Install

Zepcode is available on Zeplin Extensions.

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, to make a build or to execute some functions from extension follow this guide.

To learn more about zem, see documentation.

If you like to take full control of your build process you can try zero boilerplate.

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].