<template>
  <div class="mx-auto md:w-bodySet blockChain min-w-1200 relative flow-root">
    <img
      :src="ccImg"
      alt=""
      class="ccImg"
      style="
        width: 1920px;
        height: 1265px;
        position: absolute;
        top: -658px;
        right: -631px;
      "
    />
    <div class="stone"></div>
    <ChainCard :msgList="msgList" class="chainCard"></ChainCard>
    <ChainTitle class="chain-title" />
    <div class="blue-card"></div>
    <chain-search
      class="chain-search"
      style="width: 600px;"
      :value="value"
      :setValue="setValue"
      :clickSearch="clickSearch"
    />
    <ChainOverview :totalTx="totalTx" />
    <div class="flex justify-between mt-14" style="margin-bottom: 60px;">
      <latest-block :latestBlocks="latestBlocks"></latest-block>
      <latest-tx :latestTxs="latestTxs"></latest-tx>
    </div>
  </div>
</template>

<script lang="ts">
import VueTypedMixins from 'vue-typed-mixins'
import ChainCard from '@/components/pc/BlockChainBrowser/ChainOverview/ChainCard.vue'
import ChainTitle from '@/components/pc/BlockChainBrowser/ChainTitle.vue'
import ChainSearch from '@/components/pc/BlockChainBrowser/ChainSearch.vue'
import ChainOverview from '@/components/pc/BlockChainBrowser/ChainOverview/index.vue'
import LatestBlock from '@/components/pc/BlockChainBrowser/LatestBlock/index.vue'
import LatestTx from '@/components/pc/BlockChainBrowser/LatestTx/index.vue'
import ccImg from '@/assets/images/blockChainBrowser/cc-image.png'
import blockChainBrowserMixin from '@/mixin/blockChainBrowser'

export default VueTypedMixins(blockChainBrowserMixin).extend({
  components: {
    ChainCard,
    ChainTitle,
    ChainSearch,
    ChainOverview,
    LatestBlock,
    LatestTx,
  },
  data() {
    return {
      ccImg,
    }
  },
})
</script>

<style scoped>
.blockChain {
  padding-top: 64px;
}
.ccImg {
  animation-name: rotate;
  animation-fill-mode: forwards;
  animation-duration: 0.7s;
  animation-delay: 0.4s;
}
@keyframes rotate {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(90deg);
    top: -549px;
    right: -1073px;
  }
}
.chainCard {
  position: absolute;
  z-index: 2;
  top: 102px;
  animation-name: slideIn;
  animation-duration: 0.7s;
  animation-timing-function: ease-out;
}
.chain-title {
  position: absolute;
  top: 172px;
  left: 575px;
}
.chain-search {
  position: absolute;
  top: 472px;
  left: 572px;
  animation-name: fadeIn;
  animation-duration: 1s;
  animation-timing-function: ease-out;
  animation-delay: 0.5s;
  opacity: 0;
  animation-fill-mode: forwards;
}
.stone {
  height: 832px;
}
.blue-card {
  position: absolute;
  top: 0px;
  left: 197px;
  width: 600px;
  height: 840px;
  background: #2545cb;
  animation-name: slideDown;
  animation-duration: 0.7s;
  animation-timing-function: ease-out;
}
</style>
<style>
@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}
</style>
