-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
232 lines (203 loc) · 11.1 KB
/
index.html
File metadata and controls
232 lines (203 loc) · 11.1 KB
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<!--
index.html
Description:
This HTML document represents the first lesson in the AI Lessons series,
titled "AI Puppy Lesson 1: Happy and Sad". It provides an interactive and
informative page where users can learn about training a virtual puppy to
exhibit different behaviors based on touch inputs. The page includes sections
on machine learning types, tools used, example ideas, tips & troubleshooting,
and extended thinking.
Key Features:
- Integration with PyScript for interactive Python scripting.
- Dynamic elements such as file upload, download, and save functionalities.
- Navigation links to other lessons in the series.
- Interactive UI elements including buttons for connecting, saving, and running scripts.
- Sections for tips, example ideas, and troubleshooting with visual aids.
- Custom styles and icons for enhanced user experience.
Dependencies:
- PyScript: https://pyscript.net/latest/pyscript.css and https://cdn.jsdelivr.net/npm/@pyscript/core@0.4.46/dist/core.js
- Font Awesome: https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css
and https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css
- Custom styles: style.css
- JavaScript: script.js
Authors: Javier Laveaga, William Goldman, Izzy Morales, Rachael Azrialy
Date: July 31, 2024
Version: 1.0
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>AI Lessons Placemat</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- MAKE SURE YOU KEEP THE PYSCRIPT IMPORT UP TO DATE! When you go to pyscript.com and create a new project, this import
link will be updated and included in your default new project-->
<script type="module" src="https://pyscript.net/releases/2025.2.1/core.js"></script>
<link rel="stylesheet" href="https://pyscript.net/releases/2025.2.1/core.css">
<script src="script.js"></script>
<link rel="icon" type="image/png" href="images/favicon-32x32.png">
<link rel="stylesheet" href="./style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <!--For save button-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> <!--For download exception icon-->
</head>
<body id="lesson1">
<script type="mpy-editor" src="./main.py" config="./pyscript.toml" setup></script>
<header>
<nav class="headbar">
<a href="index.html" id="lesson1-link" class="active">Lesson 1</a>
<a href="lesson2.html" id="lesson2-link">Lesson 2</a>
<a href="lesson3.html" id="lesson3-link">Lesson 3</a>
<a href="lesson4.html" id="lesson4-link">Lesson 4</a>
<a href="lesson5.html" id="lesson5-link">Lesson 5</a>
<a href="lesson6.html" id="lesson6-link">Lesson 6</a>
</nav>
</header>
<div class="container">
<div class="section title-section">
<h1>AI Puppy Lesson 1: Happy and Sad</h1>
<p style="font-size:20px">Train your puppy to be happy when stroked and sad when patted!</p>
</div>
<div class="two-boxes-container">
<div class="yellow-box">
<h2>Machine Learning Type</h2>
<p style="font-size:18px">
<a href="https://www.geeksforgeeks.org/k-nearest-neighbours/" class="special-link">1D K-Nearest Neighbor</a>
</p>
</div>
<div class="yellow-box">
<h2>Tools Used</h2>
<p style="font-size:18px">Touch sensor</p>
</div>
</div>
<div class="section go-sections">
<h2>Example Ideas</h2>
<p>Build a puppy that can be petted!</p>
<img class="puppyPicture" src="nobgimages/aipuppy2_360-removebg-preview.png" alt="Puppy 4">
<img class="puppyPicture" src="nobgimages/aipuppy5_480-removebg-preview.png" alt="Puppy 5">
<img class="puppyPicture" src="nobgimages/aipuppy1_360-removebg-preview.png" alt="Puppy 2">
</div>
<div class="section go-sections">
<h2>Tips & Troubleshooting</h2>
<div class="content-wrapper">
<div class="text-box left">
<p>It may be helpful to attach other LEGO pieces to the force sensor to make it easier to "pet"</p>
</div>
<div class="image-container">
<img class="puppyPicture" src="nobgimages/tips2-removebg-preview.png" alt="Force sensor with gear">
<img class="puppyPicture" src="nobgimages/tips1-removebg-preview.png" alt="Hub with gear and buttons">
</div>
<div class="text-box right">
<p>Make sure the left, center, and right hub buttons are easily accessible</p>
</div>
</div>
</div>
<div class="container2">
<div class="header">
<div class="topDisplay">
<button class="button1 active" id="connect-spike">Connect</button>
<!--FOR RUN BUTTON-->
<!-- partial:index.partial.html -->
<div class="button-row">
<button class="button | button--toggle button--play disabled" id="custom-run-button" data-editor-id="MPcode" disabled>
<i class="ph-play | gg-play-button"></i>
<i class="ph-pause | gg-play-stop"></i>
</button>
</div>
<!--button class="button1" id="custom-run-button" data-editor-id="MPcode">Run</button-->
<!--button class="button1" id="custom-run-button" >Run</button-->
<!--button class="button1" id="save_button" >Save</button-->
<button id="save_button" class="button1">
<i class="fa fa-save" ></i>
</button>
<div class="status-container">
<div id="sensor-info" class="sensor-info-container"></div>
<div class="progress-container" id="progressDiv">
<progress id="progress" value="0" max="100"></progress>
<span class="progress-text" id="progress-percent">0%</span>
</div>
</div>
</div>
</div>
<div id="overlay" class="overlay">
<div class="modal">
<p>
Do you want to save on SPIKE? <br>
<span class="subtitle"> (gives option to save locally first) </span>
</p>
<button id= "Yes-btn" class="btn-yes" >Yes</button>
<button id = "No-btn" class="btn-no" >No</button>
</div>
</div>
<div class="flexBox">
<div class="box left-box">
<textarea id='gitpath'>https://raw.githubusercontent.com/iliketocode2/AI-Puppy-UI/main/Lessons/Main_Lesson1.py https://raw.githubusercontent.com/iliketocode2/AI-Puppy-UI/main/Lessons/CEEO_AI.py </textarea>
<!--<label for="files">Choose a file:</label> -->
<div class="filesDiv">
<select name="files" id="files" class="files">
</select>
</div>
<div class="gifFrame"><img id="gif"></div>
<div class="horizontal-buttons">
<!--<div class="custom-file-input">-->
<input type="file" id="fileRead" style="display: none;"> <!--Hide actual file selector. FileRead id important for JS function-->
<button class="button1" type="button" id="chooseFileButton">
<i class="fa fa-upload"></i>
</button>
<!--</div>-->
<!--button class="button1" id="download-code">Download Code</button-->
<button id="download-code" class="button1">
<i class="fa fa-download"></i>
</button>
<button class="button1" id="sensor_readings">Sensors</button>
</div>
<div class="portInstructions" id="portInfo">
<h3>Port Assignments</h3>
<div class="wrap">
<img src="images/spike push_sensor_display.png" alt="force sensor">
<p>In port</p>
<p class="big">F</p>
</div>
</div>
</div>
<div class="right-container">
<div class="box right-box" id="hide_on_1_and_2">
<div class ="terminalFrame" id="terminalFrameId">Pyscript Editor
<script id="MPcode" type="mpy-editor" env="ble" class="mpy-editor-container"></script>
</div>
</div>
<div class="slider">...</div>
<div class="box right-box" id="resizeBox">
<div class="tab">
<button class="tablinks active" id="customTerminalButton" style="color: black;">Terminal</button>
<button class="tablinks" id="defaultTerminalButton" style="color: black;">Debug</button>
</div>
<div id="debug" class="tabcontent">
<div id="repl"></div>
</div>
<div id="terminal" class="tabcontent">
<div id="terminalMessages">
<div id="customTerminalMessage">Please connect to a SPIKE™ Prime to begin programming.<br><br></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="section go-sections">
<h2>Extended Thinking</h2>
<p>How does changing the amount of training data points collected impact the accuracy of displaying emotions?</p>
<img src="nobgimages/th-removebg-preview (1).png" alt="Your brain if you think about this" width="100px" height="auto">
</div>
<footer>
<p style="text-align: center;">
<img style="height:50px;width:auto;"src="images/tags2.png" alt="intermediate ai animals">
</p>
<p>----------------------------------------------------------------------- ©2024. All rights reserved.Tufts.edu.com -----------------------------------------------------------------------</p>
</footer>
<div class="document-icon-container">
<div class="document-icon">
<div class="checkmark"></div>
</div>
</div>
</body>
</html>