esp32cam.std.hd.imuslab.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <html>
  2. <head>
  3. <title>esp32cam_driver</title>
  4. <link rel="stylesheet" href="basic/tocas.css">
  5. <script src="basic/jquery.min.js"></script>
  6. <style>
  7. #button{
  8. background-color:#262626;
  9. }
  10. .center{
  11. display:fixed;
  12. left:0px;
  13. top:0px;
  14. width:100%;
  15. height:100%;
  16. }
  17. </style>
  18. </head>
  19. <body>
  20. <div id="ipv4" style="position:fixed;top:3px;left:3px;z-index:10;color:white;"><?php echo $_GET['ip'];?></div>
  21. <div id="button" style="width:100%;height:100%;position:fixed;left:0px;top:0px;">
  22. <img id="capture" class="center" src="" onClick="openNewWindow();"></img>
  23. </div>
  24. <div id="uuid" style="position:fixed;bottom:3px;left:3px;color:white;"></div>
  25. <script>
  26. startConnection();
  27. uuid();
  28. function startConnection(){
  29. $("#capture").attr("src","http://<?php echo $_GET['ip'];?>/capture?_cb=" + (new Date().getTime()));
  30. setTimeout(startConnection,1000);
  31. }
  32. function openNewWindow(){
  33. window.open(window.location);
  34. }
  35. function uuid(){
  36. $.ajax({url: "http://<?php echo $_GET['ip'];?>/uuid", success: function(result){
  37. $("#uuid").text(result);
  38. getNickName();
  39. }});
  40. }
  41. function getNickName(){
  42. $.ajax({url: "../nicknameman.php?uuid=" + $("#uuid").text().trim(), success: function(result){
  43. if (result.includes("ERROR") == false){
  44. $("#uuid").text(result);
  45. getIcon();
  46. }else{
  47. }
  48. }});
  49. }
  50. function getIcon(){
  51. $.ajax({url: "../nicknameman.php?nickname=" + $("#uuid").text().trim(), success: function(result){
  52. if (result.includes("true") == true){
  53. $("#icon").attr('src','../img/icons/'+ $("#uuid").text().trim() +'.png');
  54. }
  55. }});
  56. }
  57. </script>
  58. </body>
  59. </html>