<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<script src="./vue.min.js"></script>
<style>
    * {
        margin: 0;
        padding: 0;
    }
    [v-cloak]{
        display: none;
    }
   #app {
       -webkit-app-region: drag;
       width: 100%;
       box-sizing: border-box;
       background: #fff;
       overflow: hidden;
   }
   .top {
       width: 100%;
       height: 50px;
       display: flex;
       align-items: center;
       justify-content: space-between;
       border-bottom: 1px #ddd dashed;
       padding: 0 10px;
       box-sizing: border-box;
   }
   .top .img {
       width: 32px;
       height: 32px;
       border-radius: 100%;
       display: flex;
       align-items: center;
       justify-content: center;
       background: #314659;
   }
   .top .img img {
       width: 26px;
       height: 26px;
   }
   .top .text {
       color: #999;
       font-size: 14px;
   }
   .translate {
       width: 100%;
       background: #F7F7F9;
       font-size: 12px;
       color: #555;
       box-sizing: border-box;
       padding: 5px;
   }
   .trans-item {
       line-height: 20px;
   }
   .options-item {
       border-bottom: 1px #ddd dashed;
       height: 35px;
       line-height: 35px;
       padding: 0 10px;
       color: #333;
       font-size: 14px;
       cursor: pointer;
   }
    .options-item:last-child {
        border-bottom: none !important;
    }
    .icon {
        width: 20px;
        height: 20px;
        margin-right: 5px;
    }
    .select-item {
        display: flex;
        align-items: center;
    }


    .spinner {
        padding-left: 10px;
    }

    .spinner > div {
        width: 10px;
        height: 10px;
        background-color: #ddd;

        border-radius: 100%;
        display: inline-block;
        -webkit-animation: bouncedelay 1.4s infinite ease-in-out;
        animation: bouncedelay 1.4s infinite ease-in-out;
        /* Prevent first frame from flickering when animation starts */
        -webkit-animation-fill-mode: both;
        animation-fill-mode: both;
    }

    .spinner .bounce1 {
        -webkit-animation-delay: -0.32s;
        animation-delay: -0.32s;
    }

    .spinner .bounce2 {
        -webkit-animation-delay: -0.16s;
        animation-delay: -0.16s;
    }

    @-webkit-keyframes bouncedelay {
        0%, 80%, 100% { -webkit-transform: scale(0.0) }
        40% { -webkit-transform: scale(1.0) }
    }

    @keyframes bouncedelay {
        0%, 80%, 100% {
            transform: scale(0.0);
            -webkit-transform: scale(0.0);
        } 40% {
              transform: scale(1.0);
              -webkit-transform: scale(1.0);
          }
    }
</style>
<script src="./index.js" type="module"></script>
<body>
<div id="app" v-cloak>
  <div class="top" @click="openMainWindow">
    <span class="img"><img src="./assets/logo.png" /></span>
    <span class="text" v-if="selectData.text && selectData.text.length">选择的文本 {{selectData.text.length}} 个</span>
  </div>
  <div class="spinner" v-if="loading">
    <div class="bounce1"></div>
    <div class="bounce2"></div>
    <div class="bounce3"></div>
  </div>
  <div class="translate" v-if="selectData.translate && !loading">
    <div>{{selectData.translate.src}}</div>
    <div v-if="selectData.translate.basic">
      <div v-for="item in selectData.translate.basic.explains">
        {{item}}
      </div>
    </div>
    <div v-else>
      <div v-for="item in selectData.translate.translation">
        {{item}}
      </div>
    </div>
  </div>
  <div @click="() => commonClick(op, selectData.fileUrl)" class="options-item" v-for="op in targetOptions">
    <div class="select-item">
      <img class="icon" :src="op.icon" />
      {{op.name}}
    </div>
  </div>
</div>
</body>
</html>
