fanlocalAnimate2.vue 13 KB

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