Skip to content

Instantly share code, notes, and snippets.

@CodeMyUI
Created June 1, 2017 02:11
Show Gist options
  • Save CodeMyUI/c63272c65515f8884ec15505fc0b423e to your computer and use it in GitHub Desktop.
Save CodeMyUI/c63272c65515f8884ec15505fc0b423e to your computer and use it in GitHub Desktop.
Barcode Scanner :)
<div class="preloader-scan">
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<div class="diode">
<div class="laser"></div>
</div>
</ul>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
.preloader-scan {
position: fixed;
left: 0;
right: 0;
max-width: 200px;
display: table;
margin: 0 auto;
height: 100%;
text-align: center;
@for $i from 1 through 24 {
li:nth-child(#{$i}){
$w: random(5);
width: #{$w}px;
}
}
ul {
height: 100%;
display: table-cell;
vertical-align: middle;
list-style-type: none;
text-align: center;
}
li {
display: inline-block;
width: 2px;
height: 50px;
background-color: #444;
}
.laser {
width: 150%;
margin-left: -25%;
background-color: tomato;
height: 1px;
position: absolute;
top: 40%;
z-index: 2;
box-shadow: 0 0 4px red;
animation: scanning 2s infinite;
}
.diode {
animation: beam .01s infinite;
}
}
body {
height: 100%;
}
@keyframes beam {
50% {
opacity: 0;
}
}
@keyframes scanning {
50% {
transform: translateY(75px);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment