Here is a snippet that you can use to showcase a barcode and the scanning line animation in a web page, it was designed by Joseph Fusco. The scan line has a flicker effect and scans from top to bottom.
If you are having trouble with the pen, try the archived copy on GitHub
can Line Animation Snippet
See the Pen Barcode Scanner 🙂 by Joseph Fusco (@fusco) on CodePen.0