forked from shivam-jha2712/Portfolio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
70 lines (61 loc) · 2.73 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// set up text to print, each item in array is new line
var aText = new Array(
// " I am fresher and speaking of which gives me a tinch of confidence about writing the next line that I am even a good listener and fast learner as I have recently completed <b>my second year</b> and wanted to get my hands into the actual field and get to learn some real-world skills by applying them."
"Lorem Ipsum is simply dummy text of the printing and <b> typesetting industry</b>.Lorem Ipsum has been the industry's standard <b>dummy text ever</b> since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s <b>with the release of Letraset</b> sheets containing Lorem Ipsum."
);
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();
// var beepOne = $("#beep")[0];
// $(".loader")
// .mouseenter(function () {
// beepOne.play();
// });
//POPUP EVENT
let popup = document.getElementById("popup");
function openPopup() {
// function required() {
// var empt = document.forms["form1"]["lastName"]["email"]["mobile"]["textarea"].value;
// if (empt == "") {
// alert("Please input a Value");
// return false;
// }
// else {
// return true;
// }
// }
popup.classList.add("open-popup");
}
function closePopup() {
popup.classList.remove("open-popup");
}
//Get Data
// const firstNameInput = document.querySelector("#firstname");
// const lastNameInput = document.querySelector("#lastname");
// const emailInput = document.querySelector("#email");
// const mobileInput = document.querySelector("#mobile");
// const messageInput = document.querySelector("#message");