ZksyncView.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232
  1. <script setup lang="ts">
  2. //@ts-ignore
  3. import MetaMaskSDK from '../utils/metamask-sdk.js'
  4. //@ts-ignore
  5. import getZksEra from '../utils/getZksEra.js'
  6. //@ts-ignore
  7. import getZksLite from '../utils/getZksLite.js'
  8. //@ts-ignore
  9. import getZkSyncBridge from '../utils/getZkSyncBridge.js'
  10. import * as echarts from 'echarts';
  11. import {onMounted, ref,onBeforeUnmount} from 'vue';
  12. import balancerBg from '../project/balancer/balancerBg.png'
  13. import balancerAv from '../project/balancer/balancerAv.png'
  14. import argentBg from '../project/argent/argentBg.png'
  15. import argentAv from '../project/argent/argentAv.png'
  16. import ontoBg from '../project/onto/ontoBg.png'
  17. import ontoAv from '../project/onto/ontoAv.png'
  18. import zerionBg from '../project/zerion/zerionBg.png'
  19. import zerionAv from '../project/zerion/zerionAv.png'
  20. import zksEraBridgeAv from '../project/zksEraBridge/zksEraBridgeAv.png'
  21. import zksEraBridgeBg from '../project/zksEraBridge/zksEraBridgeBg.png'
  22. import zksLiteBridgeBg from '../project/zksLiteBridge/zksLiteBridgeBg.png'
  23. import zksLiteBridgeAv from '../project/zksLiteBridge/zksLiteBridgeAv.png'
  24. import orbiterAv from '../project/orbiter/orbiterAv.png'
  25. import orbiterBg from '../project/orbiter/orbiterBg.png'
  26. import muteAv from '../project/mute/muteAv.png'
  27. import muteBg from '../project/mute/muteBg.png'
  28. import syncswapBg from '../project/syncswap/syncswapBg.png'
  29. import syncswapAv from '../project/syncswap/syncswapAv.png'
  30. import getcoinBg from '../project/getcoin/getcoinBg.png'
  31. import getcoinAv from '../project/getcoin/getcoinAv.png'
  32. import dmailAv from '../project/dmail/dmailAv.png'
  33. import dmailBg from '../project/dmail/dmailBg.png'
  34. import tiktokFiAv from '../project/tiktokFi/tiktokFiAv.png'
  35. import tiktokFiBg from '../project/tiktokFi/tiktokFiBg.png'
  36. import karatDAOAv from '../project/karatDAO/karatDAOAv.png'
  37. import karatDAOBg from '../project/karatDAO/karatDAOBg.png'
  38. import router from "@/router";
  39. import {useSunStore,useAddressStore} from "@/stores/sun";
  40. import Footer from '@/components/Footer.vue'
  41. //@ts-ignore
  42. import {getAllZksSyncData} from "@/utils/getZksyncData/index.js";
  43. import axios from 'axios';
  44. import {Area, Bar} from '@antv/g2plot';
  45. import moment from "moment";
  46. import eventBus from '../libs/eventBus'
  47. import { inject } from "vue";
  48. const refresh:any = inject("reload");
  49. const sunStore = useSunStore()
  50. const addressStore = useAddressStore()
  51. type EChartsOption = echarts.EChartsOption;
  52. onMounted(() => {
  53. checkWalletAddress()
  54. listeningDisconnect()
  55. fetchData()
  56. fetchData2()
  57. refresh()
  58. })
  59. onBeforeUnmount(() => {
  60. eventBus.off('zksConnectWallet',connectWallet)
  61. })
  62. type dataArrType = {
  63. name: string,
  64. type: string[],
  65. BG: string,
  66. avatar: string,
  67. url:string
  68. }[]
  69. let dataArr: dataArrType = [
  70. {
  71. name: 'zks-era bridge',
  72. type: ['OFFICAL','BRIDGE'],
  73. BG: zksEraBridgeBg,
  74. avatar: zksEraBridgeAv,
  75. url:'https://bridge.zksync.io/'
  76. },
  77. {
  78. name:'TiktokFi',
  79. type: ['NFT'],
  80. BG:tiktokFiBg,
  81. avatar:tiktokFiAv,
  82. url:'https://zksync.tiktokfi.xyz/'
  83. },
  84. {
  85. name: 'Orbiter',
  86. type: ['ERA', 'SWAP'],
  87. BG: orbiterBg,
  88. avatar: orbiterAv,
  89. url:'https://www.orbiter.finance/'
  90. },
  91. {
  92. name: 'Syncswap',
  93. type: ['ERA', 'SWAP'],
  94. BG: syncswapBg,
  95. avatar: syncswapAv,
  96. url:'https://syncswap.xyz/'
  97. },
  98. {
  99. name: 'zks-lite bridge',
  100. type: ['OFFICAL','BRIDGE'],
  101. BG: zksLiteBridgeBg,
  102. avatar: zksLiteBridgeAv,
  103. url:'https://lite.zksync.io/transaction/deposit'
  104. },
  105. {
  106. name: 'Mute',
  107. type: ['ERA', 'DEFI', 'SWAP'],
  108. BG: muteBg,
  109. avatar: muteAv,
  110. url:'https://app.mute.io/swap'
  111. },
  112. {
  113. name:'Dmail',
  114. type: ['Dapp'],
  115. BG:dmailBg,
  116. avatar:dmailAv,
  117. url:'https://mail.dmail.ai/login?icode=393233'
  118. },
  119. {
  120. name: 'Gitcoin',
  121. type: ['DEFI', 'SWAP'],
  122. BG: getcoinBg,
  123. avatar: getcoinAv,
  124. url:'https://bounties.gitcoin.co/'
  125. },
  126. {
  127. name: 'KaratDAO',
  128. type: ['DAO', 'NFT'],
  129. BG: karatDAOBg,
  130. avatar: karatDAOAv,
  131. url:'https://karatdao.com/mint/claimer?lieutenantAddress=0x0870682e56A9069E7655afD728D91f3653Bff0bE&validatorId=117'
  132. },
  133. ]
  134. let MM = ref()//MetaMaskSDK
  135. // let address = ref('')//钱包地址
  136. let chainId = '0x144'
  137. const MMSDK = new MetaMaskSDK()
  138. MM.value = MMSDK.getProvider()
  139. //监听连接断开(通过监听账号的变化判断是否断开连接)
  140. const listeningDisconnect = () => {
  141. MM.value.on('accountsChanged', (accounts: string[]) => {
  142. if (accounts.length >= 1) {
  143. addressStore.address = accounts[0]
  144. connectWallet()
  145. } else {
  146. addressStore.address = ''
  147. }
  148. })
  149. }
  150. //查询钱包地址
  151. const checkWalletAddress = async () => {
  152. let accounts: string[] = await MM.value.request({method: 'eth_accounts'});//不弹窗
  153. addressStore.address = accounts[0]
  154. getMainTx()
  155. getLiteTx()
  156. getMoreInfo()
  157. await addChain()
  158. await switchEthereumChain()
  159. }
  160. //添加链
  161. const addChain = () => {
  162. MM.value.request({
  163. method: 'wallet_addEthereumChain',
  164. params: [{
  165. chainId: chainId,
  166. chainName: 'zkSync Era Mainnet',
  167. rpcUrls: ['https://mainnet.era.zksync.io'],
  168. blockExplorerUrls: ['https://explorer.zksync.io'],
  169. nativeCurrency: {
  170. name: 'ETH',
  171. symbol: 'ETH',
  172. decimals: 18,
  173. },
  174. }]
  175. })
  176. }
  177. //切换链
  178. const switchEthereumChain = () => {
  179. MM.value.request({
  180. method: 'wallet_switchEthereumChain',
  181. params: [{chainId: chainId}],
  182. }).then(() => {
  183. }).catch(() => {
  184. });
  185. }
  186. //连接钱包按钮
  187. const connectWallet = async () => {
  188. let accounts: string[] = await MM.value.request({method: 'eth_requestAccounts'});
  189. addressStore.address = accounts[0]
  190. getMainTx()
  191. getLiteTx()
  192. getMoreInfo()
  193. await addChain()
  194. await switchEthereumChain()
  195. }
  196. eventBus.on('zksConnectWallet',connectWallet)
  197. //获取主网交易次数
  198. let mainTx = ref('-')
  199. const getMainTx = () => {
  200. getZksEra(addressStore.address).then(({tx2}:{tx2:number}) => {
  201. mainTx.value = tx2.toString()
  202. })
  203. }
  204. //获取lite网交易次数
  205. let liteTx = ref('-')
  206. const getLiteTx = () => {
  207. getZksLite(addressStore.address).then(({tx1}:{tx1:number}) => {
  208. liteTx.value = tx1.toString()
  209. })
  210. }
  211. //获取更多信息
  212. let amount = ref('-')
  213. let fee = ref('-')
  214. let contract = ref('-')
  215. let tradingTimeArr = ref()
  216. let l1Tol2Tx = ref('-')
  217. let l2Tol1Tx = ref('-')
  218. const getMoreInfo = () => {
  219. // getZkSyncBridge(addressStore.address).then((
  220. // {
  221. // totalExchangeAmount,
  222. // contractActivity,
  223. // overTimeArr,
  224. // l1Tol2Times,
  225. // l2Tol1Times
  226. // }:{
  227. // totalExchangeAmount:number
  228. // contractActivity:number
  229. // overTimeArr:any
  230. // l1Tol2Times:number
  231. // l2Tol1Times:number
  232. // }) => {
  233. // amount.value = totalExchangeAmount
  234. // contract.value = contractActivity
  235. // tradingTimeArr.value = overTimeArr
  236. // l1Tol2Tx.value = l1Tol2Times
  237. // l2Tol1Tx.value = l2Tol1Times
  238. // processTime()
  239. // })
  240. getAllZksSyncData(addressStore.address).then((res:any)=>{
  241. amount.value = res.totalExchangeAmount
  242. fee.value = res.totalFee
  243. contract.value = res.contractActivity
  244. tradingTimeArr.value = res.overTimeArr
  245. l1Tol2Tx.value = res.l1Tol2Times
  246. l2Tol1Tx.value = res.l2Tol1Times
  247. processTime()
  248. })
  249. }
  250. //处理时间数据
  251. const monthArr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
  252. let showMonthNumberArr = ref([0,0,0,0,0,0,0,0,0,0,0,0])
  253. let showMonthArr = ref()
  254. const processTime = () => {
  255. let nowDate = new Date().toString()
  256. let nowDateArr = nowDate.split(' ')
  257. let nowMonth = nowDateArr[1]
  258. showMonthArr.value = []
  259. showMonthArr.value.push(nowMonth)
  260. let nowMonthIndex = monthArr.indexOf(nowMonth)
  261. const forLoop = () => {
  262. for (let i = 11; i !== nowMonthIndex ; i--) {
  263. showMonthArr.value.unshift(monthArr[i])
  264. }
  265. }
  266. for (let i = nowMonthIndex; i !== 0 ; i--) {
  267. showMonthArr.value.unshift(monthArr[i-1])
  268. if (i === 1) {
  269. forLoop()
  270. }
  271. }
  272. if (tradingTimeArr.value){
  273. tradingTimeArr.value.forEach((item:any) => {
  274. // if(item.balanceChanges[0].from && item.balanceChanges[0].from.toLowerCase() === addressStore.address.toLowerCase()){
  275. let receivedAt = new Date(Date.parse(item.receivedAt)).toString();
  276. let strArr = receivedAt.split(' ')
  277. let month = strArr[1]
  278. let index = showMonthArr.value.indexOf(month)
  279. showMonthNumberArr.value[index]++
  280. // }
  281. })
  282. }
  283. initEcharts()
  284. }
  285. //初始化echarts
  286. const initEcharts = () => {
  287. let chartDom = document.getElementById('echartsBox1')!
  288. let myChart = echarts.init(chartDom);
  289. let option: EChartsOption;
  290. option = {
  291. tooltip: {
  292. trigger: 'axis',
  293. axisPointer: {
  294. type: 'shadow'
  295. }
  296. },
  297. xAxis: {
  298. type: 'category',
  299. axisTick: {
  300. alignWithLabel: true
  301. },
  302. data: showMonthArr.value
  303. },
  304. yAxis: {
  305. type: 'value',
  306. },
  307. series: [
  308. {
  309. color: '#95a0a4',
  310. data: showMonthNumberArr.value,
  311. type: 'bar'
  312. }
  313. ]
  314. };
  315. option && myChart.setOption(option);
  316. }
  317. //跳转网页
  318. const toLink = (url:string) => {
  319. window.open(url)
  320. }
  321. const toPage = (url:string) => {
  322. router.push(url)
  323. }
  324. const toEmail = (email:string) => {
  325. const emailAddress = email; // 替换为你想发送邮件的收件人地址
  326. const subject = 'Hello'; // 替换为你想在邮件中设置的主题
  327. const body = 'This is the email body.'; // 替换为你想在邮件中设置的内容
  328. const mailtoUrl = `mailto:${emailAddress}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`;
  329. window.open(mailtoUrl);
  330. }
  331. let affix = ref(false)
  332. let chart = ref(false)
  333. const affixMouseenter = () => {
  334. const slideDiv = document.getElementById("slideDiv")!;
  335. slideDiv.style.bottom = "0";
  336. }
  337. const affixMouseleave = () => {
  338. const slideDiv = document.getElementById("slideDiv")!;
  339. slideDiv.style.bottom = "-608px";
  340. }
  341. const getStarkTvl = async () => {
  342. const url = 'https://api.llama.fi/v2/historicalChainTvl/zkSync%20Era';
  343. const response = await axios.get(url);
  344. return response.data;
  345. }
  346. const getZkTvlDetail = async () => {
  347. const url = "https://api.llama.fi/protocols";
  348. const response = await axios.get(url);
  349. let result:any[] = [];
  350. response.data.forEach((item:any) => {
  351. if (item['chains'].includes("zkSync Era") && item.category !== "CEX") {
  352. result.push({
  353. name: item.name,
  354. tvl: item['chainTvls']['zkSync Era'] / 1000000,
  355. });
  356. }
  357. });
  358. result.sort((a, b) => b.tvl - a.tvl);
  359. result = result.slice(0, 10);
  360. return result;
  361. }
  362. let change = ref(0)
  363. let change24h = ref('-')
  364. let nowTvl = ref('-')
  365. const fetchData = async () => {
  366. const result = await getStarkTvl();
  367. change.value = ((result[result.length - 1].tvl - result[result.length - 2].tvl) / result[result.length - 2].tvl) * 100;
  368. change24h.value = change.value.toFixed(2) + '%'
  369. nowTvl.value = (result[result.length - 1].tvl / 1000000).toFixed(2) + 'M'
  370. let VolData:any[] = [];
  371. result.forEach((item:any) => {
  372. VolData.push({
  373. date: new Date(item.date * 1000).toLocaleDateString(),
  374. tvl: item.tvl / 1000000,
  375. });
  376. });
  377. const max = Math.max(...VolData.map(item => item.tvl));
  378. const chart = new Area('TVLBox',{
  379. data: VolData,
  380. xField: 'date',
  381. yField: 'tvl',
  382. smooth: true,
  383. isStack: true,
  384. padding:[60],
  385. color: '#FFF',
  386. // label: {
  387. // style:{
  388. // fill:'#FFF'
  389. // },
  390. // content: (originData) => {
  391. // return `${originData.tvl.toFixed(0)}`;
  392. // },
  393. // },
  394. slider: {
  395. start: 0,
  396. end: 1,
  397. formatter: (v) => moment(v).format('YYYY-MM-DD'),
  398. textStyle:{
  399. fill:'#FFF'
  400. }
  401. },
  402. meta: {
  403. tvl: {
  404. alias: 'TVL(M)',
  405. min: 0,
  406. max: max * 1.1,
  407. }
  408. }
  409. });
  410. chart.render();
  411. }
  412. let TVLTopData = ref()
  413. const fetchData2 = async () => {
  414. let result = await getZkTvlDetail();
  415. TVLTopData.value = result.slice(0,5)
  416. const max = Math.max(...result.map(item => item.tvl));
  417. const chart = new Bar('TVLTop', {
  418. data:result,
  419. xField: 'tvl',
  420. yField: 'name',
  421. color: '#95a0a3',
  422. yAxis: {
  423. label: {
  424. formatter: (v) => `${v}`,
  425. }
  426. },
  427. label: {
  428. position: 'right',
  429. style:{
  430. fill:'#FFF'
  431. },
  432. formatter: (v) => `${v.tvl.toFixed(2)}`,
  433. },
  434. meta: {
  435. tvl: {
  436. alias: 'TVL(M)',
  437. max: max * 1.1,
  438. }
  439. }
  440. });
  441. chart.render();
  442. }
  443. </script>
  444. <template>
  445. <main class="main">
  446. <!-- <div class="mainBG">-->
  447. <!-- <img src="../assets/navBg.png" alt="BG">-->
  448. <!-- </div>-->
  449. <!-- <Nav @doSth="connectWallet"/>-->
  450. <div class="dataBox">
  451. <div class="left">
  452. <div class="leftTop">
  453. <div class="item">
  454. <div class="top">
  455. <div class="img">
  456. <img v-show="!sunStore.sun" src="../assets/group1-white.svg" alt="group1">
  457. <img v-show="sunStore.sun" src="../assets/group1.svg" alt="group1">
  458. </div>
  459. <div class="title">
  460. Protocols lnteraction
  461. <el-popover
  462. placement="bottom"
  463. :width="230"
  464. trigger="hover"
  465. effect="dark"
  466. >
  467. <template #reference>
  468. <img src="../assets/info.svg" alt="info">
  469. </template>
  470. <div class="popoverText">
  471. Number of protocolsinteracted
  472. </div>
  473. <div class="popoverText">
  474. with out of allavailable protocols
  475. </div>
  476. </el-popover>
  477. </div>
  478. </div>
  479. <div class="number">
  480. {{ contract }}
  481. </div>
  482. </div>
  483. <div class="item">
  484. <div class="top">
  485. <div class="img">
  486. <img class="img" src="../assets/group4.svg" alt="group2">USDT
  487. </div>
  488. <div class="title">
  489. <span style="width: 150px">amount</span>
  490. <span>fee</span>
  491. </div>
  492. </div>
  493. <div class="number">
  494. <span class="number" style="width: 150px">
  495. {{ amount }}
  496. </span>
  497. <span class="number">
  498. {{fee}}
  499. </span>
  500. </div>
  501. </div>
  502. <img src="../assets/zks.svg" alt="zks">
  503. </div>
  504. <div class="leftBottom">
  505. <div class="item">
  506. <div class="top">
  507. <div class="img">
  508. <img v-show="!sunStore.sun" class="img" src="../assets/group3-white.svg" alt="group2">
  509. <img v-show="sunStore.sun" class="img" src="../assets/group3.svg" alt="group2">
  510. </div>
  511. <div class="title">
  512. Total Transactions
  513. <el-popover
  514. placement="bottom"
  515. :width="250"
  516. trigger="hover"
  517. effect="dark"
  518. >
  519. <template #reference>
  520. <img src="../assets/info.svg" alt="info">
  521. </template>
  522. <div class="popoverText">
  523. Total zkSync lite
  524. </div>
  525. <div class="popoverText">
  526. transactions issuedfrom the account
  527. </div>
  528. </el-popover>
  529. </div>
  530. </div>
  531. <div class="number">
  532. {{ liteTx }}
  533. <img @click="toLink('https://zkscan.io/')" style="cursor: pointer" src="../assets/arrow-right-up-line.svg" alt="arrow">
  534. </div>
  535. </div>
  536. <div class="item">
  537. <div class="top">
  538. <div class="img">
  539. <img v-show="!sunStore.sun" class="img" src="../assets/group2-white.svg" alt="group2">
  540. <img v-show="sunStore.sun" class="img" src="../assets/group2.svg" alt="group2">
  541. </div>
  542. <div class="title">
  543. Total Transactions
  544. <el-popover
  545. placement="bottom"
  546. :width="250"
  547. trigger="hover"
  548. effect="dark"
  549. >
  550. <template #reference>
  551. <img src="../assets/info.svg" alt="info">
  552. </template>
  553. <div class="popoverText">
  554. Total zkSync era
  555. </div>
  556. <div class="popoverText">
  557. transactions issuedfrom the account
  558. </div>
  559. </el-popover>
  560. </div>
  561. </div>
  562. <div class="number">
  563. {{ mainTx }}
  564. <img @click="toLink('https://explorer.zksync.io/')" style="cursor: pointer" src="../assets/arrow-right-up-line.svg" alt="arrow">
  565. </div>
  566. </div>
  567. <div class="item" style="height: 94px">
  568. <div class="top">
  569. <div class="img">
  570. <img v-show="!sunStore.sun" class="img" src="../assets/official-bridge-white.svg" alt="group2">
  571. <img v-show="sunStore.sun" class="img" src="../assets/official-bridge-black.svg" alt="group2">
  572. </div>
  573. <div style="display: flex;gap:40px">
  574. <div style="display: flex;flex-direction: column;gap:20px">
  575. <img v-show="!sunStore.sun" src="../assets/L1-To-L2-white.svg" alt="To">
  576. <img v-show="sunStore.sun" src="../assets/L1-To-L2.svg" alt="To">
  577. <div class="number">
  578. {{ l1Tol2Tx }}
  579. </div>
  580. </div>
  581. <div style="display: flex;flex-direction: column;gap:20px">
  582. <img v-show="!sunStore.sun" src="../assets/L2-To-L1-white.svg" alt="To">
  583. <img v-show="sunStore.sun" src="../assets/L2-To-L1.svg" alt="To">
  584. <div class="number">
  585. {{ l2Tol1Tx }}
  586. </div>
  587. </div>
  588. </div>
  589. </div>
  590. </div>
  591. </div>
  592. </div>
  593. <div style="position: relative">
  594. <div style="display: flex;align-items: center;position: absolute;left: 40px;top:10px;z-index: 10;gap:4px">
  595. Transactions Over Time
  596. <el-popover
  597. placement="right"
  598. :width="240"
  599. trigger="hover"
  600. effect="dark"
  601. >
  602. <template #reference>
  603. <img src="../assets/info.svg" alt="info">
  604. </template>
  605. <div class="popoverText">
  606. Number of transactions permonth
  607. </div>
  608. </el-popover>
  609. </div>
  610. <div class="right" id="echartsBox1">
  611. </div>
  612. </div>
  613. </div>
  614. <div class="projectBox">
  615. <div class="item" @click="toLink(item.url)" v-for="item in dataArr">
  616. <div class="BG">
  617. <img class="BG" :src="item.BG" alt="BG">
  618. </div>
  619. <div class="infoBox">
  620. <div class="avatar">
  621. <img class="avatar" :src="item.avatar" alt="avatar">
  622. </div>
  623. <div class="nameAndType">
  624. <div class="name">
  625. {{ item.name }}
  626. </div>
  627. <div class="typeBox">
  628. <div class="type" v-for="item1 in item.type">
  629. {{ item1 }}
  630. </div>
  631. </div>
  632. </div>
  633. </div>
  634. </div>
  635. </div>
  636. <div class="dividingLine"/>
  637. <Footer/>
  638. <div class="dividingLine"/>
  639. <div style="height: 61px;" @mouseenter="affixMouseenter" @mouseleave="affixMouseleave">
  640. <div class="dataChart" id="slideDiv">
  641. <div class="box">
  642. <div class="titleBox">
  643. <div class="title">
  644. <img src="../assets/title.svg" alt="title">
  645. zkSync info
  646. </div>
  647. <!-- <div class="exit" v-show="chart" @click="chart = false">-->
  648. <!-- <img src="../assets/exit.svg" alt="exit">-->
  649. <!-- Exit-->
  650. <!-- </div>-->
  651. </div>
  652. <div class="data" >
  653. <div class="dataGroup">
  654. <div class="dataGroupTitle">
  655. <img src="../assets/TVL.svg" alt="TVL">
  656. TVL(M)
  657. </div>
  658. <div class="itemBox">
  659. <div class="item">
  660. <div class="text1">
  661. {{nowTvl}}
  662. </div>
  663. <div class="text2">
  664. Now
  665. </div>
  666. </div>
  667. <div class="item">
  668. <div class="text3" v-show="change>=0">
  669. {{change24h}}
  670. </div>
  671. <div class="text3" style="color: red" v-show="change<0">
  672. {{change24h}}
  673. </div>
  674. <div class="text2">
  675. 24h
  676. </div>
  677. </div>
  678. </div>
  679. </div>
  680. <div class="verticalLine"/>
  681. <div class="dataGroup">
  682. <div class="dataGroupTitle">
  683. <img src="../assets/tag.svg" alt="TVL">
  684. Top 5 TVL(M)
  685. </div>
  686. <div class="itemBox">
  687. <div class="item" v-for="(item,index) in TVLTopData">
  688. <div class="text1">
  689. {{ item.tvl.toFixed(2) }}M
  690. </div>
  691. <div class="text2">
  692. {{ item.name }}
  693. </div>
  694. </div>
  695. </div>
  696. </div>
  697. </div>
  698. <!-- <div class="viewMore" v-show="affix" @click="chart = true">-->
  699. <!-- <img src="../assets/viewMore.svg" alt="viewMore">-->
  700. <!-- view more-->
  701. <!-- </div>-->
  702. <div class="chartBox">
  703. <div class="TVLBox" id="TVLBox">
  704. </div>
  705. <div class="TVLTop" id="TVLTop">
  706. </div>
  707. </div>
  708. </div>
  709. </div>
  710. </div>
  711. </main>
  712. </template>
  713. <style scoped lang="scss">
  714. .main {
  715. width: 1440px;
  716. height: 100%;
  717. margin: auto;
  718. //border: 1px solid var(--vt-c-border);
  719. //border-top: none;
  720. //border-bottom: none;
  721. padding: 0 60px 0;
  722. .dividingLine {
  723. width: 100vw;
  724. height: 1px;
  725. border-bottom: 1px solid var(--vt-c-border);
  726. position: absolute;
  727. left: 0;
  728. }
  729. .mainBG{
  730. position: absolute;
  731. top: 0;
  732. left: 0;
  733. right: 0;
  734. display: flex;
  735. justify-content: center;
  736. z-index: -1;
  737. }
  738. .topBar {
  739. display: flex;
  740. align-items: center;
  741. justify-content: space-between;
  742. padding: 0 60px 25px;
  743. margin: 0 -60px;
  744. border-bottom: 1px solid var(--vt-c-border);
  745. .left{
  746. display: flex;
  747. align-items: center;
  748. .nav{
  749. font-family: HONOR Sans CN;
  750. font-size: 21px;
  751. font-style: normal;
  752. font-weight: 700;
  753. line-height: normal;
  754. padding: 0 60px;
  755. height: 100px;
  756. display: flex;
  757. align-items: center;
  758. margin-bottom: -25px;
  759. margin-top: -30px;
  760. border-right: 1px solid var(--vt-c-border);
  761. position: relative;
  762. .line{
  763. position: absolute;
  764. width: 100%;
  765. height: 10px;
  766. background: var(--color-text);
  767. left: 0;
  768. bottom: 0;
  769. }
  770. }
  771. .navOne{
  772. font-family: HONOR Sans CN;
  773. font-size: 21px;
  774. font-style: normal;
  775. font-weight: 700;
  776. line-height: normal;
  777. padding: 0 60px;
  778. height: 100px;
  779. display: flex;
  780. align-items: center;
  781. margin-bottom: -25px;
  782. margin-top: -30px;
  783. border-right: 1px solid var(--vt-c-border);
  784. margin-left: 57px;
  785. border-left: 1px solid var(--vt-c-border);
  786. position: relative;
  787. .line{
  788. position: absolute;
  789. width: 100%;
  790. height: 10px;
  791. background: var(--color-text);
  792. left: 0;
  793. bottom: 0;
  794. }
  795. }
  796. }
  797. .mid{
  798. font-weight: 400;
  799. font-size: 15px;
  800. line-height: 21px;
  801. font-family: 'Chillax';
  802. text-transform: uppercase;
  803. }
  804. .right {
  805. display: flex;
  806. align-items: center;
  807. gap:40px;
  808. cursor: pointer;
  809. .button {
  810. width: fit-content;
  811. height: 44px;
  812. display: flex;
  813. align-items: center;
  814. gap: 6px;
  815. background: #010101;
  816. padding: 0 24px;
  817. font-weight: 500;
  818. font-size: 15px;
  819. line-height: 20px;
  820. color: #FFFFFF;
  821. cursor: pointer;
  822. }
  823. .connect {
  824. width: fit-content;
  825. height: 44px;
  826. display: flex;
  827. align-items: center;
  828. gap: 6px;
  829. background: #FFFFFF;
  830. border: 1px solid #010101;
  831. border-radius: 30px;
  832. padding: 0 24px;
  833. font-weight: 500;
  834. font-size: 15px;
  835. line-height: 20px;
  836. color: #010101;
  837. }
  838. }
  839. }
  840. .chainBox{
  841. width: 100%;
  842. display: flex;
  843. align-items: center;
  844. margin: 0 -60px;
  845. .item{
  846. padding: 24px 65px;
  847. //border-right: 1px solid var(--vt-c-border);
  848. font-family: HONOR Sans CN;
  849. font-size: 15px;
  850. font-style: normal;
  851. font-weight: 700;
  852. line-height: normal;
  853. position: relative;
  854. cursor: pointer;
  855. .line{
  856. position: absolute;
  857. width: 60px;
  858. height: 4px;
  859. background: var(--color-text);
  860. left: 0;
  861. right: 0;
  862. margin: auto;
  863. bottom: 0;
  864. }
  865. }
  866. }
  867. .dataBox {
  868. height: 365px;
  869. margin: 0 -60px;
  870. //border-bottom: 1px solid var(--vt-c-border);
  871. //border-top: 1px solid var(--vt-c-border);
  872. display: flex;
  873. align-items: center;
  874. border: 1px solid var(--vt-c-border);
  875. .left {
  876. width: 845px;
  877. height: 100%;
  878. border-right: 1px solid var(--vt-c-border);
  879. .item {
  880. width: 260px;
  881. display: flex;
  882. flex-direction: column;
  883. gap: 20px;
  884. .top {
  885. display: flex;
  886. flex-direction: column;
  887. gap: 6px;
  888. .img {
  889. height: 16px;
  890. }
  891. }
  892. .publicChainBox{
  893. display: flex;
  894. align-items: center;
  895. gap:40px;
  896. .publicChainItem{
  897. display: flex;
  898. flex-direction: column;
  899. gap:20px;
  900. }
  901. }
  902. .title {
  903. display: flex;
  904. align-items: center;
  905. gap: 8px;
  906. font-weight: 400;
  907. font-size: 14px;
  908. line-height: 18px;
  909. //color: #010101;
  910. font-family: 'HONOR Sans CN';
  911. .popoverText{
  912. font-weight: 400;
  913. font-size: 12px;
  914. line-height: 24px;
  915. }
  916. }
  917. .number {
  918. display: flex;
  919. align-items: center;
  920. gap: 8px;
  921. font-weight: 700;
  922. font-size: 26px;
  923. line-height: 34px;
  924. //color: #010101;
  925. }
  926. }
  927. .leftTop {
  928. height: 175px;
  929. width: 100%;
  930. display: flex;
  931. justify-content: space-between;
  932. align-items: center;
  933. padding-left: 60px;
  934. padding-right: 60px;
  935. border-bottom: 1px solid var(--vt-c-border);
  936. .img{
  937. display: flex;
  938. align-items: center;
  939. font-weight: 700;
  940. gap:4px
  941. }
  942. }
  943. .leftBottom {
  944. display: flex;
  945. align-items: center;
  946. height: 175px;
  947. padding-left: 60px;
  948. }
  949. }
  950. .right {
  951. height: 365px;
  952. width: 596px;
  953. }
  954. }
  955. .projectBox{
  956. display: flex;
  957. flex-wrap: wrap;
  958. overflow:auto;
  959. gap: 28px;
  960. height: 585px;
  961. margin: 0px -60px;
  962. padding: 20px 0;
  963. //border-bottom: 1px solid var(--vt-c-border);
  964. border: 1px solid var(--vt-c-border);
  965. .item {
  966. height: 256px;
  967. width: 336px;
  968. cursor: pointer;
  969. .BG {
  970. width: 100%;
  971. height: 175px;
  972. }
  973. .infoBox {
  974. display: flex;
  975. align-items: center;
  976. gap: 12px;
  977. padding: 0 24px;
  978. height: 80px;
  979. //border: 1px solid #010101;
  980. border-top: none;
  981. background: #141414;
  982. .avatar {
  983. width: 40px;
  984. height: 40px;
  985. border-radius: 50%;
  986. }
  987. .nameAndType {
  988. display: flex;
  989. flex-direction: column;
  990. gap: 2px;
  991. .name {
  992. font-weight: 700;
  993. font-size: 17px;
  994. line-height: 22px;
  995. color: #ffffff;
  996. }
  997. .typeBox {
  998. display: flex;
  999. align-items: center;
  1000. gap: 10px;
  1001. .type {
  1002. width: fit-content;
  1003. font-weight: 400;
  1004. font-size: 12px;
  1005. line-height: 16px;
  1006. color: #898989;
  1007. padding: 0 4px;
  1008. }
  1009. .type::before {
  1010. content: "\00B7";
  1011. margin-right: 5px;
  1012. }
  1013. }
  1014. }
  1015. }
  1016. }
  1017. }
  1018. .dataChart{
  1019. width: 100vw;
  1020. position: fixed;
  1021. bottom: -608px;
  1022. left: 0;
  1023. background: rgba(0, 255, 194, 0.10);
  1024. backdrop-filter: blur(179px);
  1025. display: flex;
  1026. justify-content: center;
  1027. transition: bottom 0.3s ease-in-out;
  1028. .box{
  1029. width: 1440px;
  1030. height: 100%;
  1031. .titleBox{
  1032. display: flex;
  1033. align-items: center;
  1034. justify-content: space-between;
  1035. padding: 20px 0;
  1036. .title{
  1037. display: flex;
  1038. color: #FFF;
  1039. font-family: HONOR Sans CN;
  1040. font-size: 15px;
  1041. font-style: normal;
  1042. font-weight: 700;
  1043. line-height: normal;
  1044. gap:8px;
  1045. opacity: 0.5;
  1046. }
  1047. .exit{
  1048. color: #FFF73F;
  1049. font-family: Space Grotesk;
  1050. font-size: 15px;
  1051. font-style: normal;
  1052. font-weight: 700;
  1053. line-height: normal;
  1054. display: flex;
  1055. gap:8px;
  1056. cursor: pointer;
  1057. }
  1058. }
  1059. .data{
  1060. display: flex;
  1061. gap:80px;
  1062. align-items: center;
  1063. padding: 24px 0;
  1064. border-bottom: 1px solid #4C4C4C;
  1065. border-top: 1px solid #4C4C4C;
  1066. .dataGroup{
  1067. display: flex;
  1068. flex-direction: column;
  1069. gap:16px;
  1070. .dataGroupTitle{
  1071. display: flex;
  1072. color: #FFF;
  1073. font-family: HONOR Sans CN;
  1074. font-size: 15px;
  1075. font-style: normal;
  1076. font-weight: 700;
  1077. line-height: normal;
  1078. gap:8px;
  1079. opacity: 0.5;
  1080. }
  1081. .itemBox{
  1082. display: flex;
  1083. align-items: center;
  1084. gap:80px;
  1085. .item{
  1086. display: flex;
  1087. flex-direction: column;
  1088. gap:8px;
  1089. .text1{
  1090. color: #FFF;
  1091. font-family: HONOR Sans CN;
  1092. font-size: 21px;
  1093. font-style: normal;
  1094. font-weight: 700;
  1095. line-height: normal;
  1096. }
  1097. .text2{
  1098. color: #FFF;
  1099. font-family: HONOR Sans CN;
  1100. font-size: 14px;
  1101. font-style: normal;
  1102. font-weight: 400;
  1103. line-height: normal;
  1104. opacity: 0.5;
  1105. }
  1106. .text3{
  1107. color: #57EB92;
  1108. font-family: HONOR Sans CN;
  1109. font-size: 21px;
  1110. font-style: normal;
  1111. font-weight: 700;
  1112. line-height: normal;
  1113. }
  1114. }
  1115. }
  1116. }
  1117. .verticalLine{
  1118. width: 1px;
  1119. height: 88px;
  1120. border-right: 1px solid #4c4c4c;
  1121. }
  1122. }
  1123. .viewMore{
  1124. width: 100%;
  1125. padding: 20px 0;
  1126. display: flex;
  1127. justify-content: center;
  1128. gap:8px;
  1129. color: #FFF73F;
  1130. font-family: Space Grotesk;
  1131. font-size: 15px;
  1132. font-style: normal;
  1133. font-weight: 700;
  1134. line-height: normal;
  1135. cursor: pointer;
  1136. }
  1137. .chartBox{
  1138. width: 100%;
  1139. height: 468px;
  1140. display: flex;
  1141. .TVLBox{
  1142. width: 840px;
  1143. height: 100%;
  1144. border-right: 1px solid #4c4c4c;
  1145. border-left: 1px solid #4c4c4c;
  1146. }
  1147. .TVLTop{
  1148. width: 600px;
  1149. height: 100%;
  1150. border-right: 1px solid #4c4c4c;
  1151. padding: 60px
  1152. }
  1153. }
  1154. }
  1155. }
  1156. }
  1157. ::-webkit-scrollbar {
  1158. width: 4px; /* 滚动条宽度 */
  1159. }
  1160. // /* 滚动条轨道 */
  1161. // ::-webkit-scrollbar-track {
  1162. // background: #f1f1f1; /* 轨道背景色 */
  1163. // }
  1164. /* 滚动条滑块 */
  1165. ::-webkit-scrollbar-thumb {
  1166. background: #888; /* 滑块背景色 */
  1167. }
  1168. /* 滚动条滑块悬停状态 */
  1169. ::-webkit-scrollbar-thumb:hover {
  1170. background: #555; /* 悬停状态下滑块背景色 */
  1171. }
  1172. </style>