achievement.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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
  7. name="viewport"
  8. content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0"
  9. />
  10. <title>识别成果</title>
  11. <link rel="stylesheet" href="./static/layui/css/layui.css" />
  12. <style>
  13. body {
  14. background-color: #f6f6f6;
  15. padding: 0;
  16. margin: 0;
  17. }
  18. .achibox {
  19. width: 100%;
  20. height: 100vh;
  21. }
  22. .carousel {
  23. width: 100% !important;
  24. height: 100% !important;
  25. position: relative;
  26. left: 0;
  27. top: 0;
  28. background-color: #f8f8f8;
  29. overflow: hidden;
  30. }
  31. .carousel__list {
  32. position: absolute;
  33. height: 100%;
  34. left: -100%;
  35. top: 0;
  36. display: flex;
  37. flex-wrap: nowrap;
  38. overflow: hidden;
  39. }
  40. .carousel__item {
  41. width: 100vw;
  42. height: 100%;
  43. transition: all 0.3s ease-in;
  44. }
  45. .carousel__item.active {
  46. display: block;
  47. left: 0;
  48. }
  49. .carousel__item.transition {
  50. left: 100%;
  51. }
  52. .img {
  53. width: 100% !important;
  54. height: 100% !important;
  55. }
  56. .topage {
  57. width: 126px;
  58. height: 54px;
  59. background-image: url(./static/images/button.png);
  60. background-repeat: no-repeat;
  61. background-size: 100% 100%;
  62. position: absolute;
  63. top: 25px;
  64. left: 95px;
  65. z-index: 99999;
  66. color: #fff;
  67. line-height: 52px;
  68. /* padding-left: 15px; */
  69. box-sizing: border-box;
  70. /* padding: 8px 15px; */
  71. text-align: center;
  72. }
  73. .achibox .caozuo {
  74. position: absolute;
  75. top: 20px;
  76. right: 20px;
  77. height: 100px;
  78. }
  79. .fangda img,
  80. .suoxiao img {
  81. width: 24px;
  82. height: 24px;
  83. }
  84. .carousel-arrow {
  85. width: 60px;
  86. height: 60px;
  87. font-size: 35px;
  88. position: absolute;
  89. top: 50%;
  90. margin-top: -18px;
  91. line-height: 36px;
  92. text-align: center;
  93. border: 0;
  94. border-radius: 50%;
  95. background-color: rgba(0, 0, 0, 0.2);
  96. color: #fff;
  97. transition-duration: 0.3s;
  98. cursor: pointer;
  99. }
  100. .carousel-arrow.right {
  101. right: 10px;
  102. }
  103. .carousel-arrow.left {
  104. left: 10px;
  105. }
  106. .carousel-ind {
  107. position: absolute;
  108. width: 100%;
  109. left: 0;
  110. bottom: 36px;
  111. line-height: 0 !important;
  112. text-align: center;
  113. font-size: 0;
  114. }
  115. .carousel-ind ul {
  116. display: inline-block;
  117. padding: 5px;
  118. background-color: rgba(0, 0, 0, 0.2);
  119. border-radius: 10px;
  120. -webkit-transition-duration: 0.3s;
  121. transition-duration: 0.3s;
  122. }
  123. .carousel-ind li {
  124. display: inline-block;
  125. width: 10px;
  126. height: 10px;
  127. margin: 0 3px;
  128. font-size: 14px;
  129. background-color: #e2e2e2;
  130. background-color: rgba(255, 255, 255, 0.5);
  131. border-radius: 50%;
  132. cursor: pointer;
  133. -webkit-transition-duration: 0.3s;
  134. transition-duration: 0.3s;
  135. }
  136. .carousel-ind li.active {
  137. background-color: #fff;
  138. }
  139. </style>
  140. </head>
  141. <body>
  142. <div class="achibox" id="recognbox">
  143. <div class="carousel" id="carousel">
  144. <div class="carousel__list" id="carousel__container">
  145. <div class="carousel__item">
  146. <img src="./static/images/1.jpg" class="img" />
  147. </div>
  148. <div class="carousel__item">
  149. <img src="./static/images/2.jpg" class="img" />
  150. </div>
  151. <div class="carousel__item">
  152. <img src="./static/images/3.jpg" class="img" />
  153. </div>
  154. <div class="carousel__item">
  155. <img src="./static/images/4.jpg" class="img" />
  156. </div>
  157. <div class="carousel__item">
  158. <img src="./static/images/5.jpg" class="img" />
  159. </div>
  160. </div>
  161. <div class="carousel-ind" id="carousel-ind">
  162. <ul>
  163. <li></li>
  164. <li></li>
  165. <li></li>
  166. <li></li>
  167. <li></li>
  168. </ul>
  169. </div>
  170. <div>
  171. <i class="layui-icon layui-icon-left"></i>
  172. </div>
  173. <div>
  174. <i class="layui-icon layui-icon-right"></i>
  175. </div>
  176. <button
  177. class="layui-icon carousel-arrow layui-icon-left left"
  178. onclick="prePage()"
  179. ></button>
  180. <button
  181. class="layui-icon carousel-arrow layui-icon-right right"
  182. onclick="next()"
  183. ></button>
  184. </div>
  185. <div class="topage" onclick="topage()">
  186. <i class="el-icon-back"></i>
  187. 返 回
  188. </div>
  189. <div class="caozuo">
  190. <div class="fangda" id="fangda" onclick="btnClick()">
  191. <img src="./static/images/index/fangda.png" alt="" />
  192. </div>
  193. <div class="suoxiao" id="suoxiao" onclick="exitFullScreen()">
  194. <img src="./static/images/index/suoxiao.png" alt="" />
  195. </div>
  196. </div>
  197. </div>
  198. </body>
  199. <script src="./static/js/touch.js"></script>
  200. <script type="text/javascript">
  201. var container = document.querySelector('#carousel');
  202. var bannerList = container.querySelectorAll('.carousel__item');
  203. var carouselLen = bannerList.length;
  204. var offsetWidth = container.querySelector('.carousel__item').offsetWidth;
  205. var carouselList = document.querySelector('#carousel__container');
  206. var firstBannerEl = bannerList[0];
  207. var lastBannerEl = bannerList[carouselLen - 1];
  208. var dotListContainer = document.querySelector('#carousel-ind');
  209. var dotList = dotListContainer.querySelectorAll('li');
  210. carouselList.appendChild(firstBannerEl.cloneNode(true));
  211. carouselList.insertBefore(lastBannerEl.cloneNode(true), firstBannerEl);
  212. dotList[0].setAttribute('class', 'active');
  213. var isCanClick = true;
  214. var scrollCardContainer = {
  215. el: carouselList,
  216. timer: null,
  217. };
  218. var obj = {
  219. index: 0,
  220. };
  221. var interval = 500;
  222. function next() {
  223. startAnimation(obj.index, 'next');
  224. }
  225. function prePage() {
  226. startAnimation(obj.index, 'pre');
  227. }
  228. function startAnimation(currentIndex, direction) {
  229. if (!isCanClick) {
  230. return;
  231. }
  232. isCanClick = false;
  233. var nextOffsetWidth = 0;
  234. var nextIndex = currentIndex;
  235. if (direction == 'next') {
  236. nextIndex++;
  237. } else {
  238. nextIndex--;
  239. }
  240. nextOffsetWidth = -offsetWidth * (nextIndex + 1);
  241. move(
  242. scrollCardContainer,
  243. 'left',
  244. nextOffsetWidth,
  245. Math.max((offsetWidth / interval) * 20, 1),
  246. nextIndex,
  247. (nextIndexCallback) => {
  248. var transIndex = nextIndexCallback;
  249. if (transIndex >= carouselLen) {
  250. carouselList.style.left = '-100%';
  251. transIndex = 0;
  252. } else if (transIndex < 0) {
  253. carouselList.style.left = -100 * carouselLen + '%';
  254. transIndex = carouselLen - 1;
  255. }
  256. obj.index = transIndex;
  257. dotList.forEach((el) => {
  258. el.classList.remove('active');
  259. });
  260. dotList[obj.index].setAttribute('class', 'active');
  261. isCanClick = true;
  262. }
  263. );
  264. }
  265. initTouchEventHandler(document, {
  266. touchstart: function () {},
  267. moveleft: function () {
  268. next();
  269. },
  270. moveright: function () {
  271. prePage();
  272. },
  273. touchlongpress: function () {},
  274. touchclick: function () {},
  275. });
  276. function topage() {
  277. window.location.href = './index.html';
  278. }
  279. </script>
  280. </html>