fanlocalAnimate2.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  1. <template>
  2. <view style="width: 100%; height: 100%">
  3. <div class="ventilate" id="topPic">
  4. <!-- 进风箭头 -->
  5. <div
  6. :class="
  7. nowfengji == '2' ? 'arrow1' : nowfengji == '1' ? 'arrow1-fan1' : ''
  8. "
  9. id="arrow1"
  10. ></div>
  11. <div
  12. :class="
  13. nowfengji == '2' ? 'arrow2' : nowfengji == '1' ? 'arrow2-fan1' : ''
  14. "
  15. id="arrow2"
  16. ></div>
  17. <div
  18. :class="
  19. nowfengji == '2' ? 'arrow3' : nowfengji == '1' ? 'arrow3-fan1' : ''
  20. "
  21. id="arrow3"
  22. ></div>
  23. <div
  24. :class="
  25. nowfengji == '2' ? 'arrow4' : nowfengji == '1' ? 'arrow4-fan1' : ''
  26. "
  27. id="arrow4"
  28. ></div>
  29. <div
  30. :class="
  31. nowfengji == '2' ? 'arrow5' : nowfengji == '1' ? 'arrow5-fan1' : ''
  32. "
  33. id="arrow5"
  34. ></div>
  35. <div
  36. :class="
  37. nowfengji == '2' ? 'arrow6' : nowfengji == '1' ? 'arrow6-fan1' : ''
  38. "
  39. id="arrow6"
  40. ></div>
  41. <div
  42. :class="
  43. nowfengji == '2' ? 'arrow7' : nowfengji == '1' ? 'arrow7-fan1' : ''
  44. "
  45. id="arrow7"
  46. ></div>
  47. <div
  48. :class="
  49. nowfengji == '2' ? 'arrow8' : nowfengji == '1' ? 'arrow8-fan1' : ''
  50. "
  51. id="arrow8"
  52. ></div>
  53. <div
  54. :class="
  55. nowfengji == '2' ? 'arrow9' : nowfengji == '1' ? 'arrow9-fan1' : ''
  56. "
  57. id="arrow9"
  58. ></div>
  59. <div
  60. :class="
  61. nowfengji == '2' ? 'arrow10' : nowfengji == '1' ? 'arrow10-fan1' : ''
  62. "
  63. id="arrow10"
  64. ></div>
  65. <div
  66. style="top: 14%; left: 18%"
  67. v-if="nowfengji == '1'"
  68. class="devfan1"
  69. ></div>
  70. <div
  71. style="top: 14%; left: 27.5%"
  72. v-if="nowfengji == '1'"
  73. class="devfan1"
  74. ></div>
  75. <div
  76. style="bottom: 13%; left: 18%"
  77. v-if="nowfengji == '2'"
  78. class="devfan1"
  79. ></div>
  80. <div
  81. style="bottom: 13%; left: 27.5%"
  82. v-if="nowfengji == '2'"
  83. class="devfan1"
  84. ></div>
  85. <div style="top: 3%; left: 9%" class="state1" v-if="nowfengji == '1'">
  86. 运行
  87. </div>
  88. <div style="top: 3%; left: 9%" class="state2" v-else>停止</div>
  89. <div style="top: 3%; left: 34%" class="state1" v-if="nowfengji == '1'">
  90. 运行
  91. </div>
  92. <div style="top: 3%; left: 34%" class="state2" v-else>停止</div>
  93. <div style="bottom: 25%; left: 9%" class="state1" v-if="nowfengji == '2'">
  94. 运行
  95. </div>
  96. <div style="bottom: 25%; left: 9%" class="state2" v-else>停止</div>
  97. <div
  98. style="bottom: 25%; left: 34%"
  99. class="state1"
  100. v-if="nowfengji == '2'"
  101. >
  102. 运行
  103. </div>
  104. <div style="bottom: 25%; left: 34%" class="state2" v-else>停止</div>
  105. <div style="top: 17%; right: 41%" class="textshow">主风机</div>
  106. <div style="bottom: 15%; right: 41%" class="textshow">备风机</div>
  107. <div style="top: 32%; left: 6%" class="textshow2">前级电机</div>
  108. <div style="top: 32%; left: 34%" class="textshow2">后级电机</div>
  109. <div style="bottom: -2%; left: 6%" class="textshow2">前级电机</div>
  110. <div style="bottom: -2%; left: 34%" class="textshow2">后级风机</div>
  111. </div>
  112. </view>
  113. </template>
  114. <script>
  115. export default {
  116. data() {
  117. return {
  118. nowfengji: "",
  119. };
  120. },
  121. props: {
  122. mainFanText: {
  123. type: String,
  124. default: "主风机",
  125. },
  126. subFanText: {
  127. type: String,
  128. default: "备风机",
  129. },
  130. fan1State: {
  131. type: String,
  132. default: "",
  133. },
  134. fan2State: {
  135. type: String,
  136. default: "",
  137. },
  138. },
  139. methods: {
  140. setnowfengji(val) {
  141. if (this.nowfengji != val) {
  142. this.nowfengji = val;
  143. this.setFengjiDonghua();
  144. }
  145. },
  146. setFengjiDonghua() {
  147. if (this.nowfengji == "2") {
  148. } else if (this.nowfengji == "1") {
  149. } else {
  150. }
  151. },
  152. setNowStart() {
  153. if (this.fan1State == "1") {
  154. this.nowfengji = "1";
  155. } else if (this.fan2State == "1") {
  156. this.nowfengji = "2";
  157. } else {
  158. this.nowfengji = "";
  159. }
  160. },
  161. },
  162. watch: {
  163. fan1State(val) {
  164. this.setNowStart();
  165. },
  166. fan2State(val) {
  167. this.setNowStart();
  168. },
  169. },
  170. onLoad(query) {
  171. this.setFengjiDonghua();
  172. },
  173. };
  174. </script>
  175. <style scoped>
  176. div.ventilate {
  177. width: 100%;
  178. height: 200px;
  179. min-height: 200px;
  180. min-width: 300px;
  181. background-image: url(/static/fan/fan.png);
  182. background-size: 100% 100%;
  183. perspective: 800px;
  184. }
  185. .state1 {
  186. position: absolute;
  187. z-index: 2;
  188. width: 8%;
  189. height: 14px;
  190. padding-bottom: 5px;
  191. padding-left: 3px;
  192. background-color: rgba(78, 155, 1, 0.438);
  193. border: none;
  194. color: rgb(255, 255, 255);
  195. font-size: 12px;
  196. }
  197. .state2 {
  198. position: absolute;
  199. z-index: 2;
  200. width: 8%;
  201. height: 14px;
  202. padding-bottom: 5px;
  203. padding-left: 3px;
  204. background-color: rgba(167, 42, 11, 0.5);
  205. border: none;
  206. color: rgb(206, 206, 212);
  207. font-size: 12px;
  208. }
  209. .textshow {
  210. position: absolute;
  211. z-index: 2;
  212. color: rgb(20, 19, 19);
  213. font-size: 16px;
  214. }
  215. .textshow2 {
  216. position: absolute;
  217. z-index: 2;
  218. color: rgb(100, 106, 136);
  219. font-size: 14px;
  220. }
  221. .devfan1,
  222. .devfan2 {
  223. position: absolute !important;
  224. z-index: 2;
  225. min-width: 20px;
  226. min-height: 20px;
  227. height: 22px;
  228. width: 22px;
  229. background-image: url(/static/fan/devFan.png);
  230. background-size: 100% 100%;
  231. }
  232. .devfan1 {
  233. position: relative;
  234. animation: rotate1 3s infinite linear;
  235. /* Safari 和 Chrome */
  236. -webkit-animation: rotate1 3s infinite linear;
  237. }
  238. @keyframes rotate1 {
  239. 0% {
  240. -webkit-transform: rotate(0deg);
  241. opacity: 1;
  242. }
  243. 100% {
  244. -webkit-transform: rotate(360deg);
  245. opacity: 1;
  246. }
  247. }
  248. div.arrow1,
  249. div.arrow2,
  250. div.arrow3,
  251. div.arrow4,
  252. div.arrow5,
  253. div.arrow6,
  254. div.arrow7,
  255. div.arrow8,
  256. div.arrow9,
  257. div.arrow10,
  258. div.arrow1-fan1,
  259. div.arrow2-fan1,
  260. div.arrow3-fan1,
  261. div.arrow4-fan1,
  262. div.arrow5-fan1,
  263. div.arrow6-fan1,
  264. div.arrow7-fan1,
  265. div.arrow8-fan1,
  266. div.arrow9-fan1,
  267. div.arrow10-fan1 {
  268. position: absolute;
  269. right: 40px;
  270. opacity: 0;
  271. top: 96px;
  272. width: 30px;
  273. height: 15px;
  274. box-sizing: border-box;
  275. float: right;
  276. z-index: 1;
  277. transition: all 2s ease;
  278. background-image: url(/static/fan/arrow-in.png);
  279. background-size: 100% 100%;
  280. }
  281. </style>
  282. <style scoped>
  283. .arrow1 {
  284. position: relative;
  285. animation: myfirst1 20s infinite linear;
  286. /* Safari 和 Chrome */
  287. -webkit-animation: myfirst1 20s infinite linear;
  288. }
  289. @keyframes myfirst1 {
  290. 0% {
  291. left: -5%;
  292. top: 80%;
  293. -webkit-transform: rotate(180deg);
  294. opacity: 0;
  295. }
  296. 3% {
  297. left: 0%;
  298. top: 80%;
  299. -webkit-transform: rotate(180deg);
  300. opacity: 1;
  301. }
  302. 71% {
  303. left: 75%;
  304. top: 80%;
  305. -webkit-transform: rotate(180deg);
  306. opacity: 1;
  307. }
  308. 72% {
  309. left: 76%;
  310. top: 78%;
  311. -webkit-transform: rotate(135deg);
  312. opacity: 1;
  313. }
  314. 85% {
  315. left: 85%;
  316. top: 53%;
  317. -webkit-transform: rotate(135deg);
  318. opacity: 1;
  319. }
  320. 86% {
  321. left: 86%;
  322. top: 50%;
  323. -webkit-transform: rotate(180deg);
  324. opacity: 1;
  325. }
  326. 99% {
  327. left: 99%;
  328. top: 50%;
  329. -webkit-transform: rotate(180deg);
  330. opacity: 1;
  331. }
  332. 100% {
  333. left: 100%;
  334. top: 50%;
  335. -webkit-transform: rotate(180deg);
  336. opacity: 0;
  337. }
  338. }
  339. @-webkit-keyframes myfirst1 /* Safari 和 Chrome */ {
  340. 0% {
  341. left: -5%;
  342. top: 80%;
  343. -webkit-transform: rotate(180deg);
  344. opacity: 0;
  345. }
  346. 3% {
  347. left: 0%;
  348. top: 80%;
  349. -webkit-transform: rotate(180deg);
  350. opacity: 1;
  351. }
  352. 71% {
  353. left: 75%;
  354. top: 80%;
  355. -webkit-transform: rotate(180deg);
  356. opacity: 1;
  357. }
  358. 72% {
  359. left: 76%;
  360. top: 78%;
  361. -webkit-transform: rotate(135deg);
  362. opacity: 1;
  363. }
  364. 85% {
  365. left: 85%;
  366. top: 53%;
  367. -webkit-transform: rotate(135deg);
  368. opacity: 1;
  369. }
  370. 86% {
  371. left: 86%;
  372. top: 50%;
  373. -webkit-transform: rotate(180deg);
  374. opacity: 1;
  375. }
  376. 99% {
  377. left: 99%;
  378. top: 50%;
  379. -webkit-transform: rotate(180deg);
  380. opacity: 1;
  381. }
  382. 100% {
  383. left: 100%;
  384. top: 50%;
  385. -webkit-transform: rotate(180deg);
  386. opacity: 0;
  387. }
  388. }
  389. .arrow2 {
  390. position: relative;
  391. animation-delay: -18s;
  392. animation: myfirst1 20s infinite linear;
  393. /* Safari 和 Chrome */
  394. -webkit-animation: myfirst1 20s infinite linear;
  395. -webkit-animation-delay: -18s;
  396. }
  397. .arrow3 {
  398. position: relative;
  399. animation-delay: -16s;
  400. animation: myfirst1 20s infinite linear;
  401. /* Safari 和 Chrome */
  402. -webkit-animation: myfirst1 20s infinite linear;
  403. -webkit-animation-delay: -16s;
  404. }
  405. .arrow4 {
  406. position: relative;
  407. animation-delay: -14s;
  408. animation: myfirst1 20s infinite linear;
  409. /* Safari 和 Chrome */
  410. -webkit-animation: myfirst1 20s infinite linear;
  411. -webkit-animation-delay: -14s;
  412. }
  413. .arrow5 {
  414. position: relative;
  415. animation-delay: -12s;
  416. animation: myfirst1 20s infinite linear;
  417. /* Safari 和 Chrome */
  418. -webkit-animation: myfirst1 20s infinite linear;
  419. -webkit-animation-delay: -12s;
  420. }
  421. .arrow6 {
  422. position: relative;
  423. animation-delay: -10s;
  424. animation: myfirst1 20s infinite linear;
  425. /* Safari 和 Chrome */
  426. -webkit-animation: myfirst1 20s infinite linear;
  427. -webkit-animation-delay: -10s;
  428. }
  429. .arrow7 {
  430. position: relative;
  431. animation-delay: -8s;
  432. animation: myfirst1 20s infinite linear;
  433. /* Safari 和 Chrome */
  434. -webkit-animation: myfirst1 20s infinite linear;
  435. -webkit-animation-delay: -8s;
  436. }
  437. .arrow8 {
  438. position: relative;
  439. animation-delay: -6s;
  440. animation: myfirst1 20s infinite linear;
  441. /* Safari 和 Chrome */
  442. -webkit-animation: myfirst1 20s infinite linear;
  443. -webkit-animation-delay: -6s;
  444. }
  445. .arrow9 {
  446. position: relative;
  447. animation-delay: -4s;
  448. animation: myfirst1 20s infinite linear;
  449. /* Safari 和 Chrome */
  450. -webkit-animation: myfirst1 20s infinite linear;
  451. -webkit-animation-delay: -4s;
  452. }
  453. .arrow10 {
  454. position: relative;
  455. animation-delay: -2s;
  456. animation: myfirst1 20s infinite linear;
  457. /* Safari 和 Chrome */
  458. -webkit-animation: myfirst1 20s infinite linear;
  459. -webkit-animation-delay: -2s;
  460. }
  461. </style>
  462. <style scoped>
  463. .arrow1-fan1 {
  464. position: relative;
  465. animation: myfirst1-fan1 20s infinite linear;
  466. /* Safari 和 Chrome */
  467. -webkit-animation: myfirst1-fan1 20s infinite linear;
  468. }
  469. @keyframes myfirst1-fan1 {
  470. 0% {
  471. left: -5%;
  472. top: 20%;
  473. -webkit-transform: rotate(180deg);
  474. opacity: 0;
  475. }
  476. 3% {
  477. left: 0%;
  478. top: 20%;
  479. -webkit-transform: rotate(180deg);
  480. opacity: 1;
  481. }
  482. 71% {
  483. left: 75%;
  484. top: 20%;
  485. -webkit-transform: rotate(180deg);
  486. opacity: 1;
  487. }
  488. 72% {
  489. left: 76%;
  490. top: 22%;
  491. -webkit-transform: rotate(225deg);
  492. opacity: 1;
  493. }
  494. 85% {
  495. left: 85%;
  496. top: 47%;
  497. -webkit-transform: rotate(225deg);
  498. opacity: 1;
  499. }
  500. 86% {
  501. left: 86%;
  502. top: 50%;
  503. -webkit-transform: rotate(180deg);
  504. opacity: 1;
  505. }
  506. 99% {
  507. left: 99%;
  508. top: 50%;
  509. -webkit-transform: rotate(180deg);
  510. opacity: 1;
  511. }
  512. 100% {
  513. left: 100%;
  514. top: 50%;
  515. -webkit-transform: rotate(180deg);
  516. opacity: 0;
  517. }
  518. }
  519. @-webkit-keyframes myfirst1-fan1 /* Safari 和 Chrome */ {
  520. 0% {
  521. left: -5%;
  522. top: 20%;
  523. -webkit-transform: rotate(180deg);
  524. opacity: 0;
  525. }
  526. 3% {
  527. left: 0%;
  528. top: 20%;
  529. -webkit-transform: rotate(180deg);
  530. opacity: 1;
  531. }
  532. 71% {
  533. left: 75%;
  534. top: 20%;
  535. -webkit-transform: rotate(180deg);
  536. opacity: 1;
  537. }
  538. 72% {
  539. left: 76%;
  540. top: 22%;
  541. -webkit-transform: rotate(225deg);
  542. opacity: 1;
  543. }
  544. 85% {
  545. left: 85%;
  546. top: 47%;
  547. -webkit-transform: rotate(225deg);
  548. opacity: 1;
  549. }
  550. 86% {
  551. left: 86%;
  552. top: 50%;
  553. -webkit-transform: rotate(180deg);
  554. opacity: 1;
  555. }
  556. 99% {
  557. left: 99%;
  558. top: 50%;
  559. -webkit-transform: rotate(180deg);
  560. opacity: 1;
  561. }
  562. 100% {
  563. left: 100%;
  564. top: 50%;
  565. -webkit-transform: rotate(180deg);
  566. opacity: 0;
  567. }
  568. }
  569. .arrow2-fan1 {
  570. position: relative;
  571. animation-delay: -18s;
  572. animation: myfirst1-fan1 20s infinite linear;
  573. /* Safari 和 Chrome */
  574. -webkit-animation: myfirst1-fan1 20s infinite linear;
  575. -webkit-animation-delay: -18s;
  576. }
  577. .arrow3-fan1 {
  578. position: relative;
  579. animation-delay: -16s;
  580. animation: myfirst1-fan1 20s infinite linear;
  581. /* Safari 和 Chrome */
  582. -webkit-animation: myfirst1-fan1 20s infinite linear;
  583. -webkit-animation-delay: -16s;
  584. }
  585. .arrow4-fan1 {
  586. position: relative;
  587. animation-delay: -14s;
  588. animation: myfirst1-fan1 20s infinite linear;
  589. /* Safari 和 Chrome */
  590. -webkit-animation: myfirst1-fan1 20s infinite linear;
  591. -webkit-animation-delay: -14s;
  592. }
  593. .arrow5-fan1 {
  594. position: relative;
  595. animation-delay: -12s;
  596. animation: myfirst1-fan1 20s infinite linear;
  597. /* Safari 和 Chrome */
  598. -webkit-animation: myfirst1-fan1 20s infinite linear;
  599. -webkit-animation-delay: -12s;
  600. }
  601. .arrow6-fan1 {
  602. position: relative;
  603. animation-delay: -10s;
  604. animation: myfirst1-fan1 20s infinite linear;
  605. /* Safari 和 Chrome */
  606. -webkit-animation: myfirst1-fan1 20s infinite linear;
  607. -webkit-animation-delay: -10s;
  608. }
  609. .arrow7-fan1 {
  610. position: relative;
  611. animation-delay: -8s;
  612. animation: myfirst1-fan1 20s infinite linear;
  613. /* Safari 和 Chrome */
  614. -webkit-animation: myfirst1-fan1 20s infinite linear;
  615. -webkit-animation-delay: -8s;
  616. }
  617. .arrow8-fan1 {
  618. position: relative;
  619. animation-delay: -6s;
  620. animation: myfirst1-fan1 20s infinite linear;
  621. /* Safari 和 Chrome */
  622. -webkit-animation: myfirst1-fan1 20s infinite linear;
  623. -webkit-animation-delay: -6s;
  624. }
  625. .arrow9-fan1 {
  626. position: relative;
  627. animation-delay: -4s;
  628. animation: myfirst1-fan1 20s infinite linear;
  629. /* Safari 和 Chrome */
  630. -webkit-animation: myfirst1-fan1 20s infinite linear;
  631. -webkit-animation-delay: -4s;
  632. }
  633. .arrow10-fan1 {
  634. position: relative;
  635. animation-delay: -2s;
  636. animation: myfirst1-fan1 20s infinite linear;
  637. /* Safari 和 Chrome */
  638. -webkit-animation: myfirst1-fan1 20s infinite linear;
  639. -webkit-animation-delay: -2s;
  640. }
  641. </style>