Giter Site home page Giter Site logo

itollmous / neumorphismui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tsuzukihashi/neumorphismui

0.0 1.0 0.0 330 KB

NeumorphismUI is a library that can be used with SwiftUI. Compatible with Swift Package Manager.

License: MIT License

Swift 100.00%

neumorphismui's Introduction

Github stars Github forks Swift Package Manager compatible License: MIT

NeumorphismUI_Logo

NeumorphismUI is a very useful library that allows you to easily use Neumorphism designs in SwiftUI.

DemoApp

DemoApp LightDemoApp Dark

Requirements

  • iOS 13.0+
  • Xcode 11+
  • Swift 5+

Installation

Swift Package Manager

Usage

Simple

let neumorphism = NeumorphismManager(
    isDark: false,
    lightColor: Color(hex: "C1D2EB"),
    darkColor: Color(hex: "2C292C")
)

let contentView = ContentView()
    .environmentObject(neumorphism)
import SwiftUI
import NeumorphismUI

struct SimpleView: View {
    @EnvironmentObject var neumorphism: NeumorphismManager

    var body: some View {
        ZStack {
            neumorphism.color.edgesIgnoringSafeArea(.all)
            Circle()
                .fill(neumorphism.color)
                .frame(width: 200, height: 200)
                .neumorphismShadow()
        }
    }
}

Simple View Light

let neumorphism = NeumorphismManager(
    isDark: true,
    lightColor: Color(hex: "C1D2EB"),
    darkColor: Color(hex: "2C292C")
)

let contentView = ContentView()
    .environmentObject(neumorphism)

Simple View Dark

NeumorphismConcave

Rectangle()
    .fill(neumorphism.color)
    .neumorphismConcave(shapeType: .rectangle, color: nil)
    .frame(width: 256, height: 100)

RoundedRectangle(cornerRadius: 16)
    .fill(neumorphism.color)
    .neumorphismConcave(shapeType: .roundedRectangle(cornerRadius: 16), color: nil)
    .frame(width: 256, height: 100)

Circle()
    .fill(neumorphism.color)
    .neumorphismConcave(shapeType: .circle, color: nil)
    .frame(width: 150, height: 150)

Ellipse()
    .fill(neumorphism.color)
    .neumorphismConcave(shapeType: .ellipse, color: nil)
    .frame(width: 300, height: 100)

Capsule(style: .circular)
    .fill(neumorphism.color)
    .neumorphismConcave(shapeType: .capsule, color: nil)
    .frame(width: 300, height: 100)

ConcaveViewList

NeumorphismButton

NeumorphismButton(
    shapeType: .roundedRectangle(cornerRadius: 20),
    normalImage: Image(systemName: "star"),
    selectedImage: Image(systemName: "star.fill")
)

Simple Use NeumorphismButton

NeumorphismSlider

Simple Usage!

struct NeumorphismSliderView: View {
    @EnvironmentObject var neumorphism: NeumorphismManager
    @State private var value: Double = 0
    
    var body: some View {
        ZStack {
            neumorphism.color.edgesIgnoringSafeArea(.all)
            VStack {
                Text("VALUE: \(value)")
                    .foregroundColor(self.neumorphism.fontColor())
                
                NeumorphismSlider(value: self.$value, changeHandler: {
                    // call change method
                }) {
                    // call ended method
                }
            }
        }
    }
}

NeumorphismSlider

neumorphismui's People

Contributors

tsuzukihashi avatar nappannda avatar

Watchers

James Cloos 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.