-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
84 lines (76 loc) · 1.99 KB
/
index.html
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="4;url=home.html" />
<title>DataByte</title>
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Source+Code+Pro">
</head>
<style type="text/css">
*{
margin: 0;
padding : 0;
}
#typedtext{
position: absolute;
padding-left: 20%;
/*top: 50%;*/
padding-top: 6%;
/* -webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);*/
height : 100vh;
width: 100%;
background:rgba(0,0,30,0.9);
color:white;
font-size : 2.4em;
font-family: 'Source Code Pro', monospace;
}
</style>
<body>
<div id="typedtext">
</div>
<script type="text/javascript">
// set up text to print, each item in array is new line
var aText = new Array(
">>> from sklearn import datasets",
">>> from sklearn.svm import SVC",
">>> DB = datasets.load_DB()",
">>> clf = SVC()",
">>> clf.fit(DB.data, DB.target_names[DB.target])",
">>>list(clf.predict(DB.data[0]))",
"",
"<pre style='font-size:2em'> ['DataByte']</pre>"
);
var iSpeed = 10; // 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()", 50);
}
} else {
setTimeout("typewriter()", iSpeed);
}
}
typewriter();
// setTimeout(function(){
// window.location = "index.html";
// },4000);
</script>
</body>
</html>