3v324v23 commited on
Commit
8441b22
·
1 Parent(s): 63957ad

Boutons des émotions fonctionnels + modifications esthétiques

Browse files
jericho/static/index.html CHANGED
@@ -8,7 +8,7 @@
8
  </head>
9
  <body>
10
  <header>
11
- <h1>Jericho projet : Reachy Mini</h1>
12
  <div id="conteneurHeader">
13
  <img src="static/images/logoReachyMini.png" alt="Photo de Reachy" width="10%" />
14
  <div id="robot-status">Prêt</div>
@@ -31,7 +31,7 @@
31
  </section>
32
 
33
  <section class="card">
34
- <h2>Votre bibliothèque</h2>
35
  <div id="video-library" class="grid-library">
36
  <p class="empty-text">Aucune vidéo enregistrée.</p>
37
  </div>
@@ -43,7 +43,7 @@
43
 
44
  <div class="sync-controls">
45
  <button id="launch-sync-btn" class="btn-success">
46
- [->] Lire vidéo + robot synchronisés
47
  </button>
48
  <p class="sync-hint">
49
  Les pauses, reprises et déplacements dans la vidéo sont envoyés au robot.
@@ -53,7 +53,7 @@
53
  </section>
54
 
55
  <section class="card">
56
- <h2>Les émotions</h2>
57
  <div id="listeEmotions">
58
  <button id="joie">
59
  Joie
 
8
  </head>
9
  <body>
10
  <header>
11
+ <h1>【⚙】Jericho projet : Reachy Mini【⚙】</h1>
12
  <div id="conteneurHeader">
13
  <img src="static/images/logoReachyMini.png" alt="Photo de Reachy" width="10%" />
14
  <div id="robot-status">Prêt</div>
 
31
  </section>
32
 
33
  <section class="card">
34
+ <h2>►► Votre bibliothèque</h2>
35
  <div id="video-library" class="grid-library">
36
  <p class="empty-text">Aucune vidéo enregistrée.</p>
37
  </div>
 
43
 
44
  <div class="sync-controls">
45
  <button id="launch-sync-btn" class="btn-success">
46
+ [►] Lire vidéo + robot synchronisés
47
  </button>
48
  <p class="sync-hint">
49
  Les pauses, reprises et déplacements dans la vidéo sont envoyés au robot.
 
53
  </section>
54
 
55
  <section class="card">
56
+ <h2>☻ Les émotions</h2>
57
  <div id="listeEmotions">
58
  <button id="joie">
59
  Joie
jericho/static/main.js CHANGED
@@ -182,7 +182,7 @@ async function loadLibrary() {
182
  } else {
183
  projects.forEach(video => {
184
  const safeName = escapeHtml(video.name);
185
- const deleteBtn = `<span onclick="deleteProject(event, ${JSON.stringify(video.name).replaceAll('"', '&quot;')})" style="position:absolute; top:2px; right:4px; font-size:16px; cursor:pointer;" title="Supprimer définitivement">x</span>`;
186
 
187
  if (video.status === 'DONE') {
188
  const nameArg = JSON.stringify(video.name).replaceAll('"', '&quot;');
@@ -281,4 +281,96 @@ videoPlayer.addEventListener('ended', () => {
281
  robotStatus.textContent = 'Terminé';
282
  sendPlayback('stop', { playing: false });
283
  stopSyncLoop();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  });
 
182
  } else {
183
  projects.forEach(video => {
184
  const safeName = escapeHtml(video.name);
185
+ const deleteBtn = `<span onclick="deleteProject(event, ${JSON.stringify(video.name).replaceAll('"', '&quot;')})" style="position:absolute; top:2px; right:4px; font-size:16px; cursor:pointer;" title="Supprimer définitivement">✗</span>`;
186
 
187
  if (video.status === 'DONE') {
188
  const nameArg = JSON.stringify(video.name).replaceAll('"', '&quot;');
 
281
  robotStatus.textContent = 'Terminé';
282
  sendPlayback('stop', { playing: false });
283
  stopSyncLoop();
284
+ });
285
+
286
+ let boutonJoie=document.getElementById('joie');
287
+ let boutonContent=document.getElementById('content');
288
+ let boutonSurprise=document.getElementById('surprise');
289
+ let boutonColere=document.getElementById('colere');
290
+ let boutonPeur=document.getElementById('peur');
291
+ let boutonTristesse=document.getElementById('tristesse');
292
+ let boutonNeutre=document.getElementById('neutre');
293
+
294
+ boutonJoie.addEventListener("click", async () => {
295
+ document.querySelectorAll('#listeEmotions button').forEach(b => b.classList.remove('active-emotion'));
296
+ boutonJoie.classList.add('active-emotion');
297
+
298
+ await fetch('/api/emotion', {
299
+ method: 'POST',
300
+ headers: { 'Content-Type': 'application/json' },
301
+ body: JSON.stringify({ emotion: 'JOIE' })
302
+ });
303
+ robotStatus.textContent = 'Émotion : Joie';
304
+ });
305
+
306
+ boutonContent.addEventListener("click", async () => {
307
+ document.querySelectorAll('#listeEmotions button').forEach(b => b.classList.remove('active-emotion'));
308
+ boutonJoie.classList.add('active-emotion');
309
+
310
+ await fetch('/api/emotion', {
311
+ method: 'POST',
312
+ headers: { 'Content-Type': 'application/json' },
313
+ body: JSON.stringify({ emotion: 'CONTENT' })
314
+ });
315
+ robotStatus.textContent = 'Émotion : Content';
316
+ });
317
+
318
+ boutonSurprise.addEventListener("click", async () => {
319
+ document.querySelectorAll('#listeEmotions button').forEach(b => b.classList.remove('active-emotion'));
320
+ boutonJoie.classList.add('active-emotion');
321
+
322
+ await fetch('/api/emotion', {
323
+ method: 'POST',
324
+ headers: { 'Content-Type': 'application/json' },
325
+ body: JSON.stringify({ emotion: 'SURPRISE' })
326
+ });
327
+ robotStatus.textContent = 'Émotion : Surprise';
328
+ });
329
+
330
+ boutonColere.addEventListener("click", async () => {
331
+ document.querySelectorAll('#listeEmotions button').forEach(b => b.classList.remove('active-emotion'));
332
+ boutonJoie.classList.add('active-emotion');
333
+
334
+ await fetch('/api/emotion', {
335
+ method: 'POST',
336
+ headers: { 'Content-Type': 'application/json' },
337
+ body: JSON.stringify({ emotion: 'COLERE' })
338
+ });
339
+ robotStatus.textContent = 'Émotion : Colère';
340
+ });
341
+
342
+ boutonPeur.addEventListener("click", async () => {
343
+ document.querySelectorAll('#listeEmotions button').forEach(b => b.classList.remove('active-emotion'));
344
+ boutonJoie.classList.add('active-emotion');
345
+
346
+ await fetch('/api/emotion', {
347
+ method: 'POST',
348
+ headers: { 'Content-Type': 'application/json' },
349
+ body: JSON.stringify({ emotion: 'PEUR' })
350
+ });
351
+ robotStatus.textContent = 'Émotion : Peur';
352
+ });
353
+
354
+ boutonTristesse.addEventListener("click", async () => {
355
+ document.querySelectorAll('#listeEmotions button').forEach(b => b.classList.remove('active-emotion'));
356
+ boutonJoie.classList.add('active-emotion');
357
+
358
+ await fetch('/api/emotion', {
359
+ method: 'POST',
360
+ headers: { 'Content-Type': 'application/json' },
361
+ body: JSON.stringify({ emotion: 'TRISTESSE' })
362
+ });
363
+ robotStatus.textContent = 'Émotion : Tristesse';
364
+ });
365
+
366
+ boutonNeutre.addEventListener("click", async () => {
367
+ document.querySelectorAll('#listeEmotions button').forEach(b => b.classList.remove('active-emotion'));
368
+ boutonJoie.classList.add('active-emotion');
369
+
370
+ await fetch('/api/emotion', {
371
+ method: 'POST',
372
+ headers: { 'Content-Type': 'application/json' },
373
+ body: JSON.stringify({ emotion: 'NEUTRE' })
374
+ });
375
+ robotStatus.textContent = 'Émotion : Neutre';
376
  });
jericho/static/style.css CHANGED
@@ -135,7 +135,7 @@ input[type="text"], input[type="number"] {
135
  margin-bottom: auto;
136
  padding-top : 0.7%;
137
  padding-bottom : 0.7%;
138
- font-size: 1.3em;
139
  margin-right : 2.5%;
140
  width : 11%;
141
  }
 
135
  margin-bottom: auto;
136
  padding-top : 0.7%;
137
  padding-bottom : 0.7%;
138
+ font-size:1.2vw;
139
  margin-right : 2.5%;
140
  width : 11%;
141
  }