Skip to content

Commit dabc4e0

Browse files
committed
first commit code
0 parents  commit dabc4e0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+9590
-0
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.idea
2+
aot
3+
node_modules
4+
/dist
5+
/build
6+
npm-debug.log
7+
*.map
8+
/docs/build
9+
.angular

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Awen <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

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

0 commit comments

Comments
 (0)