Blame view

Application_raspberryJustine/pageHTML/Menu.html 1.43 KB
c974479b   csaad   réorganisation de...
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
  <!DOCTYPE html>
  <html lang="en">
    <head>
      <meta charset="UTF-8">
      <link rel="stylesheet" href="Menu.css" />
      <title>Menu Veilleuse connectée</title>
      
      <script src="jquery.js"></script>
      <script type= "text/javascript">
        window.WebSocket = (window.WebSocket || window.MozWebSocket);
        var websocket = new WebSocket('ws://192.168.43.222:9000', 'myprotocol');
        websocket.onerror=function(){ $('h1').css('color','red');};
        websocket.onopen=function(){ $('h1').css('color','green');};
  
  	function sendMessage(){
  	websocket.send($('#onoffswitch').is(':checked'));
  	}
  	
      </script>
      
     
    </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">
          <span class="onoffswitch-inner"></span>
          <span class="onoffswitch-switch"></span>
        </label>
      </div>
      <button onclick="sendMessage();">Send</button>
      <div id="messages"></div>
    </body>
  </html>