Blame view

pageHTML/Menu.html 1.51 KB
d2bf4d00   Justine Senellart   partie applicatio...
1
  <!DOCTYPE html>
3e26b079   jsenella   toutes les pages ...
2
  <html lang="en">
9d49ca3a   jsenella   essais
3
    <head>
d2bf4d00   Justine Senellart   partie applicatio...
4
      <meta charset="UTF-8">
3e26b079   jsenella   toutes les pages ...
5
6
7
      <link rel="stylesheet" href="Menu.css" />
      <title>Menu Veilleuse connectée</title>
      
9d49ca3a   jsenella   essais
8
9
      <script src="jquery.js"></script>
      <script type= "text/javascript">
3e26b079   jsenella   toutes les pages ...
10
11
        window.WebSocket = (window.WebSocket || window.MozWebSocket);
        var websocket = new WebSocket('ws://192.168.43.222:9000', 'myprotocol');
9d49ca3a   jsenella   essais
12
13
14
        websocket.onerror=function(){ $('h1').css('color','red');};
        websocket.onopen=function(){ $('h1').css('color','green');};
        
9d49ca3a   jsenella   essais
15
16
17
18
19
        webscket.onmessage=function(message){
        console.log(message.data);
        $('#messages').append($('<p>',{ text: message.data}));
  	};
  	
7ea3ba64   Claire Vandamme   transmission des ...
20
21
22
23
  	function etat(){
  	var message=$('#myonoffswitch').checked;
  	websocket.send(message);
  	}
3e26b079   jsenella   toutes les pages ...
24
  	
9d49ca3a   jsenella   essais
25
26
      </script>
      
3e26b079   jsenella   toutes les pages ...
27
     
9d49ca3a   jsenella   essais
28
29
30
31
32
33
34
35
36
37
38
39
40
41
    </head>
    
    <body>
      <h1 class = "introduction">Bienvenue sur le menu de votre veilleuse connectée</h1>
      
      <ul class = "choix">
        <li><h2><a href="intensite.html">Changement de l'intensité</a></h2></li>
        <li><h2><a href = "couleur.html">Changement de la couleur</a></h2></li>
        <li><h2><a href = "mode.html">Sélection du mode</a></h2></li>
      </ul>
      <h4 classe = "etat">Etat de la veilleuse</h4>
      <div class="onoffswitch">
        <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch" checked>
        <label class="onoffswitch-label" for="myonoffswitch">
d2bf4d00   Justine Senellart   partie applicatio...
42
43
          <span class="onoffswitch-inner"></span>
          <span class="onoffswitch-switch"></span>
9d49ca3a   jsenella   essais
44
45
46
        </label>
      </div>
    </body>
d2bf4d00   Justine Senellart   partie applicatio...
47
  </html>