Skip to content

Commit 75b523d

Browse files
committed
update README.md
1 parent 2b5c50a commit 75b523d

File tree

12 files changed

+375
-81
lines changed

12 files changed

+375
-81
lines changed

README.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Go Captcha Angular Package
22

3+
<p> ⭐️ If it helps you, please give a star.</p>
4+
<img src="http://47.104.180.148/go-captcha/go-captcha-v2.jpg" alt="Poster">
5+
6+
<br/>
7+
8+
## Install
39
```shell
410
yarn add go-captcha-angular
511
# or
@@ -105,7 +111,7 @@ import GoCaptcha from 'go-captcha-angular';
105111
### Parameter Reference
106112
```ts
107113
// config = {}
108-
interface SlidConfig {
114+
interface SlideConfig {
109115
width?: number;
110116
height?: number;
111117
thumbWidth?: number;
@@ -117,7 +123,7 @@ interface SlidConfig {
117123
}
118124

119125
// data = {}
120-
interface SlidData {
126+
interface SlideData {
121127
thumbX: number;
122128
thumbY: number;
123129
thumbWidth: number;
@@ -127,16 +133,17 @@ interface SlidData {
127133
}
128134

129135
// events = {}
130-
interface SlidEvents {
136+
interface SlideEvents {
131137
move?: (x: number, y: number) => void;
132138
refresh?: () => void;
133139
close?: () => void;
134-
confirm?: (point: SlidPoint) => boolean;
140+
confirm?: (point: SlidePoint) => boolean;
135141
}
136142
```
143+
137144
```ts
138145
// config = {}
139-
interface SlidRegionConfig {
146+
interface SlideRegionConfig {
140147
width?: number;
141148
height?: number;
142149
thumbWidth?: number;
@@ -148,7 +155,7 @@ interface SlidRegionConfig {
148155
}
149156

150157
// data = {}
151-
interface SlidRegionData {
158+
interface SlideRegionData {
152159
thumbX: number;
153160
thumbY: number;
154161
thumbWidth: number;
@@ -158,11 +165,11 @@ interface SlidRegionData {
158165
}
159166

160167
// events = {}
161-
interface SlidRegionEvents {
168+
interface SlideRegionEvents {
162169
move?: (x: number, y: number) => void;
163170
refresh?: () => void;
164171
close?: () => void;
165-
confirm?: (point: SlidRegionPoint) => boolean;
172+
confirm?: (point: SlideRegionPoint) => boolean;
166173
}
167174
```
168175

@@ -231,4 +238,14 @@ export interface ButtonConfig {
231238
verticalPadding?: number;
232239
horizontalPadding?: number;
233240
}
234-
```
241+
```
242+
243+
<br/>
244+
245+
## 🍹 Buy me a coffee
246+
<div>
247+
<a href="http://witkeycode.com/sponsor" target="_blank"><img src="http://47.104.180.148/payment-code/wxpay.png" alt="Buy Me A Coffee" style="width: 217px !important;" ></a>
248+
<a href="http://witkeycode.com/sponsor" target="_blank"><img src="http://47.104.180.148/payment-code/alipay.png" alt="Buy Me A Coffee" style="width: 217px !important;" ></a>
249+
</div>
250+
251+
<br/>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "go-captcha-angular",
3-
"version": "v2.0.0",
3+
"version": "1.0.0",
44
"description": "This is the angular package for go-captcha",
55
"private": false,
66
"email": "wengaolng@gmail.com",

projects/go-captcha-angular/README.md

Lines changed: 251 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,251 @@
1-
# go-captcha-angular
1+
# Go Captcha Angular Package
2+
3+
<p> ⭐️ If it helps you, please give a star.</p>
4+
<img src="http://47.104.180.148/go-captcha/go-captcha-v2.jpg" alt="Poster">
5+
6+
<br/>
7+
8+
## Install
9+
```shell
10+
yarn add go-captcha-angular
11+
# or
12+
npm install go-captcha-angular
13+
# or
14+
pnpm install go-captcha-angular
15+
```
16+
17+
angular.json
18+
```json
19+
{
20+
// ....
21+
"projects": {
22+
"xxxx": {
23+
// ...
24+
"architect": {
25+
"build": {
26+
"options": {
27+
"styles": [
28+
"go-captcha-angular/css/go-captcha.css"
29+
]
30+
}
31+
}
32+
}
33+
}
34+
}
35+
}
36+
```
37+
38+
39+
app.module.ts
40+
```ts
41+
import { GoCaptchaModule } from 'go-captcha-angular';
42+
@NgModule({
43+
// ...
44+
imports: [
45+
GoCaptchaModule,
46+
],
47+
// ...
48+
})
49+
export class AppModule { }
50+
```
51+
52+
<br/>
53+
54+
## 🖖 Click Mode Captcha
55+
```angular2html
56+
import GoCaptcha from 'go-captcha-angular';
57+
58+
<GoCaptcha.Click
59+
[config]="{}"
60+
[data]="{}"
61+
[events]="{}"
62+
/>
63+
```
64+
65+
### Parameter Reference
66+
```ts
67+
// config = {}
68+
interface ClickConfig {
69+
width?: number;
70+
height?: number;
71+
thumbWidth?: number;
72+
thumbHeight?: number;
73+
verticalPadding?: number;
74+
horizontalPadding?: number;
75+
showTheme?: boolean;
76+
title?: string;
77+
buttonText?: string;
78+
}
79+
80+
// data = {}
81+
interface ClickData {
82+
image: string;
83+
thumb: string;
84+
}
85+
86+
// events = {}
87+
interface ClickEvents {
88+
click?: (x: number, y: number) => void;
89+
refresh?: () => void;
90+
close?: () => void;
91+
confirm?: (dots: Array<ClickDot>) => boolean;
92+
}
93+
```
94+
95+
## 🖖 Slide Mode Captcha
96+
```angular2html
97+
import GoCaptcha from 'go-captcha-angular';
98+
99+
<GoCaptcha.Slide
100+
[config]="{}"
101+
[data]="{}"
102+
[events]="{}"
103+
/>
104+
105+
<GoCaptcha.SlideRegion
106+
[config]="{}"
107+
[data]="{}"
108+
[events]="{}"
109+
/>
110+
```
111+
### Parameter Reference
112+
```ts
113+
// config = {}
114+
interface SlideConfig {
115+
width?: number;
116+
height?: number;
117+
thumbWidth?: number;
118+
thumbHeight?: number;
119+
verticalPadding?: number;
120+
horizontalPadding?: number;
121+
showTheme?: boolean;
122+
title?: string;
123+
}
124+
125+
// data = {}
126+
interface SlideData {
127+
thumbX: number;
128+
thumbY: number;
129+
thumbWidth: number;
130+
thumbHeight: number;
131+
image: string;
132+
thumb: string;
133+
}
134+
135+
// events = {}
136+
interface SlideEvents {
137+
move?: (x: number, y: number) => void;
138+
refresh?: () => void;
139+
close?: () => void;
140+
confirm?: (point: SlidePoint) => boolean;
141+
}
142+
```
143+
144+
```ts
145+
// config = {}
146+
interface SlideRegionConfig {
147+
width?: number;
148+
height?: number;
149+
thumbWidth?: number;
150+
thumbHeight?: number;
151+
verticalPadding?: number;
152+
horizontalPadding?: number;
153+
showTheme?: boolean;
154+
title?: string;
155+
}
156+
157+
// data = {}
158+
interface SlideRegionData {
159+
thumbX: number;
160+
thumbY: number;
161+
thumbWidth: number;
162+
thumbHeight: number;
163+
image: string;
164+
thumb: string;
165+
}
166+
167+
// events = {}
168+
interface SlideRegionEvents {
169+
move?: (x: number, y: number) => void;
170+
refresh?: () => void;
171+
close?: () => void;
172+
confirm?: (point: SlideRegionPoint) => boolean;
173+
}
174+
```
175+
176+
## 🖖 Rotate Mode Captcha
177+
```angular2html
178+
import GoCaptcha from 'go-captcha-angular';
179+
180+
<GoCaptcha.Rotate
181+
[config]="{}"
182+
[data]="{}"
183+
[events]="{}"
184+
/>
185+
```
186+
187+
### Parameter Reference
188+
```ts
189+
// config = {}
190+
interface RotateConfig {
191+
width?: number;
192+
height?: number;
193+
thumbWidth?: number;
194+
thumbHeight?: number;
195+
verticalPadding?: number;
196+
horizontalPadding?: number;
197+
showTheme?: boolean;
198+
title?: string;
199+
}
200+
201+
// data = {}
202+
interface RotateData {
203+
angle: number;
204+
image: string;
205+
thumb: string;
206+
}
207+
208+
// events = {}
209+
interface RotateEvents {
210+
rotate?: (angle: number) => void;
211+
refresh?: () => void;
212+
close?: () => void;
213+
confirm?: (angle: number) => boolean;
214+
}
215+
```
216+
217+
218+
## 🖖 Button
219+
```jsx
220+
import GoCaptcha from 'go-captcha-angular';
221+
222+
<GoCaptcha.Button />
223+
```
224+
225+
### Parameter Reference
226+
```ts
227+
interface _ {
228+
config?: ButtonConfig;
229+
clickEvent?: () => void;
230+
disabled?: boolean;
231+
type?: "default" | "warn" | "error" | "success";
232+
title?: string;
233+
}
234+
235+
export interface ButtonConfig {
236+
width?: number;
237+
height?: number;
238+
verticalPadding?: number;
239+
horizontalPadding?: number;
240+
}
241+
```
242+
243+
<br/>
244+
245+
## 🍹 Buy me a coffee
246+
<div>
247+
<a href="http://witkeycode.com/sponsor" target="_blank"><img src="http://47.104.180.148/payment-code/wxpay.png" alt="Buy Me A Coffee" style="width: 217px !important;" ></a>
248+
<a href="http://witkeycode.com/sponsor" target="_blank"><img src="http://47.104.180.148/payment-code/alipay.png" alt="Buy Me A Coffee" style="width: 217px !important;" ></a>
249+
</div>
250+
251+
<br/>

projects/go-captcha-angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "go-captcha-angular",
3-
"version": "2.0.0",
3+
"version": "1.0.0",
44
"license": "MIT",
55
"keywords": [
66
"go-captcha-angular",

projects/go-captcha-angular/src/lib/modules/button/button.component.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<div
2-
[class]="['go-captcha', 'gc-button-mode', 'gc-btn-block', 'gc-'+type, disabled ? 'gc-disabled' : '' ]"
3-
(click)="handleClick($event)"
4-
[style]="{
5-
'width': config.width + 'px',
6-
'height': config.height + 'px',
7-
'padding-left': config.verticalPadding + 'px',
8-
'padding-right': config.verticalPadding + 'px',
9-
'padding-top': config.verticalPadding + 'px',
10-
'padding-bottom': config.verticalPadding + 'px',
11-
}"
2+
[class]="['go-captcha', 'gc-button-mode', 'gc-btn-block', 'gc-'+type, disabled ? 'gc-disabled' : '' ]"
3+
(click)="handleClick($event)"
4+
[style]="{
5+
'width': config.width + 'px',
6+
'height': config.height + 'px',
7+
'padding-left': config.horizontalPadding + 'px',
8+
'padding-right': config.horizontalPadding + 'px',
9+
'padding-top': config.verticalPadding + 'px',
10+
'padding-bottom': config.verticalPadding + 'px',
11+
}"
1212
>
1313
<div [class]="{'gc-ripple': type === 'default'}" [ngSwitch]="type">
1414
<btn-default-icon *ngSwitchCase="'default'"></btn-default-icon>

0 commit comments

Comments
 (0)