@@ -130,8 +130,6 @@ const Generate: React.FC = () => {
130130 const substanceUseEncoded = substanceUseMap [ data . substanceUse ] . toString ( )
131131 const numericPart = dobEncoded + heightEncoded + weightEncoded + bloodGroupEncoded + substanceUseEncoded
132132 const base62NumericPart = decimalToBase62 ( Number . parseInt ( numericPart ) )
133- console . log ( "Numeric part:" , numericPart )
134- console . log ( "Base62 numeric part:" , Number . parseInt ( numericPart ) )
135133 let binaryPart = ""
136134 binaryPart += data . pregnant ? "1" : "0"
137135 binaryPart += data . organDonor ? "1" : "0"
@@ -155,17 +153,12 @@ const Generate: React.FC = () => {
155153 const handleGenerateQRCode = async ( ) => {
156154 setLoading ( true )
157155 const encodedData = encodeData ( formData )
158- console . log ( "Encoded data:" , encodedData )
159- console . log ( "PIN:" , pin )
160- console . log ( "DOB" , formData . dob )
161- console . log ( "Phone NO" , formData . emergencyContact )
162156 const encryptedData = encryptData ( encodedData , pin )
163157 const qrCodeData = `https://opentag.github.io/q?=${ encryptedData } `
164- console . log ( "QR code data:" , qrCodeData )
165158
166159 const qrCodeOptions = {
167160 margin : 0 ,
168- color : { dark : "#ffffff" , light : "#ff3131 " } ,
161+ color : { dark : "#ffffff" , light : "#fe0000 " } ,
169162 }
170163
171164 try {
@@ -176,10 +169,9 @@ const Generate: React.FC = () => {
176169 const firstPage = pages [ 0 ]
177170 const qrImage = await pdfDoc . embedPng ( qrCodeDataUrl )
178171
179- firstPage . drawImage ( qrImage , { x : 75 , y : 190 , width : 175 , height : 175 } )
180- const font = await pdfDoc . embedFont ( StandardFonts . HelveticaBold )
181- firstPage . drawText ( `${ pin } ` , { x : 175 , y : 144 , size : 30 , color : rgb ( 1 , 1 , 1 ) , font : await pdfDoc . embedFont ( StandardFonts . HelveticaBold ) } )
182- firstPage . drawText ( `${ formData . bloodGroup } ` , { x : 200 , y : 100 , size : 40 , color : rgb ( 1 , 1 , 1 ) , font : await pdfDoc . embedFont ( StandardFonts . HelveticaBold ) } )
172+ firstPage . drawImage ( qrImage , { x : 157 , y : 50 , width : 87 , height : 87 } )
173+ firstPage . drawText ( `${ pin } ` , { x : 90 , y : 50 , size : 25 , color : rgb ( 1 , 1 , 1 ) , font : await pdfDoc . embedFont ( StandardFonts . HelveticaBold ) } )
174+ firstPage . drawText ( `${ formData . bloodGroup } ` , { x : 53 , y : 52 , size : 15 , color : rgb ( 1 , 0 , 0 ) , font : await pdfDoc . embedFont ( StandardFonts . HelveticaBold ) } )
183175
184176 const pdfBytes = await pdfDoc . save ( )
185177 const blob = new Blob ( [ pdfBytes ] , { type : "application/pdf" } )
@@ -202,6 +194,9 @@ const Generate: React.FC = () => {
202194 < h1 className = "text-2xl font-bold text-stone-800 dark:text-stone-200 mb-6 text-center" >
203195 Get < span className = "italic text-red-500 dark:text-red-500" > Serverless</ span > Tag
204196 </ h1 >
197+ < p className = "text-sm text-stone-600 dark:text-stone-400 text-center" >
198+ Serverless means all you data to be stored in the QR code and no data will leave your device.
199+ </ p >
205200 </ div >
206201 < Card className = "w-full max-w-2xl" >
207202 < CardHeader >
@@ -380,7 +375,11 @@ const Generate: React.FC = () => {
380375 </ div >
381376 </ div >
382377 < div className = "space-y-2" >
383- < Label htmlFor = "pin" > 4-Digit PIN</ Label >
378+ < Label htmlFor = "pin" > Set a 4-digit PIN
379+ < p className = "text-sm text-stone-600 dark:text-stone-400" >
380+ This pin will be used to encrypt your data. possibly set it to last digits of your vehicle number
381+ </ p >
382+ </ Label >
384383 < Input
385384 id = "pin"
386385 name = "pin"
0 commit comments