-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.html
68 lines (59 loc) · 2.61 KB
/
test.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
<!DOCTYPE html>
<html>
<head>
<title>Cyberpunk Street Parallax</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/stylesheet.css">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<nav class="navbar navbar-default" id="green-navbar">
<div class="container-fluid">
<ul class="nav navbar-nav">
<li><a href="./">Home</a></li>
<li><a href="story.html">Story</a></li>
<li><a href="credit.html">Credit</a></li>
</ul>
</div>
</nav>
<div class="text-box col-sm-6 text-center" style="float: none; margin-top: 30%;">
<div id="demo"></div>
<!-- <a id="playButton" href="#" class="btn btn-primary" onclick="typeWriter();">START</a> -->
<a id="playButton" href="#" style="margin-top: 20px;" class="btn btn-primary btn-lg" onclick="playNextMessage();">START</a>
</div>
<div class="foreground"></div>
<div class="midground">
</div>
<div class="background">
</div>
<script>
var playlist = ['In the year 30XX, the Techno-Tyrants of Neo-Europe have infected human civilization with ABW (Awfully Bland Websites).', 'All hope seems lost for the colonies of Neo-Earth ...', 'But a new hero has arisen as part of Project Jasconius!', 'A coder with techno-talents for the good of humanity!', 'He is ... CodeWritingCow!'];
var playlistPosition = 0;
var characterPosition = 0;
var speed = 75; /* Speed/duration of the effect in milliseconds */
// Types text on screen
// function typeWriter() {
// console.log(`playlistPosition is at ${playlistPosition}`);
// if (characterPosition < playlist[playlistPosition].length) {
// document.getElementById("demo").innerHTML += playlist[playlistPosition].charAt(characterPosition);
// characterPosition++;
// setTimeout(typeWriter, speed);
// }
// if (characterPosition === playlist[playlistPosition].length) {
// playlistPosition++;
// console.log(`playlistPosition is at ${playlistPosition}`);
// }
// }
function playNextMessage() {
document.getElementById('demo').innerHTML = playlist[playlistPosition];
if (playlistPosition < playlist.length - 1) {
playlistPosition++;
document.getElementById('playButton').innerHTML = 'NEXT';
} else {
playlistPosition = 0;
document.getElementById('playButton').innerHTML = 'REPLAY';
}
}
</script>
</body>
</html>