
<template>
  <div class="camera-content-1-1">
    <button
      class="return"
      @click="emit('close')"
    />
    <!-- <h1>{{ title }}</h1> -->
    <div class="content-wrap">
      <div
        class="design-wrap"
      >
        <div class="design-wrap-left">
          <div class="left-title">
            元大都用水水系
          </div>
          <p class="left-text text-indent">
            元大都用水的水系，重要的有两条。一条是由金水河、太液池构成的宫苑用水系统。金水河从和义门（今西直门）南入城，后分两支：一支汇入北海，另一支进入中海，再经元宫城的前面流出，经东华门附近汇入通惠河。另一条是由高梁河、海子（积水潭）、通惠河构成的漕运系统。高梁河由和义门北入城，汇为积水潭，经海子桥（即后门桥）往东往南汇入通惠河。这条漕运水系将大运河的终点通州与积水潭连接起来。
          </p>
        </div>
        <div class="design-wrap-right">
          <img
            class="detail-img"
            :src="require(`@/assets/images/CameraContent-2-1-2-img-${currentSwitchIdx + 1}.png`)"
            alt=""
            style="cursor: pointer;"
            @click="handleFull"
          >
          <div class="img-title">
            元大都水系图
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, getCurrentInstance } from "vue"

const {
  windowSizeInCssForRef,
  windowSizeWhenDesignForRef,
} = useSizeAdapt(1920, 968)


const emit = defineEmits(['close'])

const currentSwitchIdx = ref(0)

const instance = getCurrentInstance()
const handleFull = () => {
  instance.appContext.config.globalProperties.$viewerApi({
    options: {},
    images: [
      require(`@/assets/images/CameraContent-2-1-2-img-${currentSwitchIdx.value + 1}.png`)
    ]
  })
}
</script>

<style lang="less" scoped>
@page-height-design-px: 970;

.camera-content-1-1 {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(60px);

  >button.return {
    position: absolute;
    width: 58px;
    height: 58px;
    left: 42px;
    top: 68px;
    background-image: url(@/assets/images/btn-return.png);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    z-index: 10;
  }

  >h1 {
    position: absolute;
    left: 0;
    top: calc(93 / @page-height-design-px * 100vh);
    width: 100%;
    height: calc(120 / @page-height-design-px * 100vh);
    background-image: url(@/assets/images/camera-content-2-1-1-title-bg.png);
    background-size: auto 100%;
    background-repeat: no-repeat;
    background-position: center center;
    font-size: calc(32 / @page-height-design-px * 100vh);
    font-family: "SourceHanSansSC-Normal";
    font-weight: 800;
    color: #FFEEC0;
    line-height: calc(38 / @page-height-design-px * 100vh);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
  }

  >.content-wrap {
    position: absolute;
    left: 50%;
    top: 54%;
    width: 100%;
    // width: calc(1920 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
    height: calc(723 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
    transform: translate(-50%, -50%);

    >.switch-wrap {
      position: absolute;
      right: calc(65 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
      bottom: calc(83 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
      z-index: 10;

      >button {
        width: calc(118 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
        height: calc(118 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
        background-image: url(@/assets/images/camera-content-1-1-1-swtich-btn-bg.png);
        background-size: 60%;
        background-repeat: no-repeat;
        background-position: center center;
        font-size: calc(24 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
        font-family: Source Han Sans SC, Source Han Sans SC;
        font-weight: 400;
        color: #FFFFFF;
        line-height: calc(28 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
        letter-spacing: calc(4 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
      }

      >button:last-of-type {
        margin-left: calc(60 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
      }

      >button.active {
        background-image: url(@/assets/images/camera-content-1-1-1-swtich-btn-bg-active.png);
        background-size: 100%;
      }
    }

    >.design-wrap {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background-image: url(@/assets/images/camera-content-2-1-1-design-bg.png);
      background-size: 100% 100%;
      background-repeat: no-repeat;
      background-position: center center;
      display: flex;
      justify-content: space-evenly;
      align-items: center;
      >.design-wrap-left {
        width: calc(720 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
        >.left-title {
          width: calc(579 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
          height: calc(62 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
          color: #6A3906 ;
          font-family: "SourceHanSerifCN-SemiBold";
          font-size: 22px;
          background: url(@/assets/images/camera-content-3-1-3-tab-1-img.png);
          background-size: cover;
          line-height: calc(62 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
          padding-left: calc(70 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
        }
        >.left-text {
          // font-family: 'SourceHanSansSC-Normal';
          margin-top: 25px;
          padding-right: 20px;
          height: calc(300 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
          overflow: auto;
          // font-family: 'SourceHanSansSC-Normal';
          // letter-spacing: 3px;
          font-size: 18px;
          line-height: 30px;
          font-size: calc(20 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
          >strong {
            color: #000000;
            font-family: 'SourceHanSansSC-Bold';
            margin-bottom: 10px;
          }
        }
      }
      >.design-wrap-right {
        width: calc(818 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        >.detail-img {
          width: 100%;
        }
        >.img-title{
          margin-top: 0.5em;
        }
      }
    }
  }
}

@media screen and (max-height: 740px) {
  .camera-content-1-1 > .content-wrap {
    top: 50%;

    .design-wrap {
      .design-wrap-left {
        width: calc(820 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));

        .left-title {
          font-size: 26px !important;
        }
        .left-text {
          height: calc(400 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
        }
      }
      .design-wrap-right {
        width: calc(920 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
      }
    }
  }
}
</style>