YouTube2Text

How To Make QR Code Generator Website Using HTML CSS And JavaScript — Transcript

by GreatStack · 2,373 words · 359 segments · language en · Watch on YouTube

Full transcript

  1. 0:00hi guys welcome back to another video
  2. 0:02today in this video we will learn how to
  3. 0:04create a QR code generator using HTML
  4. 0:06CSS and very simple JavaScript here on
  5. 0:09my computer screen you can see one input
  6. 0:12box and one button if we write something
  7. 0:15in this input box we can add any text or
  8. 0:18we can add any URL and when we'll click
  9. 0:21on this button it will create the QR
  10. 0:23code of that link or text let me write
  11. 0:25something here
  12. 0:27if I write my channel name easy
  13. 0:29tutorials and click on this button it
  14. 0:33will create this QR code next I will add
  15. 0:36my name here and click here on this
  16. 0:39button you can see changes in this QR
  17. 0:42code it means it is creating a new QR
  18. 0:44code let me add one link here I will add
  19. 0:48google.com
  20. 0:50and click on this button
  21. 0:52and you will see the QR code for the
  22. 0:55google.com URL
  23. 0:57you can scan this QR code from your
  24. 0:59mobile and it will open that link and if
  25. 1:01it is for the text it will display that
  26. 1:04text it is very simple to create this
  27. 1:06type of QR code generator using HTML CSS
  28. 1:08and JavaScript so keep watching this
  29. 1:10video till the end and create your own
  30. 1:12QR code generator here I have this
  31. 1:15folder and in this one you can see one
  32. 1:16HTML file one CSS file let me open these
  33. 1:19files with my code editor which is
  34. 1:20Visual Studio code you can use any code
  35. 1:22editor so this is the HTML file where I
  36. 1:25have added the basic HTML structure and
  37. 1:27this one is the CSS file in this HTML
  38. 1:30file I have added this link tag that
  39. 1:31will connect the HTML and CSS file now
  40. 1:34we will come back to the CSS file and
  41. 1:36here we will add one CSS properties for
  42. 1:38the body so let's add body and in this
  43. 1:41body we will add the background
  44. 1:43here we will add one color code
  45. 1:46after that let's come back to the folder
  46. 1:48and open this HTML file with any web
  47. 1:50browser so you can see this dark color
  48. 1:52on the complete web page let me close
  49. 1:54this browser and I will open this
  50. 1:56browser with the visual studio code
  51. 1:58extension called live server so that it
  52. 2:00will refresh the webpage automatically
  53. 2:02whenever you will add any changes in the
  54. 2:04code file now you can see the same
  55. 2:06webpage again now let's come back to the
  56. 2:07HTML file here we will create one div
  57. 2:10with the class name container
  58. 2:12next we will add the CSS for this
  59. 2:13container so write this class name here
  60. 2:15in this CSS file and for this container
  61. 2:18we will add the CSS properties like
  62. 2:27width and some padding to add some space
  63. 2:30inside the box and position absolute top
  64. 2:3350 left 50 transform translate minus 50
  65. 2:37and minus 50 it will move this div in
  66. 2:40the center of the webpage and here we
  67. 2:42have the white background and Border
  68. 2:44radius let's come back to the website
  69. 2:46and you can see this box in the center
  70. 2:48of this web page in this one we will add
  71. 2:50one text one input field and one button
  72. 2:52so let's come back to the HTML file and
  73. 2:55within this container let's add one text
  74. 2:57in V tag
  75. 3:01enter your text or URL then we will add
  76. 3:04one input field
  77. 3:05input type will be text and then we will
  78. 3:07add the placeholder that will be the
  79. 3:09text displaying inside the input field
  80. 3:13next we will add one button
  81. 3:18and button text is generate QR code
  82. 3:22after adding this let's come back to the
  83. 3:25website and you can see this text this
  84. 3:27input box and this button next we will
  85. 3:30design it using CSS so let's come back
  86. 3:31and come to the CSS file here we will
  87. 3:34add dot container and P for the
  88. 3:38text
  89. 3:40in this one we will add the font weight
  90. 3:43it will be 600
  91. 3:45then we will add the font size
  92. 3:49and margin at the bottom to add space at
  93. 3:53the bottom
  94. 3:55then we will add the CSS for the
  95. 3:58input field so write container and input
  96. 4:10for this input field I have added
  97. 4:13width and height then border of 1 pixel
  98. 4:16and outline is 0 then padding of 10
  99. 4:19pixel that is the space inside the input
  100. 4:21field and we have added margin 10 pixel
  101. 4:23from top and 20 pixel from the bottom
  102. 4:26and left right zero and Border radius is
  103. 4:285 pixel now you can see the font weight
  104. 4:30is increased for this text and this
  105. 4:33input field is also looking good next we
  106. 4:36will Design this button so let's come
  107. 4:38back and here we will add dot container
  108. 4:40and button
  109. 4:55in this button I have added width and
  110. 4:57height then background and color this is
  111. 5:00for the text color of the button then
  112. 5:02border outline zero border radius of 5
  113. 5:05pixel and then I have added the Box
  114. 5:07Shadow for this button cursor pointer
  115. 5:09and margin it will be the space from top
  116. 5:11and bottom of 20 pixel and we have
  117. 5:14increased the font weight after that
  118. 5:16this button looks good
  119. 5:18next we need one API that will create
  120. 5:21the QR code for that just Google for QR
  121. 5:24code API
  122. 5:26we will use this website go QR dot me
  123. 5:30you can see the URL go Qi dot me slash
  124. 5:33API I will get this link in the video
  125. 5:35description so you can directly come to
  126. 5:37this URL and here you can see this link
  127. 5:41if we copy this one
  128. 5:43and paste it in the URL
  129. 5:47you can see it will display a QR code
  130. 5:49the text in this
  131. 5:52URL it is example if I replace this one
  132. 5:55I'll write hello
  133. 5:57it will give the another QR code so we
  134. 6:00will add the input here at the end of
  135. 6:02this URL and we will get the different
  136. 6:04QR code for the particular text or URL
  137. 6:07so let me remove the last word
  138. 6:10we will use this link in our JavaScript
  139. 6:13so let's come back to the code file and
  140. 6:16here just above this closing body tag we
  141. 6:19will add script
  142. 6:21open and closing tag and in this one we
  143. 6:25have to create one function so let's
  144. 6:27create one function
  145. 6:29and
  146. 6:31write the name
  147. 6:33generate QR
  148. 6:38and before writing code in this function
  149. 6:40we will come back here just above this
  150. 6:43button we will add one div where we will
  151. 6:45display the QR code on the browser here
  152. 6:48we will add one tip with the ID IMG box
  153. 6:52and in this tip there will be one image
  154. 6:54so write the IMG tag and the source will
  155. 6:57be empty because currently we don't have
  156. 7:00the QR code so the SRC will be empty and
  157. 7:03we will add one ID here so ID is
  158. 7:07QR IMG
  159. 7:10or let's say image keyword image
  160. 7:14like this
  161. 7:15and we will add the variables here in
  162. 7:19this script we will add
  163. 7:21let
  164. 7:23IMG box equal to
  165. 7:27document Dot
  166. 7:29get element by ID
  167. 7:32and IMG box
  168. 7:35let's duplicate it and in this IMG box
  169. 7:38we will add this
  170. 7:39QR image
  171. 7:43and after that we need the input field
  172. 7:47here so in this input field we will add
  173. 7:49the ID
  174. 7:52QR text where we will add the texture so
  175. 7:56copy this one and duplicate this
  176. 7:58variable and here we will add QR text
  177. 8:00and QR text so it will give us the value
  178. 8:03written in the input field and this is
  179. 8:07the image and we have to add the image
  180. 8:09Link in this IMG tag and we will get the
  181. 8:12link from here
  182. 8:13so just come back and here we will add
  183. 8:16QR image
  184. 8:18dot SRC
  185. 8:20because the SRC is not available so we
  186. 8:23will add this link and at the end of
  187. 8:26this link we need the text written in
  188. 8:29this input field so to get the text
  189. 8:32written in this input field we will add
  190. 8:34this
  191. 8:35QR text
  192. 8:37dot value so it will give us the value
  193. 8:42like this
  194. 8:45next we have to call this function
  195. 8:46that's it so just copy this one and add
  196. 8:49it here in this button we will add on
  197. 8:51click
  198. 8:52equal to
  199. 8:54generate QR it will run this function
  200. 8:56and it will
  201. 8:58get the value written in the input field
  202. 9:01and it will create this URL and that URL
  203. 9:04will be
  204. 9:05displayed in this IMG tag so let's come
  205. 9:08back to the website and test this one if
  206. 9:11I write something here
  207. 9:14hello and click on this button you can
  208. 9:17see it will display this QR code now we
  209. 9:20have to align this one and we will add
  210. 9:21some animation using CSS so just come
  211. 9:24back and here we have added the
  212. 9:28image box
  213. 9:30write this ID here
  214. 9:33for this one we will add the width it
  215. 9:35will be 200
  216. 9:38and
  217. 9:40border radius it will be 5 pixel
  218. 9:44and let's add the max height
  219. 9:48it will be zero so in a series it will
  220. 9:51be hidden then we will add overflow
  221. 9:53hidden
  222. 9:56and
  223. 9:58in this IMG box we have the IMG tag so
  224. 10:02write the IMG then width it will be 100
  225. 10:05percent
  226. 10:06and let's add the padding of 10 pixel
  227. 10:11we have added the max height 0 so the
  228. 10:13image will be hidden and when we will
  229. 10:15add the text and generate the QR code
  230. 10:17then it will be displayed so we have to
  231. 10:19increase the max height so let's add the
  232. 10:22ID first it is IMG box
  233. 10:26then write Dot so IMG
  234. 10:34this class will be applied whenever the
  235. 10:36QR code is displaying and when this
  236. 10:39class will be applied here we will
  237. 10:41increase the max height
  238. 10:43let's add the max height of 300 pixel
  239. 10:46then we will add the margin
  240. 10:48margin will be 10 pixel and Auto
  241. 10:51then we will add the Border
  242. 10:54border will be one pixel solid
  243. 10:57and this color after adding this
  244. 11:01we have to apply this class name
  245. 11:03so let's come back to the HTML file and
  246. 11:06after this link here we will add
  247. 11:09IMG box
  248. 11:11Dot
  249. 11:13classlist dot add
  250. 11:16so it will add this class name
  251. 11:20now just come back to the CSS file here
  252. 11:22we are adding the maxite 300 and
  253. 11:25initially it was zero so here we will
  254. 11:27add the transition also so it will be
  255. 11:28smooth animation let's add transition
  256. 11:33Max height one second
  257. 11:37after that if I write some text here
  258. 11:41and click on this
  259. 11:43generate button
  260. 11:45you can see it is increasing the height
  261. 11:48let's refresh the website and try again
  262. 11:54you can see smoothly it is increasing
  263. 11:57the height and displaying this QR code
  264. 11:59here if I click on this button without
  265. 12:02writing anything here let's see
  266. 12:04it is displaying this type of error so
  267. 12:07to fix this one let's come back and here
  268. 12:10we will include all these things in if
  269. 12:13condition we will add if
  270. 12:16and in this if we will check
  271. 12:18this QR text Dot value
  272. 12:22dot length
  273. 12:27greater than zero
  274. 12:30and
  275. 12:32add it here
  276. 12:36so this code will be executed when the
  277. 12:41keyword text value length is greater
  278. 12:43than 0 it means this input field has
  279. 12:46some value now let's come back to the
  280. 12:48website if I click on this button
  281. 12:51nothing will happen because the input
  282. 12:53field is blank and if we write anything
  283. 12:55here
  284. 12:57and click on this button it will
  285. 13:00generate the QR code next we will add
  286. 13:02one more thing we will click on this
  287. 13:04button without writing anything in this
  288. 13:06input field then it should display some
  289. 13:08animation
  290. 13:09so we will add the shake animation in
  291. 13:12this input field when this input field
  292. 13:14is blank to add that animation let's
  293. 13:17come back to the CSS file and here we
  294. 13:18will add one class name error
  295. 13:21and let's add one animation here
  296. 13:24animation
  297. 13:26check
  298. 13:280.1 seconds
  299. 13:30linear and it will be for 10 times
  300. 13:34and then we will add the keyframes
  301. 13:40here we will add zero percent and at
  302. 13:42zero percent it will be
  303. 13:44transform
  304. 13:46translate X
  305. 13:480 so there will be no movement let's
  306. 13:51duplicate it
  307. 13:53and here we will add minus 2 pixel it
  308. 13:56will go left then it will come back to
  309. 13:58the 0 then it will go right by 2 pixel
  310. 14:02and again 0 it will be
  311. 14:0525 percent
  312. 14:08this will be 50 this is 75 percent and
  313. 14:11this is 100 percent
  314. 14:14like this and now we have to apply this
  315. 14:17error class name when there is an error
  316. 14:20so let's come back and here we are
  317. 14:22adding if condition so we will add the
  318. 14:24else
  319. 14:26and in this else we have to add that
  320. 14:28class name so write
  321. 14:30QR
  322. 14:33text Dot class list
  323. 14:36dot add
  324. 14:38it will add this class name
  325. 14:40error now we are adding this class name
  326. 14:43but this class name should be removed
  327. 14:46after few seconds so here it will add
  328. 14:49set timeout
  329. 14:53it will be for
  330. 14:561000 milliseconds that is once again
  331. 14:58and in this one
  332. 15:00let's add this one
  333. 15:02and write remove so it will remove the
  334. 15:05class name after one second
  335. 15:08so if it is greater than 0 it means if
  336. 15:12the input field has some value it will
  337. 15:14run this code and if the input field has
  338. 15:17no value then it will add this error
  339. 15:20class name and this error class name
  340. 15:21will add this animation that will move
  341. 15:24left by 2 pixel and right by 2 pixel for
  342. 15:2610 times now let's see this animation if
  343. 15:30I click on this button you can see this
  344. 15:33input field is checking let's click
  345. 15:35again you can see it is working and if
  346. 15:38we write any URL here we will write
  347. 15:41google.com
  348. 15:43and click on this generate QR code it
  349. 15:46will display this QR code now you just
  350. 15:49scan this QR code from your mobile and
  351. 15:51let me know in the comment section does
  352. 15:53it work or not so I hope this video will
  353. 15:55be helpful for you if you have any
  354. 15:56question you can ask me in the comment
  355. 15:58section please like and share this video
  356. 16:00and also subscribe my channel AJ
  357. 16:01tutorials to watch more videos like this
  358. 16:03one thank you so much for watching this
  359. 16:05video

About this transcript

This page contains the full transcript of How To Make QR Code Generator Website Using HTML CSS And JavaScript by GreatStack, generated from the public captions YouTube serves with the video. The transcript has 2,373 words across 359 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.