Typewriter

Developer
Size
2,141 Kb
Views
20,240

How do I make an typewriter?

What is a typewriter? How do you make a typewriter? This script and codes were developed by Gavra on 20 November 2022, Sunday.

Typewriter Previews

Typewriter - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>typewriter</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <link href="https://fonts.googleapis.com/css?family=Waiting+for+the+Sunrise" rel="stylesheet" type="text/css"/>
<body> <div id="typedtext"></div>
</body> <script src="js/index.js"></script>
</body>
</html>

Typewriter - Script Codes CSS Codes

body { font-family: 'Waiting for the Sunrise', cursive; font-size:30px; margin: 10px 50px; letter-spacing: 6px; font-weight: bold;
}

Typewriter - Script Codes JS Codes

// set up text to print, each item in array is new line
var aText = new Array(
"There are only 10 types of people in the world:",
"Those who understand binary, and those who don't"
);
var iSpeed = 100; // time delay of print out
var iIndex = 0; // start printing array at this posision
var iArrLength = aText[0].length; // the length of the text array
var iScrollAt = 20; // start scrolling up at this many lines
var iTextPos = 0; // initialise text position
var sContents = ''; // initialise contents variable
var iRow; // initialise current row
function typewriter()
{ sContents = ' '; iRow = Math.max(0, iIndex-iScrollAt); var destination = document.getElementById("typedtext"); while ( iRow < iIndex ) { sContents += aText[iRow++] + '<br />'; } destination.innerHTML = sContents + aText[iIndex].substring(0, iTextPos) + "_"; if ( iTextPos++ == iArrLength ) { iTextPos = 0; iIndex++; if ( iIndex != aText.length ) { iArrLength = aText[iIndex].length; setTimeout("typewriter()", 500); } } else { setTimeout("typewriter()", iSpeed); }
}
typewriter();
Typewriter - Script Codes
Typewriter - Script Codes
Home Page Home
Developer Gavra
Username gavra
Uploaded November 20, 2022
Rating 3.5
Size 2,141 Kb
Views 20,240
Do you need developer help for Typewriter?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Gavra (gavra) Script Codes
Create amazing captions with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!