<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      大屏適配方案

      <template>
        <div ref="appRef" class="app-viewport" id="appRef">
         
        </div>
      </template>
      
      <script>
      let loading = null;
      // import drawMixin from '../libs/drawMixin';
      import headBar from './components/headBar.vue';
      import { mapGetters } from 'vuex';
      import autofit from 'autofit.js'
      
      export default {
        name: 'Layout',
        components: {
          headBar,
        },
        // mixins: [drawMixin],
        data() {
          return {
            isIndex: true,
            screenRatioByDesign: 1920 / 1080,
            currentPath: '/home',
            menuIndex: 0,
          };
        },
        computed: {
          ...mapGetters(['moduleTypeControl']),
        },
        watch: {
          currentPath: {
            handler() {
              this.changeMenu();
            },
          },
        },
        beforeCreate() {
          loading = this.$loading({
            lock: true,
            text: 'Loading',
            spinner: 'el-icon-loading',
            background: 'rgba(0, 0, 0, 0.7)',
          });
        },
        mounted() {
          // this.setHtmlFontSize();
          // window.addEventListener('resize', this.setHtmlFontSize.bind(this));
          autofit.init({
          dh: 1080,
          dw: 1920,
          el: "#appRef",
          resize: true,
        });
        },
        created() {
          loading.close();
        },
        methods: {
          setHtmlFontSize() {
            const html = document.getElementsByTagName('html')[0];
            const width = document.body.clientWidth;
            const height = document.body.clientHeight;
            const screenRatio = width / height;
            var fontSize =
              ((screenRatio > this.screenRatioByDesign
                ? this.screenRatioByDesign / screenRatio
                : 1) *
                width) /
              10;
      
            /* const scale = height / 1080
            var fontSize = (192 * Math.min(scale, 1)) */
            html.style.setProperty('font-size', `${fontSize}px`);
          },
      
        },
      };
      </script>
      
      <style lang="scss" scoped>
      .app-viewport {
        //width: 1920px;
        //height: 100%;
        //position: absolute;
        //top: 50%;
        //left: 50%;
        //transform: translate(-50%, -50%);
        //transform-origin: left top;
        //overflow: hidden;
        //background: #010816;
        //transition: all 0.3s linear;
        //=======用于px轉rem 用 pxtorem 插件 配合 setHtmlFontSize 方法
      //position: absolute;
        //margin: auto;
        //top: 0;
        //bottom: 0;
        //left: 0;
        //right: 0;
        //width: 100%;
        //height: 100%;
        //background: url(../assets/imgs/big_background.png) no-repeat center center;
        //background-size: 100% 100%;
        //transition: all 0.3s linear;
        //============20240117  用 drawMixin 樣式引用
      
        //width: 1920px;
        //height: 1080px;
        //position: absolute;
        //top: 50%;
        //left: 50%;
        //transform: translate(-50%, -50%);
        //transform-origin: left top;
        //overflow: hidden;
        //background: url(../assets/imgs/big_background.png) no-repeat center center;
        //background-size: 100% 100%;
        //transition: all 0.3s linear;
        //=========== 用 插件 autofit 一行搞定 
      background: url(../assets/imgs/big_background.png) no-repeat center center; background-size: 100% 100%; transition: all 0.3s linear; .main-box { width: 100%; height: 100%; color: #fff; padding: 17px 24px; } .menu-box { position: absolute; bottom: 16px; left: 50%; display: flex; width: 1156px; height: 88px; margin-left: -578px; background: url(../assets/imgs/bottom_frame.png) no-repeat center center; background-size: 100% 100%; display: flex; justify-content: center; align-items: center; .menu-box-sub { width: 134px; height: 60px; background: url('../assets/imgs/button_no.png') no-repeat center center; background-size: 100% 100%; margin: 0 5px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-family: PingFang SC; font-weight: 400; color: #9bb9e0; line-height: 23px; text-shadow: 0px 0px 8px #06293e; cursor: pointer; &.active { color: #ffffff; line-height: 25px; background: linear-gradient(180deg, #ffffff 0%, #4bd8ff 100%); -webkit-background-clip: text; background: url('../assets/imgs/button_had.png') no-repeat center center; background-size: 100% 100%; } } } } </style>
      // 屏幕適配 mixin 函數
      
      // * 默認縮放值
      const scale = {
        width: '1',
        height: '1',
      }
      
      // * 設計稿尺寸(px)
      const baseWidth = 1920
      const baseHeight = 1080
      
      // * 需保持的比例(默認1.77778)
      const baseProportion = parseFloat((baseWidth / baseHeight).toFixed(5))
      
      export default {
        data() {
          return {
            // * 定時函數
            drawTiming: null
          }
        },
        mounted () {
          this.calcRate()
          window.addEventListener('resize', this.resize)
        },
        beforeDestroy () {
          window.removeEventListener('resize', this.resize)
        },
        methods: {
          calcRate () {
            let _this = this
            const appRef = this.$refs["appRef"]
            //console.log(appRef)
            if (!appRef) return
            // 當前寬高比
            const currentRate = parseFloat((window.innerWidth / window.innerHeight).toFixed(5))
            if (appRef) {
              if (currentRate > baseProportion) {
                // 表示更寬
                scale.width = ((window.innerHeight * baseProportion) / baseWidth).toFixed(5)
                scale.height = (window.innerHeight / baseHeight).toFixed(5)
                appRef.style.transform = `scale(${scale.width}, ${scale.height}) translate(-50%, -50%)`
              } else {
                // 表示更高
                scale.height = ((window.innerWidth / baseProportion) / baseHeight).toFixed(5)
                scale.width = (window.innerWidth / baseWidth).toFixed(5)
                appRef.style.transform = `scale(${scale.width}, ${scale.height}) translate(-50%, -50%)`
              }
            }
            // _this.$store.dispatch('app/set_scale', scale.width)
          },
          resize () {
            clearTimeout(this.drawTiming)
            this.drawTiming = setTimeout(() => {
              this.calcRate()
            }, 200)
          }
        },
      }

       

      postcss: {
              plugins: [
                pxtorem({
                  rootValue: 192,
                  propList: ['*']
                })
              ]
            },

       

      posted @ 2024-01-17 18:08  abcByme  閱讀(61)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 凹凸国产熟女精品视频| 亚洲国产免费图区在线视频| 国产精品一线二线三线区| 亚洲欧美自偷自拍视频图片| 18禁裸乳无遮挡自慰免费动漫| 成人乱码一区二区三区四区| 忘忧草在线社区www中国中文| 免费国产又色又爽又黄的网站| 国产日女人视频在线观看| 国产精品一区二区久久岳| 欧美在线一区二区三区精品| 国产首页一区二区不卡| 国产国产人免费人成免费| 日韩中文字幕亚洲精品| 国产麻豆9l精品三级站| 日韩精品中文字幕国产一| 国产久免费热视频在线观看| 龙海市| 亚洲伊人久久综合成人| 国产二区三区视频在线| 99久久er热在这里只有精品99| 亚洲一区二区三区18禁| 亚洲另类激情专区小说图片| 亚洲国产欧美在线看片一国产| 韩国 日本 亚洲 国产 不卡| 九九热在线视频精品免费| 国产精品青草久久久久福利99| 搡老熟女老女人一区二区| 久久精品国产亚洲夜色av| 亚洲色欲在线播放一区| 欧美精欧美乱码一二三四区 | 亚洲18禁私人影院| 精品一区二区三区不卡| 国产日韩av二区三区| 久久国产欧美日韩精品图片| 精品人妻中文无码av在线| VA在线看国产免费| 欧美激情一区二区三区在线| 亚洲大尺度一区二区三区| 成人亚欧欧美激情在线观看| 亚洲AVAV天堂AV在线网阿V|