Skip to content

Commit 9b3bf99

Browse files
committed
Fix the layout to make it more readable
1 parent 3d18cff commit 9b3bf99

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/scittle/qrcode/qr_code_scanner.clj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,15 @@
9797
#js {:video true :audio false})")
9898

9999
;; This is the same technology used by:
100+
;;
100101
;; - Video conferencing apps (Zoom, Google Meet)
101102
;; - Social media camera features (Instagram, Snapchat)
102103
;; - WebRTC peer-to-peer video calls
103104

104105
;; **2. HTML5 Canvas API**
105106

106107
;; The Canvas API allows us to:
108+
;;
107109
;; - Capture video frames as images
108110
;; - Extract pixel data for processing
109111
;; - Draw overlays and visual feedback
@@ -120,6 +122,7 @@
120122
;; **3. jsQR Library**
121123

122124
;; jsQR is a pure JavaScript QR code detection library that:
125+
;;
123126
;; - Works entirely in the browser (no server needed)
124127
;; - Processes ImageData from canvas
125128
;; - Returns decoded QR code content
@@ -174,6 +177,7 @@
174177
:error nil})) ; Error message")
175178

176179
;; This simple state management pattern:
180+
;;
177181
;; - Keeps everything in one place
178182
;; - Makes state updates predictable
179183
;; - Works perfectly with Reagent's reactivity
@@ -193,6 +197,7 @@
193197
:on-error (fn [error] ...)})")
194198

195199
;; Benefits of keyword arguments:
200+
;;
196201
;; - **Self-documenting** - Clear what each parameter does
197202
;; - **Flexible** - Order doesn't matter
198203
;; - **Optional parameters** - Easy to add defaults
@@ -203,15 +208,18 @@
203208
;; The scanner has several key functions:
204209

205210
;; **Camera Management:**
211+
;;
206212
;; - `start-stream!` - Request camera access with callbacks
207213
;; - `stop-stream!` - Clean up camera resources
208214

209215
;; **Scanning Functions:**
216+
;;
210217
;; - `scan-qr-code` - Capture frame and detect QR codes
211218
;; - `start-qr-scanning!` - Begin continuous scanning loop
212219
;; - `stop-qr-scanning!` - Stop the scanning loop
213220

214221
;; **Utility Functions:**
222+
;;
215223
;; - `copy-to-clipboard!` - Copy results to clipboard
216224
;; - `clear-qr-results!` - Clear all scanned results
217225
;; - `generate-id` - Create unique IDs for results

src/scittle/qrcode/qr_scanner.cljs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
(defn show-toast!
5252
"Show a success toast message
53-
53+
5454
Usage:
5555
(show-toast! {:message \"QR Code detected!\"})"
5656
[{:keys [message duration]}]
@@ -90,9 +90,9 @@
9090

9191
(defn start-stream!
9292
"Start camera stream
93-
93+
9494
Usage:
95-
(start-stream!
95+
(start-stream!
9696
{:on-success (fn [stream] ...)
9797
:on-error (fn [error] ...)})"
9898
[{:keys [on-success on-error]}]
@@ -112,7 +112,7 @@
112112

113113
(defn scan-qr-code
114114
"Scan for QR code in video feed
115-
115+
116116
Usage:
117117
(scan-qr-code
118118
{:video-element video-el
@@ -152,7 +152,7 @@
152152

153153
(defn start-qr-scanning!
154154
"Start continuous QR code scanning
155-
155+
156156
Usage:
157157
(start-qr-scanning!
158158
{:video-element video-el
@@ -188,7 +188,7 @@
188188

189189
(defn copy-to-clipboard!
190190
"Copy text to clipboard
191-
191+
192192
Usage:
193193
(copy-to-clipboard!
194194
{:text \"Hello World\"

0 commit comments

Comments
 (0)