-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html.bak
195 lines (159 loc) · 6.97 KB
/
index.html.bak
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<html>
<head>
<title>Loops</title>
<meta charset="UTF-8">
</head>
<!-- js-beautify (external beautify functions to use with ace editor) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.10.0/beautify.js"></script>
<!-- p5.js libraries -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/p5.js" integrity="sha256-v7VXRjLXSQU8TLVpV3hSPIARUehQ2NNQjmcU/NHmCoo=" crossorigin="anonymous"></script>
<script src="kirjasto.js"></script>
<script src="missions_fi.js"></script>
<script src="missions_en.js"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<!-- Playfab (mostly for analytics, I do not track anything personal, just user count, average missions completed etc) -->
<!--<script type="text/javascript" src="https://download.playfab.com/PlayFabClientApi.js"></script>
<script src="playfab.js"></script>
<!-- GameAnalytics -->
<script src="GameAnalytics.js"></script>
<!--<script src='http://download.gameanalytics.com/js/GameAnalytics-2.0.1.min.js'></script>-->
<!--
<script>
GameAnalytics("setEnabledInfoLog", true);
GameAnalytics("setEnabledVerboseLog", true);
GameAnalytics("configureBuild", "android 1.0.0");
GameAnalytics("setGender", "'male'");
GameAnalytics("initialize", "8fa42872e672824ac8497c5ea386bc80", "28310d9da3861e3772a21c73dc99129f8f1c2888");
</script>
-->
<!-- Page stylesheet -->
<link rel="stylesheet" href="style.css">
<!-- Inconsolata font -->
<link href="https://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet">
<!-- Ace code editor -->
<script src="ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="ace/ext-language_tools.js"></script>
<script type="text/javascript" src="ace/mode-javascript.js"></script>
<!-- Page code -->
<script src="code.js"></script>
<!-- Ace code editor settings -->
<style type="text/css" media="screen">
#editor {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin-bottom: 0px;
padding-bottom: 0px;
font-size: 18px;
}
</style>
<body>
<!-- Otsikko
<div class="jumbotron text-center">
<h1>For-loop</h1>
</div>-->
<div class="container shadow-lg">
<div class="row no-gutters">
<div class="col-sm-12 no-gutters" style="width: 400px; height: 400px;">
<div id="canvas" style="border-color: red;position:relative;float:left;width:400px;height:400px;"></div>
<div class="editor-parent no-gutters" style="position:relative;overflow:hidden;height:90%">
<div id="editor"></div>
</div>
<div style="position:relative;overflow:hidden;height:10%">
<div style="width:10%; float:left;">
<button onclick="resetEverything()" type="button" class="btn btn-dark no-gutters" style="width:100%;"><img src="refresh.png" style="height:100%;"></img></button>
</div>
<div style="width:90%; float:right;">
<button id="run" onclick="runCode();" type="button" style="float:left; font-size: 18px; width: 50%;" class="btn btn-dark btb-lg no-gutters">Run code</button>
<button id="done" onclick="missionGoto('next')" type="button" style="float:right;font-size: 18px; width: 50%;" class="btn btn-success btb-lg no-gutters">Next</button>
</div>
</div>
</div>
</div>
<div class="row no-gutters">
<div class="col-sm-12" style="height:180px">
<div class="card" style="width: 100%; height:100%">
<div class="card-header">
<ul class="nav nav-tabs card-header-tabs">
<li class="nav-item">
<a id="console" onclick="changeTab('console')" class="nav-link active tabi">Console</a>
</li>
<li class="nav-item">
<a id="desc" onclick="changeTab('desc')" class="nav-link active tabi">Description</a>
</li>
<li class="nav-item">
<a data-order="1" data-hint_index="1" id="hint1" onclick="changeTab('hint1',this)" class="nav-link active tabi hint">Hint 1</a>
</li>
<li class="nav-item">
<a data-order="2" data-hint_index="2" id="hint2" onclick="changeTab('hint2',this)" class="nav-link active tabi hint">Hint 2</a>
</li>
<li class="nav-item">
<a data-order="3" data-hint_index="3" id="hint3" onclick="changeTab('hint3',this)" class="nav-link active tabi hint">Hint 3</a>
</li>
</ul>
</div>
<div class="card-body">
<p id="alapalkki" class="card-text"></p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 level-progress" style="min-height:0px;"></div>
</div>
<br>
<div class="row">
<div class="col-sm-12 no-gutters" style="height:50px;">
<div class="btn-group" role="group" aria-label="Button group with nested dropdown">
<!-- Language -->
<div class="btn-group" role="group">
<button id="btnGroupDrop1" type="button" class="btn btn-dark dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Language
</button>
<div class="dropdown-menu" aria-labelledby="btnGroupDrop1">
<a class="dropdown-item" onclick="changeLanguage('en')">English</a>
<a class="dropdown-item" onclick="changeLanguage('fi')">Suomi</a>
</div>
</div>
<!-- SaveSlots -->
<div class="btn-group" role="group">
<button id="slotsButton" type="button" class="btn btn-dark dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Save Slot</button>
<div id='saveslots'class="dropdown-menu" aria-labelledby="btnGroupDrop1"></div>
</div>
</div>
</div>
<script>
ace.require("ace/ext/language_tools");
var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/javascript");
editor.resize();
var staticWordCompleter = {
getCompletions: function(editor, session, pos, prefix, callback) {
var wordList = ["ruutu", "cell"];
callback(null, wordList.map(function(word) {
return {
caption: word,
value: word+'();',
meta: "Function"
};
}));
}
}
editor.completers = [staticWordCompleter]
editor.setOption("enableBasicAutocompletion", true);
editor.setShowPrintMargin(false);
editor.setOptions({
enableBasicAutocompletion: true,
enableSnippets: true,
enableLiveAutocompletion: true
});
</script>
</body>
</html>