<template>
  <div class="footerBox">
    <div class="content">
      <div class="box">
        <div class="navs">
          <div class="nav-item" @click="goPage('/')">
            <i class="iconfont icon-shouye"></i>
            <span class="title">Home</span>
          </div>
          <div class="nav-item" @click="goto('productCenter')">
            <i class="iconfont icon-wodechanpin"></i>
            <span class="title">Product Center</span>
          </div>
          <div class="nav-item" @click="goto('service')">
            <i class="iconfont icon-zhuanshufuwu"></i>
            <span class="title">Service</span>
          </div>
          <div class="nav-item" @click="goto('projectCases')">
            <i class="iconfont icon-gongcheng"></i>
            <span class="title">Project Cases</span>
          </div>
          <div class="nav-item" @click="goPage('/news/all')">
            <i class="iconfont icon-24gl-newspaper"></i>
            <span class="title">News</span>
          </div>
          <div class="nav-item" @click="goPage('/contactUs')">
            <i class="iconfont icon-lianxiwomen"></i>
            <span class="title">Contact Us</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script  setup lang="ts">
import { onMounted } from "vue";
import router from "../router";

const goto = (idname: any) => {
  document.getElementById(idname)?.scrollIntoView()
}

onMounted(async () => {

})

const goPage = (url: any) => {
  document.documentElement.scrollTop = 0
  router.push(url)
}
</script>

<style scoped lang="less">
.iconfont {
  color: #ffffff;
  font-size: 2rem;
}

.footerBox {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  padding: 1rem 0 1rem;
  background-color: #0b1030;
  white-space: nowrap;
  position: relative;

  .content {
    width: 100%;
    max-width: 75rem;
    margin: auto;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
  }

  .box {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    // margin-top: 2.5rem;

    .navs {
      display: -webkit-box;
      display: -webkit-flex;
      display: -ms-flexbox;
      display: flex;
      justify-content: space-around;
      vertical-align: baseline;
      position: relative;
      left: 50%;
      transform: translateX(-50%);

      .nav-item {
        cursor: pointer;
        position: relative;
        top: 50%;
        transform: translateY(-40%);
        margin-right: 3.125rem;
        // margin: 1rem 3.125rem;
        display: flex;
        flex-direction: column;
        align-items: center;

        .title {
          font-size: 15px;
          font-weight: bold;
          color: #fff;
          line-height: 1.3125rem;
          margin-bottom: 0.9375rem;
        }
      }
    }
  }
}

@media screen and (max-width: 1200px) {
  .footerBox {
    padding: 6rem 0;
    overflow: hidden;

    .content {
      padding: 0 1.25rem;

      .box {
        display: initial;
        text-align: center;

        .navs {
          position: absolute;
          top: 2.3rem;
          display: flex;
          justify-content: space-around;
          flex-wrap: wrap;

          .nav-item {
            width: 20%;
            text-align: center;

            .iconfont {
              font-size: 1.5rem;
            }
          }
        }
      }
    }
  }
}</style>