
<template>
  <div class="camera-content-1-1">
    <button
      class="return"
      @click="emit('close')"
    />
    <h1>造福百姓</h1>
    <div class="content-wrap">
      <div class="left">
        <h2 class="one">
          {{ currentSwitchIdx== 0 ? '大运河给大都百姓生活带来的便利' :'运河商船的主要货物' }}
        </h2>
        <p class="one text-indent">
          {{ currentSwitchIdx == 0 ? '至元三十年（1293）通惠河工程完成后，漕船可以经通惠河入大都南城垣，沿皇城东垣外，过今地安门桥（万宁桥）下，停泊在积水潭内。因此，当时积水潭的东岸、北岸是元大都城内非常繁华的商业区，如鼓楼的斜街市、海子桥等都是市场。' :'水路的畅通，使得元代景德镇等地的瓷器可以比较便利地通过水路运至大都。在元大都遗址的居民区中，来自全国各地的数以万计的瓷片被发掘出土，未曾来得及带走便匆匆掩埋的元代窖藏中还遗留着精美的元代青花瓷器。在元大都所发现的瓷器之中又以磁州窑、景德镇窑、钧窑、龙泉窑的产品最为丰富。这些被考古学重新赋予生命的器物，使那段逝去的历史复活，我们似乎还听得见大都城内市井的喧闹、诗人的吟唱，闻得到茶、酒的醇香。' }}
        </p>
      </div>
      <div
        v-if="currentSwitchIdx == 1"
        class="right"
      >
        <!-- <img
          v-if="currentSwitchIdx == 0"
          class=""
          src="@/assets/images/camera-content-2-3-1-img.png"
          alt=""
          draggable="false"
        > -->
        <img
          class=""
          :style="{width: 'auto'}"
          src="@/assets/images/camera-content-2-3-1-img-2.png"
          alt=""
          draggable="false"
        >
      </div>
      <div
        class="next-btn"
        @click="() => {
          currentSwitchIdx == 0 ? currentSwitchIdx += 1 : currentSwitchIdx -= 1
        }"
      >
        <span>{{ currentSwitchIdx == 0 ? '下一页' : '上一页' }}</span>
      </div>
    </div>
  </div>
</template>

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

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

const emit = defineEmits(['close'])

const currentSwitchIdx = ref(0)
</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;
  }
  >h1 {
    position: absolute;
    left: 0;
    top: calc(100 / @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: "Source Han Serif CN Heavy";
    color: #514418;
    line-height: calc(35 / @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%);
    background-image: url(@/assets/images/camera-content-2-1-1-design-bg.png);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    >.left{
      flex: 0 0 auto;
      width: calc(818 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
      height: calc(438 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
      >h2{
        width: calc(616 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
        height: calc(62 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
        font-size: calc(28 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
        font-family: "SourceHanSerifCN-SemiBold";
        color: #6A3906;
        letter-spacing: calc(5 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
        background-image: url(@/assets/images/camera-content-1-1-3-title-bg.png);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center center;
        display: flex;
        align-items: center;
        padding-left: calc(72 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
        margin-bottom: calc(15 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
      }
      >p{
        font-size: calc(20 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
        // font-family: Source Han Sans CN, Source Han Sans CN;
        font-weight: 300;
        color: #000000;
        line-height: 30px;
        // letter-spacing: calc(8 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
      }
      >p.one{
        margin-bottom: calc(50 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
      }
    }
    >.right{
      flex-shrink: 0;
      position: relative;
      width: 788px;
      height: calc(387 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
      background: rgba(145,129,117,0.25);
      border: 1px solid #FFE88B;
      padding: calc(25 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
      box-sizing: border-box;
      display: flex;
      justify-content: center;
      align-items: center;
      >img{
        width: calc(726 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
      }
    }
    >.next-btn {
      width: calc(150 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
      height: calc(50 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
      position: absolute;
      background: url(@/assets/images/CameraContent-2-1-1-next-btn.png);
      background-size: cover;
      right: calc(245 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
      bottom: calc(69 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
      display: flex;
      justify-content: center;
      align-items: center;
      cursor: pointer;
      >span {
        font-size: 16px;
        color: #6A3906;
        font-family: 'SourceHanSerifCN-Heavy';
        margin-left: -20px;
      }
    }
  }
}
</style>