Back to Parent

<!DOCTYPE html>
<html>
<head>

  <script charset="utf-8" src=
  "http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type=
  "text/javascript">
  </script>
  <style>
        body {
          background-color:#fff;
          margin:0;
          padding:0;
        }
        /* CENTERED HEADER */
        .dead-center {
            position: fixed;
            top: 50%;
            left: 50%;
            width: 300px;
            height: 108px;
            margin-left: -150px;
            margin-top: -54px;
            z-index:1;  
        }
        h1 {
            color:#fff;
            text-align:center;
            font-size:xx-large;
            font-family:helvetica;
        }
        
        #log {
            position:absolute;
            margin: 20px;
        }
  </style>
  <title></title>
</head>
<body>
  <pre id="log">
</pre>
  <div class="dead-center">
    <h1 id="ledState"></h1>
  </div>
  <script type="text/javascript">
        var CORE_ID = '1c0035001347343339383037';
        
        $(document).ready(function() {
            updateLedState();
        });
        
        setInterval(function(){
            updateLedState();
            updateLog();
        }, 1000);
        
        function updateLedState(){
            $.getJSON('./proxy.php?'+CORE_ID+'/lockState', function(response) {
                
                if(response.result == 1){
                    $("#ledState").html("UNLOCKED");
                    $("body").css("background-color","#50E3C2");
                }
                else if(response.result == 0){
                    $("#ledState").html("LOCKED");
                    $("body").cscs("background-color","#D0021B");
                }
                else{
                    $("#ledState").html("ERROR");
                    $("body").css("background-color","#F5A623");
                }
                
            });
        }
        
        function updateLog(){
            $.get( './history.txt', function(response){
                $("#log").html(response);
            });
        }
  </script>
</body>
</html>
Click to Expand

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

1