previewPicture.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697
  1. <template>
  2. <div class="pop-up-main">
  3. <div class="paln-box">
  4. <div class="movableItem" :style="{width:width,height:height}" @mousewheel="rollImg($event)"
  5. @mousedown="drag($event,1)" ref="bigImage">
  6. <!-- 图片不可选中 或不可拖拽到新标签打开-->
  7. <slot name="svg" oncontextmenu="return false;" onselectstart="return false;" draggable="false"></slot>
  8. <template v-if="isEdit &&iconWidth">
  9. <img ref="signImage" :src="iconImgUrl" @mousedown="dragSign($event,key)"
  10. v-for="(item,key) in equipment" :key="key"
  11. :style="{top:equipment[key].top+'%',left:equipment[key].left+'%',width:iconWidth,height:iconHeight}"
  12. class="equipment" />
  13. </template>
  14. <el-popover width="200" placement="bottom-start" trigger="hover" :close-delay="100" content="暂无描述"
  15. v-else-if="!isEdit&&iconWidth &&arrIcon.length==equipment.length " v-for="(item,key) in equipment"
  16. :key="key" popper-class="preview-popover">
  17. <!-- &&arrIcon.length==equipment.length -->
  18. <template>
  19. <div v-if="equipment[key].describe" class="describe">
  20. <p class="describe-top">{{equipment[key].describe.deviceName}}</p>
  21. <p class="describe-center">{{equipment[key].describe.remark}}</p>
  22. <p class="describe-bottom">{{equipment[key].describe.location}}</p>
  23. </div>
  24. </template>
  25. <!-- <img oncontextmenu="return false;" onselectstart="return false;" draggable="false" slot="reference"
  26. ref="signImage" :src="$baseUrl + equipment[key].iconImgUrl"
  27. :style="{top:equipment[key].top+'%',left:equipment[key].left+'%',width:arrIcon[key].iconWidth,height:arrIcon[key].iconHeight}"
  28. class="equipment" /> -->
  29. </el-popover>
  30. </div>
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. export default {
  36. props: {
  37. equipment: {
  38. type: Array,
  39. default: () => {
  40. return [{
  41. iconImgUrl: "",
  42. top: 0,
  43. left: 0,
  44. }, ];
  45. },
  46. },
  47. isEdit: {
  48. default: false,
  49. },
  50. imgUrl: {},
  51. },
  52. data() {
  53. return {
  54. // 定时器
  55. timer: "",
  56. // 图片加载失败
  57. imgOnerror: false,
  58. imgIndex: 0,
  59. isChange: true,
  60. // 图片显示默认大小
  61. width: "1400px",
  62. height: "850px",
  63. // 可缩小倍数,为空则可无限缩小
  64. minification: 3,
  65. // 可放大倍数 为空则可无限放大
  66. magnification: "",
  67. bigMaxWidth: 1600,
  68. bigMaxHeight: 800,
  69. // 小图标信息
  70. iconImgUrl: "",
  71. iconWidth: "",
  72. // 存储每个小图标处理好的宽高
  73. iconHeight: "",
  74. arrIcon: [],
  75. iconMaxWidth: 32,
  76. iconMaxHeight: 32,
  77. tog: 1,
  78. };
  79. },
  80. methods: {
  81. // 获取图片大小
  82. getImgInfo(
  83. imgUrl,
  84. MaxWidth,
  85. MaxHeight,
  86. StrWidth,
  87. StrHeight,
  88. Array = false,
  89. arr,
  90. num = 0
  91. ) {
  92. var img = new Image();
  93. // img.src = imgUrl;
  94. img = document.getElementsByClassName("svg")
  95. let _this = this;
  96. img.onerror = () => {
  97. // console.log("加载失败!!", _this.arrIcon.length);
  98. console.log(imgUrl, MaxWidth, MaxHeight, StrWidth, StrHeight);
  99. _this.imgOnerror = true;
  100. _this.imgIndex =
  101. _this.arrIcon.length - 1 < 0 ? 0 : _this.arrIcon.length - 1;
  102. this.timer = setTimeout(() => {
  103. if (num <= 5) {
  104. _this.getImgInfo(
  105. imgUrl,
  106. MaxWidth,
  107. MaxHeight,
  108. StrWidth,
  109. StrHeight,
  110. Array,
  111. arr,
  112. num + 1
  113. );
  114. }
  115. clearInterval(this.timer);
  116. }, 2000);
  117. };
  118. img.onload = function(e) {
  119. // 显示时 初始 最大宽度
  120. let maxWidth = MaxWidth;
  121. // 显示时 初始 最大高度
  122. let maxHeight = MaxHeight;
  123. if (
  124. e.path[0].naturalWidth <= maxWidth &&
  125. e.path[0].naturalHeight <= maxHeight
  126. ) {
  127. _this[StrWidth] = e.path[0].naturalWidth + "px";
  128. _this[StrHeight] = e.path[0].naturalHeight + "px";
  129. } else {
  130. _this[StrWidth] = e.path[0].naturalWidth + "px";
  131. _this[StrHeight] = e.path[0].naturalHeight + "px";
  132. if (
  133. e.path[0].naturalWidth > maxWidth &&
  134. e.path[0].naturalHeight <= maxHeight
  135. ) {
  136. let ratio = e.path[0].naturalWidth / e.path[0].naturalHeight;
  137. _this[StrWidth] = "1600px";
  138. _this[StrHeight] = maxWidth / ratio + "px";
  139. } else if (
  140. e.path[0].naturalWidth <= maxWidth &&
  141. e.path[0].naturalHeight > maxHeight
  142. ) {
  143. let ratio = e.path[0].naturalWidth / e.path[0].naturalHeight;
  144. _this[StrWidth] = maxHeight * ratio + "px";
  145. _this[StrHeight] = "800px";
  146. } else if (
  147. e.path[0].naturalWidth > maxWidth &&
  148. e.path[0].naturalHeight > maxHeight
  149. ) {
  150. let ratio = e.path[0].naturalWidth / e.path[0].naturalHeight;
  151. let w = maxWidth;
  152. let h = w / ratio;
  153. if (h > maxHeight) {
  154. let ratio2 = w / h;
  155. h = maxHeight;
  156. w = h * ratio2;
  157. }
  158. _this[StrWidth] = w + "px";
  159. _this[StrHeight] = h + "px";
  160. }
  161. }
  162. if (Array) {
  163. _this[arr].push({
  164. iconWidth: _this[StrWidth],
  165. iconHeight: _this[StrHeight],
  166. });
  167. console.log(
  168. "tow#################################arrIcon",
  169. _this[arr].length
  170. );
  171. }
  172. // _this[StrWidth] = `${e.path[0].naturalWidth}px`;
  173. // _this[StrHeight] = `${e.path[0].naturalHeight}px`;
  174. // vm.$set(vm.imgInfo, "width", img.width);
  175. // vm.$set(vm.imgInfo, "height", img.height);
  176. // console.log("打印图片信息", imgUrl, _this[StrWidth], _this[StrHeight]); // 打印图片信息
  177. // console.log("打印图片信息", e.path[0].naturalHeight); // 打印图片信息
  178. // console.log("打印图片信息", e); // 打印图片信息
  179. // console.log("打印图片信息this.width", _this[StrWidth]); // 打印图片信息
  180. // console.log("打印图片信息this.height", _this[StrHeight]); // 打印图片信息
  181. };
  182. },
  183. // 缩放
  184. rollImg() {
  185. var that = this;
  186. // var oImg = document.getElementsByClassName("movableItem")[0];
  187. var oImg = this.$refs.bigImage;
  188. console.log(
  189. "length",
  190. document.getElementsByClassName("movableItem").length
  191. );
  192. console.log("oImg", oImg);
  193. var _this = this;
  194. function fnWheel(obj, fncc) {
  195. obj.onmousewheel = fn;
  196. if (obj.addEventListener) {
  197. obj.addEventListener("DOMMouseScroll", fn, false);
  198. }
  199. function fn(ev) {
  200. var oEvent = ev || window.event;
  201. var down = true;
  202. if (oEvent.detail) {
  203. down = oEvent.detail > 0;
  204. } else {
  205. down = oEvent.wheelDelta < 0;
  206. }
  207. if (fncc) {
  208. fncc.call(this, down, oEvent);
  209. }
  210. if (oEvent.preventDefault) {
  211. oEvent.preventDefault();
  212. }
  213. return false;
  214. }
  215. }
  216. fnWheel(oImg, function(down, oEvent) {
  217. var oldWidth = this.offsetWidth;
  218. var oldHeight = this.offsetHeight;
  219. var oldLeft = this.offsetLeft;
  220. var oldTop = this.offsetTop;
  221. var parent = oEvent.path[2];
  222. // 获取父元素距离页面可视区域的位置
  223. var parentLeft = parent.getBoundingClientRect().left;
  224. var parentTop = parent.getBoundingClientRect().top;
  225. // 比例 = (点击位置距离可视窗口位置 - 父元素距离可视窗口位置 - 相对定位的left)/ 本身宽度
  226. var scaleX = (oEvent.clientX - parentLeft - oldLeft) / oldWidth; //比例
  227. var scaleY = (oEvent.clientY - parentTop - oldTop) / oldHeight;
  228. let nowWidth = this.style.width.split("p")[0];
  229. let initWidth = _this.width.split("p")[0];
  230. let initHeight = _this.height.split("p")[0];
  231. let miniFlag = true;
  232. let magniFlag = true;
  233. if (_this.minification) {
  234. // 限制缩小范围
  235. if (nowWidth <= parseInt(initWidth / _this.minification)) {
  236. miniFlag = false;
  237. console.log("限制缩小范围");
  238. console.log(
  239. "限制缩小范围",
  240. nowWidth,
  241. parseInt(initWidth / _this.minification)
  242. );
  243. this.style.width = parseInt(initWidth / _this.minification) + "px";
  244. this.style.height =
  245. parseInt(initHeight / _this.minification) + "px";
  246. }
  247. if (_this.magnification) {
  248. // 限制放大范围
  249. if (nowWidth >= parseInt(initWidth * _this.magnification)) {
  250. magniFlag = false;
  251. console.log("限制放大范围");
  252. this.style.width =
  253. parseInt(initWidth * _this.magnification) + "px";
  254. this.style.height =
  255. parseInt(initHeight * _this.magnification) + "px";
  256. }
  257. }
  258. }
  259. if (down && miniFlag) {
  260. console.log("缩小");
  261. this.style.width = parseInt(this.offsetWidth * 0.9) + "px";
  262. this.style.height = parseInt(this.offsetHeight * 0.9) + "px";
  263. that.width = parseInt(this.offsetWidth * 0.9) + "px";
  264. that.height = parseInt(this.offsetHeight * 0.9) + "px";
  265. } else if (!down && magniFlag) {
  266. console.log("放大");
  267. this.style.width = parseInt(this.offsetWidth * 1.1) + "px";
  268. this.style.height = parseInt(this.offsetHeight * 1.1) + "px";
  269. that.width = parseInt(this.offsetWidth * 1.1) + "px";
  270. that.height = parseInt(this.offsetHeight * 1.1) + "px";
  271. }
  272. var newWidth = this.offsetWidth;
  273. var newHeight = this.offsetHeight;
  274. // 新的相对位置left = 原先的相对位置left - 比例 *(本身新的宽度-旧的宽度)
  275. this.style.left =
  276. Math.round(this.offsetLeft - scaleX * (newWidth - oldWidth)) + "px";
  277. this.style.top =
  278. Math.round(this.offsetTop - scaleY * (newHeight - oldHeight)) + "px";
  279. });
  280. // console.log(that.width)
  281. },
  282. // },
  283. //拖拽
  284. drag(ev) {
  285. // var ie = document.all;
  286. // console.log(ev / 0);
  287. var nn6 = document.getElementById && !document.all;
  288. var isdrag = false;
  289. var y, x;
  290. var nTY, nTX;
  291. var oDragObj;
  292. function moveMouse(e) {
  293. if (isdrag) {
  294. oDragObj.style.top =
  295. (nn6 ? nTY + e.clientY - y : nTY + event.clientY - y) + "px";
  296. oDragObj.style.left =
  297. (nn6 ? nTX + e.clientX - x : nTX + event.clientX - x) + "px";
  298. return false;
  299. }
  300. }
  301. function initDrag(e) {
  302. // console.log("点击图片initDrag");
  303. var oDragHandle = nn6 ? e.target : event.srcElement;
  304. var topElement = "HTML";
  305. while (
  306. oDragHandle.tagName != topElement &&
  307. oDragHandle.className != "movableItem"
  308. ) {
  309. oDragHandle = nn6 ?
  310. oDragHandle.parentNode :
  311. oDragHandle.parentElement;
  312. }
  313. if (oDragHandle.className == "movableItem") {
  314. isdrag = true;
  315. oDragObj = oDragHandle;
  316. // 父元素宽高
  317. let width = e.path[2].offsetWidth;
  318. let height = e.path[2].offsetHeight;
  319. // 这里判断第一次获取不到style 样式 默认为 居中50%
  320. if (oDragObj.style.top == "") {
  321. // nTY = parseInt((50 * height) / 100 + 0);
  322. nTY = 0;
  323. nTX = parseInt((50 * width) / 100 + 0);
  324. } else {
  325. nTY = parseInt(oDragObj.style.top + 0);
  326. nTX = parseInt(oDragObj.style.left + 0);
  327. }
  328. y = nn6 ? e.clientY : event.clientY;
  329. x = nn6 ? e.clientX : event.clientX;
  330. oDragObj.style.cursor = "move";
  331. document.onmousemove = moveMouse;
  332. return false;
  333. }
  334. }
  335. document.onmousemove = initDrag;
  336. // document.onmouseup = new Function("isdrag=false");
  337. document.onmouseup = function(e) {
  338. isdrag = false;
  339. document.onmousemove = null;
  340. document.onmouseup = null;
  341. var oDragHandle = nn6 ? e.target : event.srcElement;
  342. var topElement = "HTML";
  343. while (
  344. oDragHandle.tagName != topElement &&
  345. oDragHandle.className != "movableItem"
  346. ) {
  347. oDragHandle = nn6 ?
  348. oDragHandle.parentNode :
  349. oDragHandle.parentElement;
  350. }
  351. if (oDragHandle.className == "movableItem") {
  352. oDragObj = oDragHandle;
  353. oDragObj.style.cursor = "Default";
  354. }
  355. };
  356. ev = event || window.event;
  357. // 取消事件冒泡行为
  358. // window.event ? (window.event.cancelBubble = true) : ev.stopPropagation();
  359. },
  360. // 拖拽标记
  361. // eslint-disable-next-line no-unused-vars
  362. dragSign(ev, key) {
  363. var nn6 = document.getElementById && !document.all;
  364. var isdrag = false;
  365. var y, x;
  366. var nTY, nTX;
  367. var oDragObj;
  368. let _this = this;
  369. function moveMouse(e) {
  370. if (isdrag) {
  371. this.equipmentKey = key;
  372. // console.log("thisequipmentKey", this.equipmentKey);
  373. let widthItem = e.path[1].style.width.split("p");
  374. let heightItem = e.path[1].style.height.split("p");
  375. let width = widthItem[0];
  376. // eslint-disable-next-line no-unused-vars
  377. let height = heightItem[0];
  378. let top =
  379. ((nn6 ?
  380. (nTY / 100) * height + e.clientY - y :
  381. (nTY / 100) * height + event.clientY - y) /
  382. height) *
  383. 100;
  384. let left =
  385. ((nn6 ?
  386. (nTX / 100) * width + e.clientX - x :
  387. (nTX / 100) * width + event.clientX - x) /
  388. width) *
  389. 100;
  390. if (top >= 0 && top <= 100) {
  391. _this.equipment[key].top = top;
  392. }
  393. if (left >= 0 && left <= 100) {
  394. _this.equipment[key].left = left;
  395. }
  396. return false;
  397. }
  398. }
  399. // eslint-disable-next-line no-unused-vars
  400. function initDrag(e) {
  401. // console.log("_this", _this);
  402. var oDragHandle = nn6 ? e.target : event.srcElement;
  403. var topElement = "HTML";
  404. while (
  405. oDragHandle.tagName != topElement &&
  406. oDragHandle.className.indexOf("equipment") == -1
  407. ) {
  408. oDragHandle = nn6 ?
  409. oDragHandle.parentNode :
  410. oDragHandle.parentElement;
  411. }
  412. if (oDragHandle.className.indexOf("equipment") != -1) {
  413. isdrag = true;
  414. oDragObj = oDragHandle;
  415. // 父元素宽高
  416. let width = e.path[1].offsetWidth;
  417. let height = e.path[1].offsetHeight;
  418. // console.log(width, height);
  419. console.log("oDragObj.style", oDragObj.style);
  420. // 这里判断第一次获取不到style 样式 默认为 居中50%
  421. if (oDragObj.style.top == "") {
  422. nTY = parseInt((50 * height) / 100 + 0);
  423. nTX = parseInt((50 * width) / 100 + 0);
  424. } else if (oDragObj.style.top.indexOf("%") != -1) {
  425. nTY = oDragObj.style.top.split("%")[0];
  426. nTX = oDragObj.style.left.split("%")[0];
  427. } else {
  428. nTY = parseInt(oDragObj.style.top + 0);
  429. nTX = parseInt(oDragObj.style.left + 0);
  430. }
  431. y = nn6 ? e.clientY : event.clientY;
  432. x = nn6 ? e.clientX : event.clientX;
  433. oDragObj.style.cursor = "move";
  434. document.onmousemove = moveMouse;
  435. return false;
  436. }
  437. }
  438. // document.onmousedown = initDrag;
  439. document.onmousemove = initDrag;
  440. document.onmouseup = function(e) {
  441. isdrag = false;
  442. document.onmousemove = null;
  443. document.onmouseup = null;
  444. var oDragHandle = nn6 ? e.target : event.srcElement;
  445. var topElement = "HTML";
  446. while (
  447. oDragHandle.tagName != topElement &&
  448. oDragHandle.className != "equipment"
  449. ) {
  450. oDragHandle = nn6 ?
  451. oDragHandle.parentNode :
  452. oDragHandle.parentElement;
  453. }
  454. if (oDragHandle.className == "equipment") {
  455. oDragObj = oDragHandle;
  456. oDragObj.style.cursor = "Default";
  457. }
  458. };
  459. // _this.equipmentKey = key;
  460. // _this.equipment[_this.equipmentKey].left = l;
  461. // _this.equipment[_this.equipmentKey].top = t;
  462. ev = event || window.event;
  463. // 取消事件冒泡行为
  464. window.event ? (window.event.cancelBubble = true) : ev.stopPropagation();
  465. },
  466. },
  467. watch: {
  468. equipment() {
  469. if (this.equipment.length != 0) {
  470. this.arrIcon = [];
  471. let finish = true;
  472. this.equipment.filter((item) => {
  473. if (!item.iconImgUrl) {
  474. finish = false;
  475. }
  476. return true;
  477. });
  478. console.log("finish", finish);
  479. if (finish) {
  480. this.equipment.filter((item, index) => {
  481. if (index >= this.imgIndex) {
  482. console.log("iconImgUrl", this.equipment[index].iconImgUrl);
  483. this.getImgInfo(
  484. this.$baseUrl + item.iconImgUrl,
  485. this.iconMaxWidth,
  486. this.iconMaxHeight,
  487. "iconWidth",
  488. "iconHeight",
  489. true,
  490. "arrIcon"
  491. );
  492. }
  493. // console.log("22filter", index);
  494. return true;
  495. });
  496. }
  497. }
  498. },
  499. },
  500. created() {
  501. this.getImgInfo(
  502. this.imgUrl,
  503. this.bigMaxWidth,
  504. this.bigMaxHeight,
  505. "width",
  506. "height"
  507. );
  508. if (this.equipment.length != 0) {
  509. this.arrIcon = [];
  510. let finish = true;
  511. this.equipment.filter((item) => {
  512. if (!item.iconImgUrl) {
  513. finish = false;
  514. }
  515. return true;
  516. });
  517. // console.log("finish", finish);
  518. if (finish) {
  519. this.equipment.filter((item, index) => {
  520. if (index >= this.imgIndex) {
  521. console.log("iconImgUrl", this.equipment[index].iconImgUrl);
  522. this.getImgInfo(
  523. this.$baseUrl + item.iconImgUrl,
  524. this.iconMaxWidth,
  525. this.iconMaxHeight,
  526. "iconWidth",
  527. "iconHeight",
  528. true,
  529. "arrIcon"
  530. );
  531. }
  532. // console.log("22filter", index);
  533. return true;
  534. });
  535. }
  536. }
  537. this.iconImgUrl = JSON.parse(
  538. JSON.stringify(this.$baseUrl + this.equipment[0].iconImgUrl)
  539. );
  540. // console.log("imgUrl", this.imgUrl);
  541. // console.log("equipment", this.equipment);
  542. // //禁止鼠标右键
  543. // document.oncontextmenu = function() {
  544. // return false;
  545. // };
  546. },
  547. };
  548. </script>
  549. <style lang="less">
  550. .preview-popover {
  551. background-color: #d3edf7dd;
  552. padding: 12px;
  553. .popper__arrow::after {
  554. border-bottom-color: #d3edf7dd !important;
  555. }
  556. .describe {
  557. p {
  558. padding-bottom: 5px;
  559. &:last-child {
  560. padding-bottom: 0px;
  561. }
  562. }
  563. .describe-top {
  564. // color: sandybrown;
  565. // color: red;
  566. color: rgb(21, 110, 110);
  567. }
  568. .describe-center {
  569. color: rgb(79, 21, 206);
  570. }
  571. .describe-bottom {
  572. color: rgb(30, 31, 29);
  573. }
  574. }
  575. }
  576. </style>
  577. <style lang="less" scoped>
  578. .pop-up-main {
  579. width: 100%;
  580. height: calc(100vh - 10vh);
  581. overflow-y:hidden ;
  582. .paln-box {
  583. width: 100%;
  584. height: 100%;
  585. position: relative;
  586. .movableItem {
  587. position: absolute;
  588. // top: 75%;
  589. left: 50%;
  590. transform: translate(-50%, -10%);
  591. img,
  592. .svg {
  593. z-index: 1;
  594. width: 100%;
  595. height: 100%;
  596. }
  597. .equipment {
  598. position: absolute;
  599. top: 0;
  600. left: 0;
  601. transform: translate(-50%, -50%);
  602. z-index: 2;
  603. font-size: 40px;
  604. // color: red;
  605. // background: blue;
  606. zoom: 1;
  607. }
  608. }
  609. .shuaxin {
  610. position: absolute;
  611. z-index: 2;
  612. font-size: 40px;
  613. top: 20px;
  614. left: 20px;
  615. cursor: pointer;
  616. &:hover {
  617. color: yellowgreen;
  618. }
  619. }
  620. .equipment {
  621. color: white;
  622. }
  623. &/deep/.el-button {
  624. z-index: 2;
  625. position: absolute;
  626. bottom: 60px;
  627. right: 20px;
  628. width: 60px;
  629. height: 35px;
  630. span {
  631. display: inline-block;
  632. position: absolute;
  633. top: 50%;
  634. left: 50%;
  635. transform: translate(-50%, -50%);
  636. }
  637. i {
  638. display: inline-block;
  639. position: absolute;
  640. top: 50%;
  641. left: 25%;
  642. transform: translate(-50%, -50%);
  643. }
  644. }
  645. }
  646. }
  647. // body {
  648. // height: 100%;
  649. // overflow: hidden;
  650. // margin: 0;
  651. // padding: 0;
  652. // }
  653. </style>