qr-scanner-app 0.0.0 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "qr-scanner-app",
3
- "version": "0.0.0",
3
+ "version": "0.0.1",
4
4
  "scripts": {
5
5
  "ng": "ng",
6
6
  "start": "ng serve",
7
7
  "build": "ng build",
8
+ "build:lib": "ng build ngx-custom-qr-scanner",
9
+ "pack:lib": "cd dist/ngx-custom-qr-scanner && npm pack",
10
+ "publish:lib": "cd dist/ngx-custom-qr-scanner && npm publish",
8
11
  "watch": "ng build --watch --configuration development",
9
12
  "test": "ng test"
10
13
  },
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dheeraj Prajapati
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.
@@ -1,63 +1,159 @@
1
- # NgxCustomQrScanner
1
+ # ngx-custom-qr-scanner
2
2
 
3
- This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.0.
3
+ A modern, feature-rich Angular QR code scanner library with an elegant UI, zoom controls, and torch/flash support. Built as a standalone component for Angular 19+.
4
4
 
5
- ## Code scaffolding
5
+ ## Features
6
6
 
7
- Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
7
+ - 🎯 **Standalone Component** - Easy integration with Angular 19+
8
+ - 📱 **Responsive Design** - Works on desktop and mobile devices
9
+ - 🔦 **Torch/Flash Support** - Toggle flash for scanning in low light
10
+ - 🔍 **Zoom Controls** - Adjustable zoom with vertical slider
11
+ - 🎨 **Premium UI** - Modern interface with red sidebars and scan animations
12
+ - 🔄 **Inverted QR Support** - Scans both normal and inverted (white on black) QR codes
13
+ - 📸 **Auto-start** - Begins scanning immediately on component load
14
+ - 🎯 **Environment Camera** - Defaults to back camera on mobile devices
15
+
16
+ ## 📦 Installation
8
17
 
9
18
  ```bash
10
- ng generate component component-name
19
+ npm install ngx-custom-qr-scanner qr-scanner
11
20
  ```
12
21
 
13
- For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
22
+ > **Note:** `qr-scanner` is a peer dependency and must be installed separately.
14
23
 
15
- ```bash
16
- ng generate --help
24
+ ## 🚀 Quick Start
25
+
26
+ ### 1. Import the Component
27
+
28
+ Since this is a standalone component, you can import it directly into your component or module:
29
+
30
+ ```typescript
31
+ import { Component } from '@angular/core';
32
+ import { NgxCustomQrScannerComponent } from 'ngx-custom-qr-scanner';
33
+
34
+ @Component({
35
+ selector: 'app-root',
36
+ standalone: true,
37
+ imports: [NgxCustomQrScannerComponent],
38
+ template: `<ngx-custom-qr-scanner></ngx-custom-qr-scanner>`
39
+ })
40
+ export class AppComponent { }
17
41
  ```
18
42
 
19
- ## Building
43
+ ### 2. Use in Your Template
20
44
 
21
- To build the library, run:
45
+ ```html
46
+ <ngx-custom-qr-scanner></ngx-custom-qr-scanner>
47
+ ```
22
48
 
23
- ```bash
24
- ng build ngx-custom-qr-scanner
49
+ That's it! The scanner will automatically start when the component loads.
50
+
51
+ ## 🎛️ Usage
52
+
53
+ ### Basic Implementation
54
+
55
+ ```typescript
56
+ import { Component } from '@angular/core';
57
+ import { NgxCustomQrScannerComponent } from 'ngx-custom-qr-scanner';
58
+
59
+ @Component({
60
+ selector: 'app-scanner-page',
61
+ standalone: true,
62
+ imports: [NgxCustomQrScannerComponent],
63
+ template: `
64
+ <div class="scanner-wrapper">
65
+ <ngx-custom-qr-scanner></ngx-custom-qr-scanner>
66
+ </div>
67
+ `,
68
+ styles: [`
69
+ .scanner-wrapper {
70
+ width: 100vw;
71
+ height: 100vh;
72
+ }
73
+ `]
74
+ })
75
+ export class ScannerPageComponent { }
76
+ ```
77
+
78
+ ### In a Non-Standalone Module
79
+
80
+ ```typescript
81
+ import { NgModule } from '@angular/core';
82
+ import { BrowserModule } from '@angular/platform-browser';
83
+ import { NgxCustomQrScannerComponent } from 'ngx-custom-qr-scanner';
84
+ import { AppComponent } from './app.component';
85
+
86
+ @NgModule({
87
+ declarations: [AppComponent],
88
+ imports: [
89
+ BrowserModule,
90
+ NgxCustomQrScannerComponent // Import the standalone component
91
+ ],
92
+ bootstrap: [AppComponent]
93
+ })
94
+ export class AppModule { }
25
95
  ```
26
96
 
27
- This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
97
+ ## 🎨 UI Components
28
98
 
29
- ### Publishing the Library
99
+ The scanner includes:
30
100
 
31
- Once the project is built, you can publish your library by following these steps:
101
+ - **Left Sidebar**: Displays "Tyre QR Code" text vertically with a thumbnail placeholder
102
+ - **Center Area**: Live camera feed with scan region overlay and animated scan line
103
+ - **Right Sidebar**:
104
+ - Torch/Flash toggle button
105
+ - Vertical zoom slider with real-time zoom value display
32
106
 
33
- 1. Navigate to the `dist` directory:
34
- ```bash
35
- cd dist/ngx-custom-qr-scanner
36
- ```
107
+ ## 📱 Browser Compatibility
37
108
 
38
- 2. Run the `npm publish` command to publish your library to the npm registry:
39
- ```bash
40
- npm publish
41
- ```
109
+ - Chrome/Edge 87+
110
+ - Firefox 88+
111
+ - Safari 14.1+
112
+ - Mobile browsers with camera access
42
113
 
43
- ## Running unit tests
114
+ > **Note:** Requires HTTPS in production for camera access.
44
115
 
45
- To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
116
+ ## 🔧 API Reference
46
117
 
47
- ```bash
48
- ng test
118
+ ### Component Selector
119
+
120
+ ```typescript
121
+ selector: 'ngx-custom-qr-scanner'
49
122
  ```
50
123
 
51
- ## Running end-to-end tests
124
+ ### Public Properties
52
125
 
53
- For end-to-end (e2e) testing, run:
126
+ The component currently handles QR scanning internally and displays results via alert. Future versions will include output events for custom handling.
54
127
 
55
- ```bash
56
- ng e2e
57
- ```
128
+ ## 🤝 Contributing
129
+
130
+ Contributions are welcome! Please feel free to submit a Pull Request.
131
+
132
+ 1. Fork the repository
133
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
134
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
135
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
136
+ 5. Open a Pull Request
137
+
138
+ ## 📄 License
139
+
140
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
141
+
142
+ ## 👨‍💻 Author
143
+
144
+ **Dheeraj Prajapati**
145
+ - Email: dheerajprajapati9898@gmail.com
146
+ - GitHub: [@dheerajprajapati9898](https://github.com/dheerajprajapati9898)
147
+
148
+ ## 🐛 Issues
149
+
150
+ Found a bug? Please [open an issue](https://github.com/dheerajprajapati9898/ngx-custom-qr-scanner/issues) with a detailed description.
151
+
152
+ ## 🙏 Acknowledgments
58
153
 
59
- Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
154
+ - Built with [qr-scanner](https://github.com/nimiq/qr-scanner) library
155
+ - Designed for Angular 19+
60
156
 
61
- ## Additional Resources
157
+ ---
62
158
 
63
- For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
159
+ **Happy Scanning! 📱✨**
@@ -10,11 +10,15 @@
10
10
  ],
11
11
  "private": false,
12
12
  "license": "MIT",
13
+ "homepage": "https://github.com/dheerajprajapati9898/ngx-custom-qr-scanner#readme",
13
14
  "repository": {
14
15
  "type": "git",
15
- "url": "https://github.com/username/repo"
16
+ "url": "git+https://github.com/dheerajprajapati9898/ngx-custom-qr-scanner.git"
16
17
  },
17
- "author": "Your Name",
18
+ "bugs": {
19
+ "url": "https://github.com/dheerajprajapati9898/ngx-custom-qr-scanner/issues"
20
+ },
21
+ "author": "Dheeraj Prajapati <dheerajprajapati9898@gmail.com>",
18
22
  "peerDependencies": {
19
23
  "@angular/common": "^19.2.0",
20
24
  "@angular/core": "^19.2.0",
package/src.zip ADDED
Binary file