Get Your Student Loan Repayment Plan Quote Today
A Pen by Carlo Moscatiello on CodePen.
Get Your Student Loan Repayment Plan Quote Today
A Pen by Carlo Moscatiello on CodePen.
| <main class="prompt"> | |
| <p>Get Your Federal Student Loan Monthly Payment Forgiven Today!</p> | |
| <p>Call (800) 757-5001 To Get Your New Monthly Payment In Just Minutes</p> | |
| <p>Or Go To forgivenessassist.com For More Information</p> | |
| </main> |
| var $lines = $('.prompt p'); | |
| $lines.hide(); | |
| var lineContents = new Array(); | |
| var terminal = function() { | |
| var skip = 0; | |
| typeLine = function(idx) { | |
| idx == null && (idx = 0); | |
| var element = $lines.eq(idx); | |
| var content = lineContents[idx]; | |
| if(typeof content == "undefined") { | |
| $('.skip').hide(); | |
| return; | |
| } | |
| var charIdx = 0; | |
| var typeChar = function() { | |
| var rand = Math.round(Math.random() * 150) + 25; | |
| setTimeout(function() { | |
| var char = content[charIdx++]; | |
| element.append(char); | |
| if(typeof char !== "undefined") | |
| typeChar(); | |
| else { | |
| element.append('<br/><span class="output">' + element.text().slice(9, -1) + '</span>'); | |
| element.removeClass('active'); | |
| typeLine(++idx); | |
| } | |
| }, skip ? 0 : rand); | |
| } | |
| content = ' $$$ ➜ "' + content + '"'; | |
| element.append(' ').addClass('active'); | |
| typeChar(); | |
| } | |
| $lines.each(function(i) { | |
| lineContents[i] = $(this).text(); | |
| $(this).text('').show(); | |
| }); | |
| typeLine(); | |
| } | |
| terminal(); |
| <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> |
| body { | |
| background-color: black; | |
| color: #55ff55; | |
| font-family: monospace; | |
| } | |
| .output { | |
| color: red; | |
| } | |
| .active:after { | |
| content: '_'; | |
| } |