tsa.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555
  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 style="margin-right: 10px;" 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. }, { deep: true }
  288. )
  289. getOnlineDeviceHms()
  290. }, 3000)
  291. const element = document.getElementsByClassName('scrollbar').item(0) as HTMLDivElement
  292. const parent: any = element?.parentNode as HTMLDivElement
  293. scorllHeight.value = parent?.clientHeight - parent?.firstElementChild?.clientHeight
  294. })
  295. function getOnlineTopo() {
  296. getDeviceTopo(workspaceId.value).then((res) => {
  297. if (res.code !== 0) {
  298. return
  299. }
  300. onlineDevices.data = []
  301. onlineDocks.data = []
  302. res.data.forEach((gateway: any) => {
  303. const child = gateway.children
  304. const device: OnlineDevice = {
  305. model: child?.device_name,
  306. callsign: child?.nickname,
  307. sn: child?.device_sn,
  308. mode: EModeCode.Disconnected,
  309. gateway: {
  310. model: gateway?.device_name,
  311. callsign: gateway?.nickname,
  312. sn: gateway?.device_sn,
  313. domain: gateway?.domain
  314. },
  315. payload: []
  316. }
  317. child?.payloads_list.forEach((payload: any) => {
  318. device.payload.push({
  319. index: payload.index,
  320. model: payload.model,
  321. payload_name: payload.payload_name,
  322. payload_sn: payload.payload_sn,
  323. control_source: payload.control_source,
  324. payload_index: payload.payload_index
  325. })
  326. })
  327. if (EDeviceTypeName.Dock === gateway.domain) {
  328. hmsVisible.set(device.sn, false)
  329. hmsVisible.set(device.gateway.sn, false)
  330. onlineDocks.data.push(device)
  331. }
  332. if (gateway.status && EDeviceTypeName.Gateway === gateway.domain) {
  333. onlineDevices.data.push(device)
  334. }
  335. })
  336. })
  337. }
  338. function switchVisible(e: any, device: OnlineDevice, isDock: boolean, isClick: boolean) {
  339. if (!isClick) {
  340. e.target.style.cursor = 'not-allowed'
  341. return
  342. }
  343. if (device.sn === osdVisible.value.sn) {
  344. osdVisible.value.visible = !osdVisible.value.visible
  345. } else {
  346. osdVisible.value.sn = device.sn
  347. osdVisible.value.callsign = device.callsign
  348. osdVisible.value.model = device.model
  349. osdVisible.value.visible = true
  350. osdVisible.value.gateway_sn = device.gateway.sn
  351. osdVisible.value.is_dock = isDock
  352. osdVisible.value.gateway_callsign = device.gateway.callsign
  353. osdVisible.value.payloads = device.payload
  354. }
  355. store.commit('SET_OSD_VISIBLE_INFO', osdVisible)
  356. }
  357. function getUnreadHms(sn: string) {
  358. getUnreadDeviceHms(workspaceId.value, sn).then(res => {
  359. if (res.data.length !== 0) {
  360. hmsInfo.value[sn] = res.data
  361. }
  362. })
  363. console.info(hmsInfo.value)
  364. }
  365. function getOnlineDeviceHms() {
  366. const snList = Object.keys(dockInfo.value)
  367. if (snList.length === 0) {
  368. return
  369. }
  370. snList.forEach(sn => {
  371. getUnreadHms(sn)
  372. })
  373. const deviceSnList = Object.keys(deviceInfo.value)
  374. if (deviceSnList.length === 0) {
  375. return
  376. }
  377. deviceSnList.forEach(sn => {
  378. getUnreadHms(sn)
  379. })
  380. }
  381. function readHms(visiable: boolean, sn: string) {
  382. if (!visiable) {
  383. updateDeviceHms(workspaceId.value, sn).then(res => {
  384. if (res.code === 0) {
  385. delete hmsInfo.value[sn]
  386. }
  387. })
  388. }
  389. }
  390. const onClickGoHome = () => {
  391. const root = getRoot()
  392. root.$router.push('/' + ERouterName.DEVICES)
  393. }
  394. function openLivestreamOthers() {
  395. store.commit('SET_LIVESTREAM_OTHERS_VISIBLE', true)
  396. }
  397. function openLivestreamAgora() {
  398. store.commit('SET_LIVESTREAM_AGORA_VISIBLE', true)
  399. }
  400. </script>
  401. <style lang="scss">
  402. .project-tsa-wrapper> :first-child {
  403. height: 50px;
  404. line-height: 50px;
  405. align-items: center;
  406. border-bottom: 1px solid #4f4f4f;
  407. }
  408. .project-tsa-wrapper {
  409. height: 100%;
  410. .scrollbar {
  411. overflow: auto;
  412. }
  413. ::-webkit-scrollbar {
  414. display: none;
  415. }
  416. }
  417. .ant-collapse>.ant-collapse-item>.ant-collapse-header {
  418. color: white;
  419. border: 0;
  420. padding-left: 14px;
  421. }
  422. .text-hidden {
  423. overflow: hidden !important;
  424. text-overflow: ellipsis !important;
  425. white-space: nowrap;
  426. -o-text-overflow: ellipsis;
  427. }
  428. .font-bold {
  429. font-weight: 700;
  430. }
  431. .battery-slide {
  432. width: 100%;
  433. .capacity-percent {
  434. background: #00ee8b;
  435. }
  436. .return-home {
  437. background: #ff9f0a;
  438. }
  439. .landing {
  440. background: #f5222d;
  441. }
  442. .battery {
  443. background: white;
  444. border-radius: 1px;
  445. width: 8px;
  446. height: 4px;
  447. margin-top: -3px;
  448. }
  449. }
  450. .battery-slide>div {
  451. position: relative;
  452. margin-top: -2px;
  453. min-height: 2px;
  454. border-radius: 2px;
  455. white-space: nowrap;
  456. }
  457. .disable {
  458. cursor: not-allowed;
  459. }
  460. .notice-blink {
  461. background: $success;
  462. animation: blink 500ms infinite;
  463. }
  464. .caution-blink {
  465. background: orange;
  466. animation: blink 500ms infinite;
  467. }
  468. .warn-blink {
  469. background: red;
  470. animation: blink 500ms infinite;
  471. }
  472. .notice {
  473. background: $success;
  474. overflow: hidden;
  475. cursor: pointer;
  476. }
  477. .caution {
  478. background: orange;
  479. cursor: pointer;
  480. overflow: hidden;
  481. }
  482. .warn {
  483. background: red;
  484. cursor: pointer;
  485. overflow: hidden;
  486. }
  487. .word-loop {
  488. white-space: nowrap;
  489. display: inline-block;
  490. animation: 10s loop linear infinite normal;
  491. }
  492. @keyframes blink {
  493. from {
  494. opacity: 1;
  495. }
  496. 50% {
  497. opacity: 0.35;
  498. }
  499. to {
  500. opacity: 1;
  501. }
  502. }
  503. @keyframes loop {
  504. 0% {
  505. transform: translateX(20px);
  506. -webkit-transform: translateX(20px);
  507. }
  508. 100% {
  509. transform: translateX(-100%);
  510. -webkit-transform: translateX(-100%);
  511. }
  512. }
  513. </style>