maizediscern.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>玉米虫害识别</title>
  8. <style>
  9. body {
  10. margin: 0;
  11. padding: 0;
  12. }
  13. /* @font-face {
  14. font-family: zhanti;
  15. src: url("./static/font/zhanti.ttf");
  16. } */
  17. .recognbox {
  18. width: 100%;
  19. height: 100vh;
  20. position: relative;
  21. overflow: hidden;
  22. background-color: #101010;
  23. }
  24. .videobox {
  25. width: 100%;
  26. height: 100%;
  27. overflow: hidden;
  28. }
  29. .iframebox {
  30. position: absolute;
  31. top: 50px;
  32. left: 0px;
  33. width: 100%;
  34. height: 100%;
  35. z-index: 100;
  36. text-align: center;
  37. }
  38. .iframeboxvideo {
  39. position: absolute;
  40. top: 50px;
  41. left: 0px;
  42. width: 100%;
  43. height: 100%;
  44. z-index: 100;
  45. text-align: center;
  46. }
  47. .iframebox img {
  48. width: 61%;
  49. height: 90%;
  50. margin: 0 auto;
  51. }
  52. .iframeboxvideo video {
  53. width: 61%;
  54. height: 90%;
  55. margin: 0 auto;
  56. }
  57. .iframeboxbig,
  58. .iframeboxvideo2 {
  59. position: absolute;
  60. top: 0;
  61. left: 0px;
  62. width: 100%;
  63. height: 100%;
  64. z-index: 100;
  65. text-align: center;
  66. overflow-y: auto;
  67. overflow-x: auto;
  68. }
  69. .borbox {
  70. position: absolute;
  71. top: 0px;
  72. left: 0px;
  73. width: 100%;
  74. height: 100%;
  75. z-index: 99;
  76. }
  77. .bg {
  78. width: 100%;
  79. height: 100%;
  80. }
  81. .shang {
  82. position: absolute;
  83. top: -10px;
  84. left: 1.8%;
  85. width: 100%;
  86. height: 80px;
  87. }
  88. .tilte {
  89. position: absolute;
  90. top: 0;
  91. left: 0;
  92. width: 100%;
  93. height: 60px;
  94. /* font-family: zhanti; */
  95. color: #fff;
  96. text-align: center;
  97. line-height: 50px;
  98. font-size: 26px;
  99. margin: 0;
  100. }
  101. .xia {
  102. position: absolute;
  103. bottom: -10px;
  104. left: 1.8%;
  105. width: 100%;
  106. height: 80px;
  107. }
  108. .borbox_menu {
  109. position: absolute;
  110. width: 60%;
  111. top: 50%;
  112. left: 20%;
  113. margin-top: -182px;
  114. display: flex;
  115. justify-content: space-around;
  116. }
  117. .borbox_menu .menu_item {
  118. width: 25%;
  119. background-image: url("./static/images/card.png");
  120. background-size: 100% 100%;
  121. padding: 20px;
  122. box-sizing: border-box;
  123. }
  124. .borbox_menu .menu_item p:first-child {
  125. font-size: 28px;
  126. /* font-family: zhanti; */
  127. color: #fff;
  128. }
  129. .borbox_menu .menu_item p:nth-child(2) {
  130. font-size: 16px;
  131. color: #fff;
  132. margin-top: 15px;
  133. }
  134. .borbox_menu .menu_item .itemimg {
  135. width: 100%;
  136. }
  137. .menu_item:hover {
  138. background-image: url("./static/images/card2.png");
  139. background-size: 100% 100%;
  140. }
  141. .topage {
  142. width: 126px;
  143. height: 54px;
  144. background-image: url(./static/images/button.png);
  145. background-repeat: no-repeat;
  146. background-size: 100% 100%;
  147. position: absolute;
  148. top: 25px;
  149. left: 95px;
  150. z-index: 99999;
  151. color: #fff;
  152. line-height: 52px;
  153. /* padding-left: 15px; */
  154. box-sizing: border-box;
  155. /* padding: 8px 15px; */
  156. text-align: center;
  157. }
  158. .bofang {
  159. position: absolute;
  160. top: 80px;
  161. right: 230px;
  162. z-index: 99999;
  163. }
  164. .caozuo {
  165. position: absolute;
  166. top: 20px;
  167. right: 20px;
  168. height: 100px;
  169. z-index: 9999;
  170. }
  171. .fangda img,
  172. .suoxiao img {
  173. width: 24px;
  174. height: 24px;
  175. }
  176. </style>
  177. </head>
  178. <body>
  179. <div class="recognbox" id="recognbox">
  180. <div class="videobox">
  181. <video controls="controls" muted="muted" autoplay="autoplay" loop="loop" class="fillWidth" id="fillWidths">
  182. <source src="https://zhanting-shibie.oss-cn-hangzhou.aliyuncs.com/1.mp4" type="video/mp4" />
  183. </video>
  184. </div>
  185. <div class="borbox">
  186. <img src="./static/images/shipinbianyuanheichang.png" alt="" class="bg" v-show="btntf" />
  187. <img src="./static/images/shang.png" alt="" class="shang" />
  188. <img src="./static/images/xia.png" alt="" class="xia" />
  189. <p class="tilte">玉米虫害识别</p>
  190. </div>
  191. <div class="topage" onclick="topage()">
  192. <i class="el-icon-back"></i>
  193. 返 回
  194. </div>
  195. <div class="bofang" onclick="bofang()">
  196. <img src="./static/images/bo.png" alt="">
  197. </div>
  198. <div class="iframebox" id="iframebox">
  199. <img src="http://192.168.100.100:5000/video_feed/Camera_0" id="img1" alt="" onclick="getweizhi()" />
  200. </div>
  201. <div class="iframeboxvideo" id="iframeboxvideo">
  202. <video muted="muted" autoplay="autoplay" loop="loop" src="https://zhanting-shibie.oss-cn-hangzhou.aliyuncs.com/rice-logo-5fps.mp4"
  203. onclick="getweizhi2()" id="video1"></video>
  204. </div>
  205. <div class="iframeboxbig" id="iframeboxbig">
  206. <img src="http://192.168.100.100:5000/video_feed/Camera_0" id="img2" alt="" onclick="suofang()" />
  207. </div>
  208. <div class="caozuo">
  209. <div class="fangda" id="fangda" onclick="btnClick()">
  210. <img src="./static/images/index/fangda.png" alt="">
  211. </div>
  212. <div class="suoxiao" id="suoxiao" onclick="exitFullScreen()">
  213. <img src="./static/images/index/suoxiao.png" alt="">
  214. </div>
  215. </div>
  216. <script src="./static/js/jquery-2.1.4.min.js"></script>
  217. <script src="./static/js/show.js"></script>
  218. <script>
  219. $("#iframeboxvideo").hide()
  220. let IMG = new Image();
  221. IMG.src = "http://192.168.100.100:5000/video_feed/Camera_0";
  222. IMG.onerror = () => {
  223. // _this.imgSrc = 验证失败后需要改的src;
  224. console.log("11111")
  225. $("#iframeboxvideo").show()
  226. $("#iframebox").hide()
  227. }
  228. function topage() {
  229. window.location.href = "./index.html"
  230. }
  231. function bofang() {
  232. $("#iframeboxvideo").show()
  233. $("#iframebox").hide()
  234. }
  235. $("#iframeboxbig").hide()
  236. function getweizhi() {
  237. // console.log()
  238. var e = event || window.event;
  239. var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
  240. var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
  241. var x = e.pageX || e.clientX + scrollX;
  242. var y = e.pageY || e.clientY + scrollY;
  243. console.log(x, y)
  244. // 1171 843
  245. // 4000 2250
  246. var winw = window.screen.width
  247. var winh = window.screen.height
  248. var img1h = $("#img1").offset().top
  249. var img1w = $("#img1").offset().left
  250. var width1 = $("#img1").width()
  251. var height1 = $("#img1").height()
  252. // console.log(img1width)
  253. $("#iframeboxbig").show()
  254. $("#iframeboxbig").css("overflow", "scroll")
  255. var width2 = $("#img2").width()
  256. var height2 = $("#img2").height()
  257. var biliy = (y - img1h) / height1 * height2 - winh / 2
  258. var bilix = (x - img1w) / width1 * width2 - winw / 2
  259. $("#iframeboxbig").scrollTop(biliy)
  260. $("#iframeboxbig").scrollLeft(bilix)
  261. // console.log($("#img1").width)
  262. }
  263. function suofang() {
  264. $("#iframeboxbig").hide()
  265. }
  266. var flag = 1
  267. function getweizhi2() {
  268. // console.log()
  269. if (flag % 2 == 1) {
  270. var e = event || window.event;
  271. var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
  272. var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
  273. var x = e.pageX || e.clientX + scrollX;
  274. var y = e.pageY || e.clientY + scrollY;
  275. console.log(x, y)
  276. // 1171 843
  277. // 4000 2250
  278. var winw = window.screen.width
  279. var winh = window.screen.height
  280. var img1h = $("#video1").offset().top
  281. var img1w = $("#video1").offset().left
  282. // console.log(img1width)
  283. var width1 = $("#video1").width()
  284. var height1 = $("#video1").height()
  285. $("#iframeboxvideo").removeClass("iframeboxvideo")
  286. $("#iframeboxvideo").addClass("iframeboxvideo2")
  287. var width2 = $("#video1").width()
  288. var height2 = $("#video1").height()
  289. var biliy = (y - img1h) / height1 * height2 - winh / 2
  290. var bilix = (x - img1w) / width1 * width2 - winw / 2
  291. $("#iframeboxvideo").scrollTop(biliy)
  292. $("#iframeboxvideo").scrollLeft(bilix)
  293. } else {
  294. $("#iframeboxvideo").addClass("iframeboxvideo")
  295. $("#iframeboxvideo").removeClass("iframeboxvideo2")
  296. }
  297. flag++
  298. }
  299. function suofang2() {
  300. $("#iframeboxbig2").hide()
  301. }
  302. </script>
  303. </div>
  304. </body>
  305. </html>