Zlatislav Zlatev commited on
Commit
0926e7d
·
1 Parent(s): 461aefb

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +43 -7
index.html CHANGED
@@ -2,18 +2,54 @@
2
  <html>
3
  <head>
4
  <title>Walking AI Web App</title>
5
- <link rel="stylesheet" href="style.css">
 
 
 
 
 
 
 
6
  </head>
7
  <body>
8
  <h1>Walking AI Web App</h1>
9
  <div id="environment"></div>
10
  <button id="startButton">Start</button>
11
  <button id="stopButton">Stop</button>
12
- <div id="output"></div>
13
- <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@3.11.0"></script>
14
- <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-converter@3.11.0"></script>
15
- <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-layers@3.11.0"></script>
16
- <script src="https://cdn.jsdelivr.net/npm/gym-js"></script>
17
- <script src="script.js"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  </body>
19
  </html>
 
2
  <html>
3
  <head>
4
  <title>Walking AI Web App</title>
5
+ <style>
6
+ #environment {
7
+ width: 200px;
8
+ height: 200px;
9
+ border: 1px solid black;
10
+ margin-bottom: 10px;
11
+ }
12
+ </style>
13
  </head>
14
  <body>
15
  <h1>Walking AI Web App</h1>
16
  <div id="environment"></div>
17
  <button id="startButton">Start</button>
18
  <button id="stopButton">Stop</button>
19
+ <script>
20
+ // Variables for update intervals
21
+ let environmentInterval;
22
+ let outputInterval;
23
+
24
+ // Function to update the environment display
25
+ function updateEnvironmentDisplay() {
26
+ const environmentDiv = document.getElementById("environment");
27
+ environmentDiv.innerText = "Environment Display";
28
+ }
29
+
30
+ // Function to update the AI output display
31
+ function updateOutputDisplay() {
32
+ const outputDiv = document.getElementById("output");
33
+ outputDiv.innerText = "AI Output Display";
34
+ }
35
+
36
+ // Set up event listeners for UI buttons
37
+ document.getElementById("startButton").addEventListener("click", startAI);
38
+ document.getElementById("stopButton").addEventListener("click", stopAI);
39
+
40
+ // Function to start the AI
41
+ function startAI() {
42
+ console.log("AI started");
43
+ environmentInterval = setInterval(updateEnvironmentDisplay, 1000);
44
+ outputInterval = setInterval(updateOutputDisplay, 500);
45
+ }
46
+
47
+ // Function to stop the AI
48
+ function stopAI() {
49
+ console.log("AI stopped");
50
+ clearInterval(environmentInterval);
51
+ clearInterval(outputInterval);
52
+ }
53
+ </script>
54
  </body>
55
  </html>