tsa.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. <template>
  2. <div class="project-tsa-wrapper ">
  3. <div class="scrollbar" :style="{ height: scorllHeight + 'px' }">
  4. <a-collapse style="background: #232323;" :bordered="false" expandIconPosition="right" accordion
  5. v-model:activeKey="state.activeKey">
  6. <a-collapse-panel style="border-bottom: 1px solid #4f4f4f;" :key="EDeviceTypeName.Dock" header="机场">
  7. <div v-if="onlineDocks.data.length === 0" style="height: 100px; color: white;">
  8. <a-empty :image="noData" :image-style="{ height: '60px' }" />
  9. </div>
  10. <div v-else class="fz12" style="color: white;">
  11. <div v-for="dock in onlineDocks.data" :key="dock.sn"
  12. style="background: #3c3c3c; height: 90px; width: 250px; margin-bottom: 10px;">
  13. <div style="border-radius: 2px; height: 100%; width: 100%;"
  14. class="flex-row flex-justify-between flex-align-center">
  15. <div style="float: left; padding: 0px 5px 8px 8px; width: 88%">
  16. <div style="width: 80%; height: 30px; line-height: 30px; font-size: 16px;">
  17. <a-tooltip :title="`${dock.gateway.callsign} - ${dock.callsign ?? 'No Drone'}`">
  18. <div class="text-hidden" style="max-width: 200px;">{{ dock.gateway.callsign }} - {{ dock.callsign
  19. ?? 'No Drone' }}</div>
  20. </a-tooltip>
  21. </div>
  22. <div class="mt5 flex-align-center flex-row flex-justify-between" style="background: #595959;">
  23. <div class="flex-align-center flex-row">
  24. <span class="ml5 mr5">
  25. <RobotOutlined />
  26. </span>
  27. <div class="font-bold text-hidden" style="max-width: 80px;"
  28. :style="dockInfo[dock.gateway.sn] && dockInfo[dock.gateway.sn].basic_osd?.mode_code !== EDockModeCode.Disconnected ? 'color: #00ee8b' : 'color: red;'">
  29. {{ dockInfo[dock.gateway.sn] ? EDockModeCode[dockInfo[dock.gateway.sn].basic_osd?.mode_code] :
  30. EDockModeCode[EDockModeCode.Disconnected] }}
  31. </div>
  32. </div>
  33. <div class="mr5 flex-align-center flex-row" style="width: 85px; margin-right: 0; height: 18px;">
  34. <div v-if="hmsInfo[dock.gateway.sn]" class="flex-align-center flex-row">
  35. <div :class="hmsInfo[dock.gateway.sn][0].level === EHmsLevel.CAUTION ? 'caution-blink' :
  36. hmsInfo[dock.gateway.sn][0].level === EHmsLevel.WARN ? 'warn-blink' : 'notice-blink'"
  37. style="width: 18px; height: 16px; text-align: center;">
  38. <span :style="hmsInfo[dock.gateway.sn].length > 99 ? 'font-size: 11px' : 'font-size: 12px'">{{
  39. hmsInfo[dock.gateway.sn].length }}</span>
  40. <span class="fz10">{{ hmsInfo[dock.gateway.sn].length > 99 ? '+' : '' }}</span>
  41. </div>
  42. <a-popover trigger="click" placement="bottom" color="black"
  43. v-model:visible="hmsVisible[dock.gateway.sn]"
  44. @visibleChange="readHms(hmsVisible[dock.gateway.sn], dock.gateway.sn)"
  45. :overlayStyle="{ width: '200px', height: '300px' }">
  46. <div :class="hmsInfo[dock.gateway.sn][0].level === EHmsLevel.CAUTION ? 'caution' :
  47. hmsInfo[dock.gateway.sn][0].level === EHmsLevel.WARN ? 'warn' : 'notice'"
  48. style="margin-left: 3px; width: 62px; height: 16px;">
  49. <span class="word-loop">{{ hmsInfo[dock.gateway.sn][0].message_en }}</span>
  50. </div>
  51. <template #content>
  52. <a-collapse style="background: black; height: 300px; overflow-y: auto;" :bordered="false"
  53. expand-icon-position="right" :accordion="true">
  54. <a-collapse-panel v-for="hms in hmsInfo[dock.gateway.sn]" :key="hms.hms_id"
  55. :showArrow="false"
  56. style=" margin: 0 auto 3px auto; border: 0; width: 140px; border-radius: 3px"
  57. :class="hms.level === EHmsLevel.CAUTION ? 'caution' : hms.level === EHmsLevel.WARN ? 'warn' : 'notice'">
  58. <template #header="{ isActive }">
  59. <div class="flex-row flex-align-center" style="width: 130px;">
  60. <div style="width: 110px;">
  61. <span class="word-loop">{{ hms.message_en }}</span>
  62. </div>
  63. <div style="width: 20px; height: 15px; font-size: 10px; z-index: 2 "
  64. class="flex-row flex-align-center flex-justify-center"
  65. :class="hms.level === EHmsLevel.CAUTION ? 'caution' : hms.level === EHmsLevel.WARN ? 'warn' : 'notice'">
  66. <DoubleRightOutlined :rotate="isActive ? 90 : 0" />
  67. </div>
  68. </div>
  69. </template>
  70. <a-tooltip :title="hms.create_time">
  71. <div style="color: white;" class="text-hidden">{{ hms.create_time }}</div>
  72. </a-tooltip>
  73. </a-collapse-panel>
  74. </a-collapse>
  75. </template>
  76. </a-popover>
  77. </div>
  78. <div v-else class="width-100" style="height: 90%; background: rgba(0, 0, 0, 0.35)"></div>
  79. </div>
  80. </div>
  81. <div class="mt5 flex-align-center flex-row flex-justify-between" style="background: #595959;">
  82. <div class="flex-row">
  83. <span class="ml5 mr5">
  84. <RocketOutlined />
  85. </span>
  86. <div class="font-bold text-hidden" style="max-width: 80px"
  87. :style="deviceInfo[dock.sn] && deviceInfo[dock.sn].mode_code !== EModeCode.Disconnected ? 'color: #00ee8b' : 'color: red;'">
  88. {{ deviceInfo[dock.sn] ? EModeCode[deviceInfo[dock.sn].mode_code] :
  89. EModeCode[EModeCode.Disconnected] }}
  90. </div>
  91. </div>
  92. <div class="mr5 flex-align-center flex-row" style="width: 85px; margin-right: 0; height: 18px;">
  93. <div v-if="hmsInfo[dock.sn]" class="flex-align-center flex-row">
  94. <div :class="hmsInfo[dock.sn][0].level === EHmsLevel.CAUTION ? 'caution-blink' :
  95. hmsInfo[dock.sn][0].level === EHmsLevel.WARN ? 'warn-blink' : 'notice-blink'"
  96. style="width: 18px; height: 16px; text-align: center;">
  97. <span :style="hmsInfo[dock.sn].length > 99 ? 'font-size: 11px' : 'font-size: 12px'">{{
  98. hmsInfo[dock.sn].length
  99. }}</span>
  100. <span class="fz10">{{ hmsInfo[dock.sn].length > 99 ? '+' : '' }}</span>
  101. </div>
  102. <a-popover trigger="click" placement="bottom" color="black"
  103. v-model:visible="hmsVisible[dock.sn]" @visibleChange="readHms(hmsVisible[dock.sn], dock.sn)"
  104. :overlayStyle="{ width: '200px', height: '300px' }">
  105. <div :class="hmsInfo[dock.sn][0].level === EHmsLevel.CAUTION ? 'caution' :
  106. hmsInfo[dock.sn][0].level === EHmsLevel.WARN ? 'warn' : 'notice'"
  107. style="margin-left: 3px; width: 62px; height: 16px;">
  108. <span class="word-loop">{{ hmsInfo[dock.sn][0].message_en }}</span>
  109. </div>
  110. <template #content>
  111. <a-collapse style="background: black; height: 300px; overflow-y: auto;" :bordered="false"
  112. expand-icon-position="right" :accordion="true">
  113. <a-collapse-panel v-for="hms in hmsInfo[dock.sn]" :key="hms.hms_id" :showArrow="false"
  114. style=" margin: 0 auto 3px auto; border: 0; width: 140px; border-radius: 3px"
  115. :class="hms.level === EHmsLevel.CAUTION ? 'caution' : hms.level === EHmsLevel.WARN ? 'warn' : 'notice'">
  116. <template #header="{ isActive }">
  117. <div class="flex-row flex-align-center" style="width: 130px;">
  118. <div style="width: 110px;">
  119. <span class="word-loop">{{ hms.message_en }}</span>
  120. </div>
  121. <div style="width: 20px; height: 15px; font-size: 10px; z-index: 2 "
  122. class="flex-row flex-align-center flex-justify-center"
  123. :class="hms.level === EHmsLevel.CAUTION ? 'caution' : hms.level === EHmsLevel.WARN ? 'warn' : 'notice'">
  124. <DoubleRightOutlined :rotate="isActive ? 90 : 0" />
  125. </div>
  126. </div>
  127. </template>
  128. <a-tooltip :title="hms.create_time">
  129. <div style="color: white;" class="text-hidden">{{ hms.create_time }}</div>
  130. </a-tooltip>
  131. </a-collapse-panel>
  132. </a-collapse>
  133. </template>
  134. </a-popover>
  135. </div>
  136. <div v-else class="width-100" style="height: 90%; background: rgba(0, 0, 0, 0.35)"></div>
  137. </div>
  138. </div>
  139. </div>
  140. <div style="float: right; background: #595959; height: 100%; width: 40px;"
  141. class="flex-row flex-justify-center flex-align-center">
  142. <div class="fz16"
  143. @click="switchVisible($event, dock, true, dockInfo[dock.gateway.sn] && dockInfo[dock.gateway.sn].basic_osd?.mode_code !== EDockModeCode.Disconnected)">
  144. <a v-if="osdVisible.gateway_sn === dock.gateway.sn && osdVisible.visible">
  145. <EyeOutlined />
  146. </a>
  147. <a v-else>
  148. <EyeInvisibleOutlined />
  149. </a>
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. </a-collapse-panel>
  156. <a-collapse-panel style="border-bottom: 1px solid #4f4f4f;" :key="EDeviceTypeName.Aircraft" header="在线设备">
  157. <div v-if="onlineDevices.data.length === 0" style="height: 100px; color: white;">
  158. <a-empty :image="noData" :image-style="{ height: '60px' }" />
  159. </div>
  160. <div v-else class="fz12" style="color: white;">
  161. <div v-for="device in onlineDevices.data" :key="device.sn"
  162. style="background: #3c3c3c; height: 90px; width: 250px; margin-bottom: 10px;">
  163. <div class="battery-slide" v-if="deviceInfo[device.sn]">
  164. <div style="background: #535759; width: 100%;"></div>
  165. <div class="capacity-percent" :style="{ width: deviceInfo[device.sn].battery.capacity_percent + '%' }">
  166. </div>
  167. <div class="return-home" :style="{ width: deviceInfo[device.sn].battery.return_home_power + '%' }">
  168. </div>
  169. <div class="landing" :style="{ width: deviceInfo[device.sn].battery.landing_power + '%' }"></div>
  170. <div class="battery" :style="{ left: deviceInfo[device.sn].battery.capacity_percent + '%' }"></div>
  171. </div>
  172. <div style="border-bottom: 1px solid #515151; border-radius: 2px; height: 50px; width: 100%;"
  173. class="flex-row flex-justify-between flex-align-center">
  174. <div style="float: left; padding: 5px 5px 8px 8px; width: 88%">
  175. <div style="width: 100%; height: 100%;">
  176. <a-tooltip>
  177. <template #title>
  178. {{ device.model ? `${device.model} - ${device.callsign}` : 'NoDrone' }}</template>
  179. <span class="text-hidden" style="max-width: 200px; display: block; height: 20px;">
  180. {{ device.model ? `${device.model} - ${device.callsign}` : 'No Drone' }}
  181. </span>
  182. </a-tooltip>
  183. </div>
  184. <div class="mt5" style="background: #595959;">
  185. <span class="ml5 mr5">
  186. <RocketOutlined />
  187. </span>
  188. <span class="font-bold"
  189. :style="deviceInfo[device.sn] && deviceInfo[device.sn].mode_code !== EModeCode.Disconnected ? 'color: #00ee8b' : 'color: red;'">
  190. {{ deviceInfo[device.sn] ? EModeCode[deviceInfo[device.sn].mode_code] :
  191. EModeCode[EModeCode.Disconnected] }}
  192. </span>
  193. </div>
  194. </div>
  195. <div style="float: right; background: #595959; height: 50px; width: 40px;"
  196. class="flex-row flex-justify-center flex-align-center">
  197. <div class="fz16"
  198. @click="switchVisible($event, device, false, deviceInfo[device.sn] && deviceInfo[device.sn].mode_code !== EModeCode.Disconnected)">
  199. <a v-if="osdVisible.sn === device.sn && osdVisible.visible">
  200. <EyeOutlined />
  201. </a>
  202. <a v-else>
  203. <EyeInvisibleOutlined />
  204. </a>
  205. </div>
  206. </div>
  207. </div>
  208. <div class="flex-row flex-justify-center flex-align-center" style="height: 40px;">
  209. <div class="flex-row" style="height: 20px; background: #595959; width: 94%;">
  210. <span class="mr5"><a-image style="margin-left: 2px; margin-top: -2px; height: 20px; width: 20px;"
  211. :src="rc" /></span>
  212. <a-tooltip>
  213. <template #title>{{ device.gateway.model }} - {{ device.gateway.callsign }} </template>
  214. <div class="text-hidden" style="max-width: 200px;">
  215. {{ device.gateway.model }} - {{ device.gateway.callsign }}</div>
  216. </a-tooltip>
  217. </div>
  218. </div>
  219. </div>
  220. </div>
  221. </a-collapse-panel>
  222. <a-collapse-panel style="border-bottom: 1px solid #4f4f4f;" :forceRender="true" :key="EDeviceTypeName.Marker"
  223. header="地图标注管理">
  224. <Layer :mapClickId="mapClickId" />
  225. </a-collapse-panel>
  226. </a-collapse>
  227. </div>
  228. <div style="width: 100%;padding-top: 10px; display: flex;justify-content: center;align-items: center;">
  229. <a-button style="margin-right: 10px;" type="primary" @click="onClickGoHome">
  230. 返回
  231. </a-button>
  232. <a-button type="primary" @click="openLivestreamOthers">
  233. 直播测试
  234. </a-button>
  235. </div>
  236. </div>
  237. </template>
  238. <script lang="ts" setup>
  239. import { computed, onMounted, reactive, ref, watch } from 'vue'
  240. import Layer from '/@/pages/page-web/projects/layer/index.vue'
  241. import { EDeviceTypeName, ELocalStorageKey } from '/@/types'
  242. import noData from '/@/assets/icons/no-data.png'
  243. import rc from '/@/assets/icons/rc.png'
  244. import { OnlineDevice, EModeCode, EDockModeCode } from '/@/types/device'
  245. import { useMyStore } from '/@/store'
  246. import { getDeviceTopo, getUnreadDeviceHms, updateDeviceHms } from '/@/api/manage'
  247. import { RocketOutlined, EyeInvisibleOutlined, EyeOutlined, RobotOutlined, DoubleRightOutlined, ImportOutlined } from '@ant-design/icons-vue'
  248. import { EHmsLevel, ERouterName } from '/@/types/enums'
  249. import { getRoot } from '/@/root'
  250. const store = useMyStore()
  251. const workspaceId = ref(localStorage.getItem(ELocalStorageKey.WorkspaceId)!)
  252. const osdVisible = computed(() => store.state.osdVisible)
  253. const hmsVisible = new Map<string, boolean>()
  254. const scorllHeight = ref()
  255. const onlineDevices = reactive({
  256. data: [] as OnlineDevice[]
  257. })
  258. const onlineDocks = reactive({
  259. data: [] as OnlineDevice[]
  260. })
  261. const state = reactive({
  262. activeKey: -1,
  263. })
  264. const mapClickId = computed(() => store.state.mapClickId)
  265. const deviceInfo = computed(() => store.state.deviceState.deviceInfo)
  266. const dockInfo = computed(() => store.state.deviceState.dockInfo)
  267. const hmsInfo = computed({
  268. get: () => store.state.hmsInfo,
  269. set: (val) => {
  270. return val
  271. }
  272. })
  273. watch(() => mapClickId.value, (newValue, oldValue) => {
  274. if (newValue) {
  275. state.activeKey = EDeviceTypeName.Marker
  276. }
  277. });
  278. onMounted(() => {
  279. getOnlineTopo()
  280. setTimeout(() => {
  281. watch(() => store.state.deviceStatusEvent,
  282. data => {
  283. getOnlineTopo()
  284. if (data.deviceOnline.sn) {
  285. getUnreadHms(data.deviceOnline.sn)
  286. }
  287. },
  288. {
  289. deep: true
  290. }
  291. )
  292. getOnlineDeviceHms()
  293. }, 3000)
  294. const element = document.getElementsByClassName('scrollbar').item(0) as HTMLDivElement
  295. const parent = element?.parentNode as HTMLDivElement
  296. scorllHeight.value = parent?.clientHeight - parent?.firstElementChild?.clientHeight
  297. })
  298. function getOnlineTopo() {
  299. getDeviceTopo(workspaceId.value).then((res) => {
  300. if (res.code !== 0) {
  301. return
  302. }
  303. onlineDevices.data = []
  304. onlineDocks.data = []
  305. res.data.forEach((gateway: any) => {
  306. const child = gateway.children
  307. const device: OnlineDevice = {
  308. model: child?.device_name,
  309. callsign: child?.nickname,
  310. sn: child?.device_sn,
  311. mode: EModeCode.Disconnected,
  312. gateway: {
  313. model: gateway?.device_name,
  314. callsign: gateway?.nickname,
  315. sn: gateway?.device_sn,
  316. domain: gateway?.domain
  317. },
  318. payload: []
  319. }
  320. child?.payloads_list.forEach((payload: any) => {
  321. device.payload.push({
  322. index: payload.index,
  323. model: payload.model,
  324. payload_name: payload.payload_name,
  325. payload_sn: payload.payload_sn,
  326. control_source: payload.control_source,
  327. payload_index: payload.payload_index
  328. })
  329. })
  330. if (EDeviceTypeName.Dock === gateway.domain) {
  331. hmsVisible.set(device.sn, false)
  332. hmsVisible.set(device.gateway.sn, false)
  333. onlineDocks.data.push(device)
  334. }
  335. if (gateway.status && EDeviceTypeName.Gateway === gateway.domain) {
  336. onlineDevices.data.push(device)
  337. }
  338. })
  339. })
  340. }
  341. function switchVisible(e: any, device: OnlineDevice, isDock: boolean, isClick: boolean) {
  342. if (!isClick) {
  343. e.target.style.cursor = 'not-allowed'
  344. return
  345. }
  346. if (device.sn === osdVisible.value.sn) {
  347. osdVisible.value.visible = !osdVisible.value.visible
  348. } else {
  349. osdVisible.value.sn = device.sn
  350. osdVisible.value.callsign = device.callsign
  351. osdVisible.value.model = device.model
  352. osdVisible.value.visible = true
  353. osdVisible.value.gateway_sn = device.gateway.sn
  354. osdVisible.value.is_dock = isDock
  355. osdVisible.value.gateway_callsign = device.gateway.callsign
  356. osdVisible.value.payloads = device.payload
  357. }
  358. store.commit('SET_OSD_VISIBLE_INFO', osdVisible)
  359. }
  360. function getUnreadHms(sn: string) {
  361. getUnreadDeviceHms(workspaceId.value, sn).then(res => {
  362. if (res.data.length !== 0) {
  363. hmsInfo.value[sn] = res.data
  364. }
  365. })
  366. console.info(hmsInfo.value)
  367. }
  368. function getOnlineDeviceHms() {
  369. const snList = Object.keys(dockInfo.value)
  370. if (snList.length === 0) {
  371. return
  372. }
  373. snList.forEach(sn => {
  374. getUnreadHms(sn)
  375. })
  376. const deviceSnList = Object.keys(deviceInfo.value)
  377. if (deviceSnList.length === 0) {
  378. return
  379. }
  380. deviceSnList.forEach(sn => {
  381. getUnreadHms(sn)
  382. })
  383. }
  384. function readHms(visiable: boolean, sn: string) {
  385. if (!visiable) {
  386. updateDeviceHms(workspaceId.value, sn).then(res => {
  387. if (res.code === 0) {
  388. delete hmsInfo.value[sn]
  389. }
  390. })
  391. }
  392. }
  393. const onClickGoHome = () => {
  394. const root = getRoot()
  395. root.$router.push('/' + ERouterName.DEVICES)
  396. }
  397. function openLivestreamOthers() {
  398. store.commit('SET_LIVESTREAM_OTHERS_VISIBLE', true)
  399. }
  400. function openLivestreamAgora() {
  401. store.commit('SET_LIVESTREAM_AGORA_VISIBLE', true)
  402. }
  403. </script>
  404. <style lang="scss">
  405. .project-tsa-wrapper> :first-child {
  406. height: 50px;
  407. line-height: 50px;
  408. align-items: center;
  409. border-bottom: 1px solid #4f4f4f;
  410. }
  411. .project-tsa-wrapper {
  412. height: 100%;
  413. .scrollbar {
  414. overflow: auto;
  415. }
  416. ::-webkit-scrollbar {
  417. display: none;
  418. }
  419. }
  420. .ant-collapse>.ant-collapse-item>.ant-collapse-header {
  421. color: white;
  422. border: 0;
  423. padding-left: 14px;
  424. }
  425. .text-hidden {
  426. overflow: hidden !important;
  427. text-overflow: ellipsis !important;
  428. white-space: nowrap;
  429. -o-text-overflow: ellipsis;
  430. }
  431. .font-bold {
  432. font-weight: 700;
  433. }
  434. .battery-slide {
  435. width: 100%;
  436. .capacity-percent {
  437. background: #00ee8b;
  438. }
  439. .return-home {
  440. background: #ff9f0a;
  441. }
  442. .landing {
  443. background: #f5222d;
  444. }
  445. .battery {
  446. background: white;
  447. border-radius: 1px;
  448. width: 8px;
  449. height: 4px;
  450. margin-top: -3px;
  451. }
  452. }
  453. .battery-slide>div {
  454. position: relative;
  455. margin-top: -2px;
  456. min-height: 2px;
  457. border-radius: 2px;
  458. white-space: nowrap;
  459. }
  460. .disable {
  461. cursor: not-allowed;
  462. }
  463. .notice-blink {
  464. background: $success;
  465. animation: blink 500ms infinite;
  466. }
  467. .caution-blink {
  468. background: orange;
  469. animation: blink 500ms infinite;
  470. }
  471. .warn-blink {
  472. background: red;
  473. animation: blink 500ms infinite;
  474. }
  475. .notice {
  476. background: $success;
  477. overflow: hidden;
  478. cursor: pointer;
  479. }
  480. .caution {
  481. background: orange;
  482. cursor: pointer;
  483. overflow: hidden;
  484. }
  485. .warn {
  486. background: red;
  487. cursor: pointer;
  488. overflow: hidden;
  489. }
  490. .word-loop {
  491. white-space: nowrap;
  492. display: inline-block;
  493. animation: 10s loop linear infinite normal;
  494. }
  495. @keyframes blink {
  496. from {
  497. opacity: 1;
  498. }
  499. 50% {
  500. opacity: 0.35;
  501. }
  502. to {
  503. opacity: 1;
  504. }
  505. }
  506. @keyframes loop {
  507. 0% {
  508. transform: translateX(20px);
  509. -webkit-transform: translateX(20px);
  510. }
  511. 100% {
  512. transform: translateX(-100%);
  513. -webkit-transform: translateX(-100%);
  514. }
  515. }
  516. </style>