Blame view

pageHTML/couleur.html 1.46 KB
d2bf4d00   Justine Senellart   partie applicatio...
1
2
3
4
5
  <!DOCTYPE html>
  <html lang="en">
  <head>
      <meta charset="UTF-8">
      <title>Changement de couleur</title>
d6d7dbfb   Claire Vandamme   transmission des ...
6
7
8
  
  <script src="jquery.js"></script>
      <script type= "text/javascript">
3e26b079   jsenella   toutes les pages ...
9
10
         window.WebSocket = (window.WebSocket || window.MozWebSocket);
        var websocket = new WebSocket('ws://192.168.43.222:9000', 'myprotocol');
d6d7dbfb   Claire Vandamme   transmission des ...
11
12
        websocket.onerror=function(){ $('h1').css('color','red');};
        websocket.onopen=function(){ $('h1').css('color','green');};
d6d7dbfb   Claire Vandamme   transmission des ...
13
  
f95be3d3   jsenella   envoie donnée int...
14
15
16
17
  	function sendMessage(){
         websocket.send($('#rangevalue').val());
         websocket.send($('#rangevalue1').val());
         	websocket.send($('#rangevalue2').val());
d6d7dbfb   Claire Vandamme   transmission des ...
18
19
20
  	}
      </script>
      
d2bf4d00   Justine Senellart   partie applicatio...
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
  </head>
  <body>
  <h1>Changement de couleur de votre veilleuse connectée</h1>
  <h3>Rouge</h3>
  <div id = "slider">
  <input type ="range" min ="0" max="255" value ="100" onchange = "rangevalue.value=value">
  <span class = "highlight"></span>
  <output id="rangevalue">50</output>
  </div>
  <h3>Vert</h3>
  <div id = "slider1">
      <input type ="range" min ="0" max="255" value ="100" onchange = "rangevalue1.value=value">
      <span class = "highlight"></span>
      <output id="rangevalue1">50</output>
  </div>
  <h3>Bleu</h3>
  <div id = "slider2">
      <input type ="range" min ="0" max="255" value ="100" onchange = "rangevalue2.value=value">
      <span class = "highlight"></span>
      <output id="rangevalue2">50</output>
  </div>
f95be3d3   jsenella   envoie donnée int...
42
43
   <button onclick="sendMessage();">Send</button>
      <div id="messages"></div>
d2bf4d00   Justine Senellart   partie applicatio...
44
45
46
  <h4><a href="Menu.html">Retour</a></h4>
  </body>
  </html>