Giter Club home page Giter Club logo

shieldsui's Introduction

Shields

Codacy Badge standard-readme compliant standard-readme compliant standard-readme compliant standard-readme compliant

Introduction

Customize the personalized badge effect with simple configuration.

build status service-test status coverage Total alerts chat on Discord

Use

1. Config Label text and Message text -- Default / Logo

Objective-C

Shields *shields = [[Shields alloc] initWithFrame:CGRectMake(0, 0, 320, 40) style:ShieldsDefault];
[shields configLabel:@"CreaterOS" message:@"v1.0"];
shields.center = self.view.center;
[self.view addSubview:shields];

Swift

let shields = Shields(frame: CGRect(x: 0, y: 0, width: 320, height: 40), style: .ShieldsDefault)
shields.cornerRadius = 20
shields.configLabel(label: "CreaterOS", message: "v1.0")
shields.center = self.view.center
view.addSubview(shields)

2. Config Label Font Color -- Default / Logo

Objective-C

Shields *shields = [[Shields alloc] initWithFrame:CGRectMake(0, 0, 320, 40) style:ShieldsDefault];
[shields configLabel:@"CreaterOS" message:@"v1.0" labelColor:[UIColor colorWithRed: 86/255.0 green: 88/255.0 blue: 224/255.0 alpha:1.000]];
shields.center = self.view.center;
[self.view addSubview:shields];

Swift

let shields = Shields(frame: CGRect(x: 0, y: 0, width: 320, height: 40), style: .ShieldsDefault)
shields.cornerRadius = 20
shields.configLabel(label: "CreaterOS", message: "v1.0", labelColor: UIColor(red: 86/255.0, green: 88/255.0, blue: 224/255.0, alpha: 1.0))
shields.center = self.view.center
view.addSubview(shields)

3. Config Message Font Color -- Default / Logo

Objective-C

Shields *shields = [[Shields alloc] initWithFrame:CGRectMake(0, 0, 320, 40) style:ShieldsDefault];
[shields configLabel:@"CreaterOS" message:@"v1.0" messageColor:[UIColor colorWithRed: 86/255.0 green: 88/255.0 blue: 224/255.0 alpha:1.000]];
shields.center = self.view.center;
[self.view addSubview:shields];

Swift

let shields = Shields(frame: CGRect(x: 0, y: 0, width: 320, height: 40), style: .ShieldsDefault)
shields.cornerRadius = 20
shields.configLabel(label: "CreaterOS", message: "v1.0", messageColor: UIColor(red: 86/255.0, green: 88/255.0, blue: 224/255.0, alpha: 1.0))
shields.center = self.view.center
view.addSubview(shields)

4.Config Label Background Color -- Default / Logo

Objective-C

Shields *shields = [[Shields alloc] initWithFrame:CGRectMake(0, 0, 320, 40) style:ShieldsDefault];
[shields configLabel:@"CreaterOS" message:@"v1.0" labelBackgroundColor:[UIColor colorWithRed: 241/255.0 green: 176/255.0 blue: 101/255.0 alpha:1.000]];
shields.center = self.view.center;
[self.view addSubview:shields];

Swift

let shields = Shields(frame: CGRect(x: 0, y: 0, width: 320, height: 40), style: .ShieldsDefault)
shields.cornerRadius = 20
shields.configLabel(label: "CreaterOS", message: "v1.0", labelBackgroundColor: UIColor(red: 241/255.0, green: 176/255.0, blue: 101/255.0, alpha: 1.0))
shields.center = self.view.center
view.addSubview(shields)

5.Config Message Background Color -- Default / Logo

Objective-C

Shields *shields = [[Shields alloc] initWithFrame:CGRectMake(0, 0, 320, 40) style:ShieldsDefault];
[shields configLabel:@"CreaterOS" message:@"v1.0" messageBackgroundColor:[UIColor colorWithRed: 241/255.0 green: 176/255.0 blue: 101/255.0 alpha:1.000]];
shields.center = self.view.center;
[self.view addSubview:shields];

Swift

let shields = Shields(frame: CGRect(x: 0, y: 0, width: 320, height: 40), style: .ShieldsDefault)
shields.cornerRadius = 20
shields.configLabel(label: "CreaterOS", message: "v1.0", messageBackgroundColor: UIColor(red: 241/255.0, green: 176/255.0, blue: 101/255.0, alpha: 1.0))
shields.center = self.view.center
view.addSubview(shields)

6.Config Label And Message Background Color -- Default / Logo

Objective-C

Shields *shields = [[Shields alloc] initWithFrame:CGRectMake(0, 0, 320, 40) style:ShieldsDefault];
[shields configLabel:@"CreaterOS" message:@"v1.0" labelBackgroundColor:[UIColor colorWithRed: 241/255.0 green: 176/255.0 blue: 101/255.0 alpha:1.000] messageBackgroundColor:[UIColor colorWithRed: 86/255.0 green: 88/255.0 blue: 224/255.0 alpha:1.000]];
shields.center = self.view.center;
[self.view addSubview:shields];

Swift

let shields = Shields(frame: CGRect(x: 0, y: 0, width: 320, height: 40), style: .ShieldsDefault)
shields.cornerRadius = 20
shields.configLabel(label: "CreaterOS", message: "v1.0", labelBackgroundColor: UIColor(red: 241/255.0, green: 176/255.0, blue: 101/255.0, alpha: 1.0), messageBackgroundColor: UIColor(red: 88/255.0, green: 88/255.0, blue: 101/255.0, alpha: 1.0))
shields.center = self.view.center
view.addSubview(shields)

7.Config Label And Message -- Default / Logo

Objective-C

Shields *shields = [[Shields alloc] initWithFrame:CGRectMake(0, 0, 320, 40) style:ShieldsDefault];
[shields configLabel:@"CreaterOS" message:@"v1.0" labelBackgroundColor:[UIColor colorWithRed: 86/255.0 green: 88/255.0 blue: 224/255.0 alpha:1.000] messageBackgroundColor:[UIColor colorWithRed: 241/255.0 green: 176/255.0 blue: 101/255.0 alpha:1.000] labelColor:UIColor.whiteColor messageColor:UIColor.whiteColor];
shields.center = self.view.center;
[self.view addSubview:shields];

Swift

let shields = Shields(frame: CGRect(x: 0, y: 0, width: 320, height: 40), style: .ShieldsDefault)
shields.cornerRadius = 20
shields.configLabel(label: "CreaterOS", message: "v1.0", labelBackgroundColor: UIColor(red: 241/255.0, green: 176/255.0, blue: 101/255.0, alpha: 1.0), messageBackgroundColor: UIColor(red: 88/255.0, green: 88/255.0, blue: 101/255.0, alpha: 1.0), labelColor: .white, messageColor: .white)
shields.center = self.view.center
view.addSubview(shields)

8. Config Logo

Objective-C

Shields *shields = [[Shields alloc] initWithFrame:CGRectMake(0, 0, 320, 40) style:ShieldsLogo];
[shields configLabel:@"CreaterOS" message:@"v1.0" labelBackgroundColor:[UIColor colorWithRed: 241/255.0 green: 176/255.0 blue: 101/255.0 alpha:1.000] messageBackgroundColor:[UIColor colorWithRed: 193/255.0 green: 241/255.0 blue: 172/255.0 alpha:1.000] labelColor:[UIColor colorWithRed: 242/255.0 green: 242/255.0 blue: 246/255.0 alpha:1.000] messageColor:[UIColor colorWithRed: 242/255.0 green: 242/255.0 blue: 246/255.0 alpha:1.000] logo:[UIImage imageNamed:@"lanmei"] logoWidth:15 logoPosition:CGPointMake(10, 10)];
shields.center = self.view.center;
[self.view addSubview:shields];

Swift

let shields = Shields(frame: CGRect(x: 0, y: 0, width: 320, height: 40), style: .ShieldsLogo)
shields.cornerRadius = 20
shields.configLabel(label: "CreaterOS", message: "v1.0", labelBackgroundColor: UIColor(red: 241/255.0, green: 176/255.0, blue: 101/255.0, alpha: 1.0), messageBackgroundColor: UIColor(red: 88/255.0, green: 88/255.0, blue: 101/255.0, alpha: 1.0), labelColor: .white, messageColor: .white, logo: UIImage(named: "lanmei"), logoWidth: 25.0, logoPosition: CGPoint(x: 15, y: 15))
shields.center = self.view.center
view.addSubview(shields)

9. Json Config

{
	"schemaVersion":1,
	"label":"CreaterOS",
	"message":"v1.0",
	"labelBackgroundColor":{
		"hex":"#8174D9",
		"alpha":0.7
	},
	"messageBackgroundColor":{
		"hex":"#81EBD9",
		"alpha":0.7
	},
	"labelColor":{
		"hex":"#B82B1D",
		"alpha":1
	},
	"messageColor":{
		"hex":"#FFFFFF",
		"alpha":1
	},
	"logoName":"lanmei",
	"logoWidth":25,
	"logoPosition":{
		"X":17,
		"Y":20
	}
}

Objective-C

Shields *shields = [[Shields alloc] initWithFrame:CGRectMake(0, 0, 320, 40) style:ShieldsLogo];
[shields configWithJsonFilePath:[[NSBundle mainBundle] pathForResource:@"shields" ofType:@"json"]];
shields.center = self.view.center;
[self.view addSubview:shields];

Swift

let shields = Shields(frame: CGRect(x: 0, y: 0, width: 320, height: 40), style: .ShieldsLogo)
shields.cornerRadius = 20
shields.configWithJsonFilePath(jsonPath: Bundle.main.path(forResource: "shields", ofType: "json")!)
shields.center = self.view.center
view.addSubview(shields)

MIT License

MIT License

Stargazers

Stargazers repo roster for @CreaterOS/shields

Forkers

Forkers repo roster for @CreaterOS/shields

Contribute to this project

If you have a feature request or bug report, please feel free to send [email protected] to upload the problem, and we will provide you with revisions and help as soon as possible. Thank you very much for your support.

Security Disclosure

If you have found the Shields security vulnerabilities and vulnerabilities that need to be modified, you should email them to [email protected] as soon as possible. thank you for your support.

shieldsui's People

Contributors

createros avatar deepsourcebot avatar

Stargazers

 avatar

Watchers

 avatar  avatar  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.