-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
77 lines (70 loc) · 1.85 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
<html>
<head>
<title>Javascript Demo</title>
<style>
*{
margin: 0 auto;
}
body {
font-family: monospace;
font-size:50px;
text-align: center;
}
#header{
position: relative;
height: 50%;
color: white;
padding-top: 18%;
border-bottom: 3px solid #ededed;
background: url('3.jpg') no-repeat center center fixed;
box-shadow: inset 0px 0px 0 2000px rgba(0,0,0,0.7);
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
#magic{
white-space: pre-wrap;
color: #a0a0a0;
border-right: 1px solid #777;
padding-right: 7px;
display: inline;
}
#icons{
height: 200%;
}
</style>
</head>
<body>
<div id='header' class='overlay'>
Technology <span id="magic"></span>
</div>
<div id='icons'>
</div>
<script>
(function(){
var words = ["should be simple.", "should be engaging.", "should be liberating.", "should be sustainable.", "isn't what we do.", "is who we are.", "| CPQ+"],
el = document.getElementById('magic'),
word_counter = 0,
character_counter = 0;
function updateText()
{
el.innerHTML = el.innerHTML + words[word_counter][character_counter++];
if(character_counter == words[word_counter].length + 1)
{
word_counter++; //choose a different word
character_counter = 0; //start over with the first character of the word
el.innerHTML = ''; //set the html to be blank
//if we're displaying the last word, go back to the first word
if(word_counter == words.length)
word_counter = 0;
}
if(word_counter == words.length-1 && character_counter == words[words.length-1].length){
clearInterval(interval);
}
}
var interval = setInterval(updateText, 295);
})();
</script>
</body>
</html>