Skip to content

Commit ee3c169

Browse files
fix: exact installation in docs, buttons-container class, and white-space for VideoCapture (#185)
* fix: add installing exact dbr bundle version to docs * removed css on readme for nuxt * fix whitespace styling * fix: remove personal trial license --------- Co-authored-by: felixindrawan <[email protected]>
1 parent dbdb958 commit ee3c169

File tree

20 files changed

+49
-186
lines changed

20 files changed

+49
-186
lines changed

hello-world/angular/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Below is the configuration used for this sample.
5757

5858
```cmd
5959
cd my-app
60-
npm install dynamsoft-barcode-reader-bundle
60+
npm install dynamsoft-barcode-reader-bundle -E
6161
```
6262

6363
## Start to implement
@@ -348,7 +348,7 @@ export class ImageCaptureComponent {
348348
<div class='title'>
349349
<h2 class='title-text'>Hello World for Angular</h2>
350350
</div>
351-
<div class='top-btns'>
351+
<div class='buttons-container'>
352352
<button (click)="switchMode('video')" [ngStyle]="{'background-color': mode === 'video' ? 'rgb(255,174,55)' : 'white'}">Decode Video</button>
353353
<button (click)="switchMode('image')" [ngStyle]="{'background-color': mode === 'image' ? 'rgb(255,174,55)' : 'white'}">Decode Image</button>
354354
</div>

hello-world/angular/src/app/app.component.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,30 @@
44
align-items: center;
55
margin-top: 20px;
66
}
7-
.top-btns {
7+
.buttons-container {
88
width: 30%;
99
margin: 20px auto;
1010
}
11-
.top-btns button {
11+
.buttons-container button {
1212
display: inline-block;
1313
border: 1px solid black;
1414
padding: 5px 15px;
1515
background-color: transparent;
1616
cursor: pointer;
1717
}
18-
.top-btns button:first-child {
18+
.buttons-container button:first-child {
1919
border-top-left-radius: 10px;
2020
border-bottom-left-radius: 10px;
2121
border-right: transparent;
2222
}
23-
.top-btns button:nth-child(2) {
23+
.buttons-container button:nth-child(2) {
2424
border-top-right-radius: 10px;
2525
border-bottom-right-radius: 10px;
2626
border-left: transparent;
2727
}
2828

2929
@media screen and (max-width: 800px) {
30-
.top-btns {
30+
.buttons-container {
3131
width: 70%;
3232
}
3333
}

hello-world/angular/src/app/app.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class='title'>
33
<h2 class='title-text'>Hello World for Angular</h2>
44
</div>
5-
<div class='top-btns'>
5+
<div class='buttons-container'>
66
<button (click)="switchMode('video')" [ngStyle]="{'background-color': mode === 'video' ? 'rgb(255,174,55)' : 'white'}">Decode Video</button>
77
<button (click)="switchMode('image')" [ngStyle]="{'background-color': mode === 'image' ? 'rgb(255,174,55)' : 'white'}">Decode Image</button>
88
</div>

hello-world/angular/src/app/video-capture/video-capture.component.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
width: 100%;
88
height: 10vh;
99
overflow: auto;
10+
white-space: pre-wrap;
1011
}

hello-world/es6.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<h1>Hello World for ES6 (Decode via Camera)</h1>
1414
<div id="camera-view-container" style="width: 100%; height: 80vh"></div>
1515
Results:<br />
16-
<div id="results" style="width: 100%; height: 10vh; overflow: auto"></div>
16+
<div id="results" style="width: 100%; height: 10vh; overflow: auto; white-space: pre-wrap"></div>
1717
<script type="module">
1818
import {
1919
CoreModule,

hello-world/hello-world.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<h1>Hello World (Decode via Camera)</h1>
1414
<div id="camera-view-container" style="width: 100%; height: 80vh"></div>
1515
Results:<br />
16-
<div id="results" style="width: 100%; height: 10vh; overflow: auto"></div>
16+
<div id="results" style="width: 100%; height: 10vh; overflow: auto; white-space: pre-wrap"></div>
1717
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/dbr.bundle.js"></script>
1818
<script>
1919
/** LICENSE ALERT - README

hello-world/next/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Below is the configuration used for this sample.
5959

6060
```cmd
6161
cd my-app
62-
npm install dynamsoft-barcode-reader-bundle
62+
npm install dynamsoft-barcode-reader-bundle -E
6363
```
6464

6565
## Start to implement
@@ -421,3 +421,7 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next
421421
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
422422

423423
Check out [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
424+
425+
## Support
426+
427+
If you have any questions, feel free to [contact Dynamsoft Support](https://www.dynamsoft.com/company/contact?utm_source=sampleReadme).

hello-world/next/components/VideoCapture/VideoCapture.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
width: 100%;
99
height: 10vh;
1010
overflow: auto;
11+
white-space: pre-wrap;
1112
}

hello-world/nuxt/README.md

Lines changed: 5 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ You will be asked to configure quite a few things for the application during the
4747

4848
```cmd
4949
cd my-app
50-
npm install dynamsoft-barcode-reader-bundle
50+
npm install dynamsoft-barcode-reader-bundle -E
5151
```
5252

5353
## Start to implement
@@ -102,7 +102,7 @@ CoreModule.loadWasm(["DBR"]);
102102

103103
### Edit the `VideoCapture` component
104104

105-
* In `VideoCapture.client.vue`, add code for initializing and destroying some instances. The `VideoCapture` component helps decode barcodes via camera.
105+
* In `VideoCapture.client.vue`, add code for initializing and destroying some instances. The `VideoCapture` component helps decode barcodes via camera. For our stylesheet (CSS) specification, please refer to our [source code](#Official-Sample).
106106

107107
```vue
108108
<!-- /components/VideoCapture.client.vue -->
@@ -196,37 +196,14 @@ onBeforeUnmount(async () => {
196196
} catch (_) { }
197197
});
198198
</script>
199-
200-
<template>
201-
<div>
202-
<div ref="cameraViewContainer" class="camera-view-container"></div>
203-
<br />
204-
Results:
205-
<div ref="resultsContainer" class="results"></div>
206-
</div>
207-
</template>
208-
209-
<style scoped>
210-
.camera-view-container {
211-
width: 100%;
212-
height: 70vh;
213-
background: #eee;
214-
}
215-
216-
.results {
217-
width: 100%;
218-
height: 10vh;
219-
overflow: auto;
220-
}
221-
</style>
222199
```
223200
> Note:
224201
>
225202
> If you're looking to customize the UI, the UI customization feature are provided by the auxiliary SDK "Dynamsoft Camera Enhancer". For more details, refer to our [User Guide](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/index.html#customize-the-ui)
226203
227204
### Edit the `ImageCapture` component
228205

229-
* In `ImageCapture.client.vue`, add code for initializing and destroying the `CaptureVisionRouter` instance. The `ImageCapture` helps decode barcodes in an image.
206+
* In `ImageCapture.client.vue`, add code for initializing and destroying the `CaptureVisionRouter` instance. The `ImageCapture` helps decode barcodes in an image. For our stylesheet (CSS) specification, please refer to our [source code](#Official-Sample).
230207

231208
```vue
232209
<!-- /components/ImageCapture.client.vue -->
@@ -296,35 +273,13 @@ onBeforeUnmount(async () => {
296273
<div class="results" ref="resultContainer"></div>
297274
</div>
298275
</template>
299-
300-
<style scoped>
301-
.image-capture-container {
302-
width: 100%;
303-
height: 100%;
304-
font-family: Consolas, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace;
305-
}
306-
307-
.image-capture-container .input-container {
308-
width: 80%;
309-
height: 100%;
310-
display: flex;
311-
justify-content: center;
312-
border: 1px solid black;
313-
margin: 0 auto;
314-
}
315-
316-
.image-capture-container .results {
317-
margin-top: 20px;
318-
height: 100%;
319-
}
320-
</style>
321276
```
322277

323278
### Add `VideoCapture` and `ImageCapture` components in `app.vue`
324279

325280
* On `/app.vue`, we will edit the component so that it offers buttons to switch components between `VideoCapture` and `ImageCapture`.
326281

327-
* Add following code to `app.vue`.
282+
* Add following code to `app.vue`. For our stylesheet (CSS) specification, please refer to our [source code](#Official-Sample).
328283

329284
```vue
330285
<!-- /app.vue -->
@@ -333,7 +288,7 @@ onBeforeUnmount(async () => {
333288
<div class='title'>
334289
<h2 class='title-text'>Hello World for NuxtJS</h2>
335290
</div>
336-
<div class='top-btns'>
291+
<div class='buttons-container'>
337292
<button @click="mode = 'video'"
338293
:style="{ backgroundColor: mode === 'video' ? 'rgb(255, 174, 55)' : '#FFFFFF' }">Video Capture</button>
339294
<button @click="mode = 'image'"
@@ -355,34 +310,6 @@ import ImageCapture from "./components/ImageCapture.client.vue";
355310
356311
const mode: Ref<string> = ref("video");
357312
</script>
358-
359-
<style scoped>
360-
.title {
361-
display: flex;
362-
justify-content: center;
363-
align-items: center;
364-
margin-top: 20px;
365-
}
366-
367-
.top-btns {
368-
width: 30%;
369-
margin: 20px auto;
370-
}
371-
372-
.top-btns button {
373-
display: inline-block;
374-
border: 1px solid black;
375-
padding: 5px 15px;
376-
background-color: transparent;
377-
cursor: pointer;
378-
}
379-
380-
@media screen and (max-width: 800px) {
381-
.top-btns {
382-
width: 70%;
383-
}
384-
}
385-
</style>
386313
```
387314
> Note:
388315
>

hello-world/nuxt/app.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<h2 class='title-text'>Hello World for NuxtJS</h2>
55
<img class='title-logo' src="./assets/logo.svg" alt="logo" />
66
</div>
7-
<div class='top-btns'>
7+
<div class='buttons-container'>
88
<button @click="mode = 'video'"
99
:style="{ backgroundColor: mode === 'video' ? 'rgb(255, 174, 55)' : '#FFFFFF' }">Video Capture</button>
1010
<button @click="mode = 'image'"
@@ -41,33 +41,33 @@ const mode: Ref<string> = ref("video");
4141
margin-left: 10px;
4242
}
4343
44-
.top-btns {
44+
.buttons-container {
4545
width: 30%;
4646
margin: 20px auto;
4747
}
4848
49-
.top-btns button {
49+
.buttons-container button {
5050
display: inline-block;
5151
border: 1px solid black;
5252
padding: 5px 15px;
5353
background-color: transparent;
5454
cursor: pointer;
5555
}
5656
57-
.top-btns button:first-child {
57+
.buttons-container button:first-child {
5858
border-top-left-radius: 10px;
5959
border-bottom-left-radius: 10px;
6060
border-right: transparent;
6161
}
6262
63-
.top-btns button:nth-child(2) {
63+
.buttons-container button:nth-child(2) {
6464
border-top-right-radius: 10px;
6565
border-bottom-right-radius: 10px;
6666
border-left: transparent;
6767
}
6868
6969
@media screen and (max-width: 800px) {
70-
.top-btns {
70+
.buttons-container {
7171
width: 70%;
7272
}
7373
}

0 commit comments

Comments
 (0)