Browse Source

更新文字对齐和

aamin 1 year ago
parent
commit
df29f934fa
3 changed files with 114 additions and 59 deletions
  1. 31 25
      src/data/data.ts
  2. 24 9
      src/view/audioDetail/index.vue
  3. 59 25
      src/view/exhibitionList/index.vue

File diff suppressed because it is too large
+ 31 - 25
src/data/data.ts


+ 24 - 9
src/view/audioDetail/index.vue

@@ -136,7 +136,7 @@ const htmlD = ref("<div>献给所有为了梦想狂奔的人</div><br />你好")
       <div class="content-box">
       <div class="content-box">
         <div class="content-title">{{ currentP.paragraphName }}</div>
         <div class="content-title">{{ currentP.paragraphName }}</div>
         <div class="p">
         <div class="p">
-          <div v-html="currentP.contentText"></div>
+          {{ currentP.contentText.split("").join(" ") }}
         </div>
         </div>
       </div>
       </div>
       <div class="control-box">
       <div class="control-box">
@@ -176,8 +176,10 @@ const htmlD = ref("<div>献给所有为了梦想狂奔的人</div><br />你好")
     background-size: 100% 100%;
     background-size: 100% 100%;
     border-radius: 8px 8px 0 0;
     border-radius: 8px 8px 0 0;
     position: relative;
     position: relative;
+
     .top-img {
     .top-img {
       width: 100%;
       width: 100%;
+
       // height: 30vh;
       // height: 30vh;
       img {
       img {
         width: 100%;
         width: 100%;
@@ -186,31 +188,44 @@ const htmlD = ref("<div>献给所有为了梦想狂奔的人</div><br />你好")
         box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
         box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
       }
       }
     }
     }
+
     .content-box {
     .content-box {
       width: 100%;
       width: 100%;
       height: 55vh;
       height: 55vh;
       overflow: auto;
       overflow: auto;
       padding: 5%;
       padding: 5%;
+
       .content-title {
       .content-title {
         text-align: center;
         text-align: center;
         font-size: 1.1rem;
         font-size: 1.1rem;
         font-weight: bold;
         font-weight: bold;
         text-shadow: 0px 3px 5px rgba(0, 0, 0, 0.25);
         text-shadow: 0px 3px 5px rgba(0, 0, 0, 0.25);
       }
       }
+
       .p {
       .p {
+        width: 100%;
         font-size: 1rem;
         font-size: 1rem;
         line-height: 1.5rem;
         line-height: 1.5rem;
-        letter-spacing: 6px;
+        letter-spacing: 3px;
         font-weight: 500;
         font-weight: 500;
         white-space: pre-wrap;
         white-space: pre-wrap;
         margin-top: 10px;
         margin-top: 10px;
+        text-align: justify;
+        text-justify:inter-ideograph;
+        // text-align-last: justify;
 
 
-        .html-box {
-          div {
-            text-indent: 2em;
-          }
-        }
+        // .html-box {
+        //   div {
+        //     text-indent: 2em;
+        //   }
+        // }
       }
       }
+
+      // .p::after {
+      //   width: 100%;
+      //   content: "";
+      //   display: inline-block;
+      // }
     }
     }
 
 
     .control-box {
     .control-box {
@@ -233,6 +248,7 @@ const htmlD = ref("<div>献给所有为了梦想狂奔的人</div><br />你好")
           margin: auto;
           margin: auto;
         }
         }
       }
       }
+
       .control-bottom {
       .control-bottom {
         width: 100%;
         width: 100%;
         display: flex;
         display: flex;
@@ -258,5 +274,4 @@ const htmlD = ref("<div>献给所有为了梦想狂奔的人</div><br />你好")
       }
       }
     }
     }
   }
   }
-}
-</style>
+}</style>

+ 59 - 25
src/view/exhibitionList/index.vue

@@ -55,38 +55,26 @@ onMounted(() => {
         <img :src="getAssetURL(`home/${currentScene.coverImg}`)" alt="" />
         <img :src="getAssetURL(`home/${currentScene.coverImg}`)" alt="" />
       </div>
       </div>
       <div class="content-box">
       <div class="content-box">
-        <div
-          class="content-box-item"
-          v-for="(item, index) in currentScene.parts"
-          :key="item.partName"
-        >
-          <div
-            class="item-title"
-            @click="open(index)"
-            v-if="item.partName != ''"
-          >
+        <div class="content-box-item" v-for="(item, index) in currentScene.parts" :key="item.partName">
+          <div class="item-title" @click="open(index)" v-if="item.partName != ''">
             <div class="scroll-wrap">
             <div class="scroll-wrap">
               <div class="scroll-item">
               <div class="scroll-item">
                 {{ item.partName }}
                 {{ item.partName }}
               </div>
               </div>
             </div>
             </div>
-            <img
-              v-show="index != 0"
-              :src="
-                currentPart == index
-                  ? getAssetURL('up.png')
-                  : getAssetURL('down.png')
-              "
-              alt=""
-            />
+            <img v-show="index != 0" :src="currentPart == index
+              ? getAssetURL('up.png')
+              : getAssetURL('down.png')
+              " alt="" />
           </div>
           </div>
           <div class="item-list" v-if="currentPart == index || index == 0">
           <div class="item-list" v-if="currentPart == index || index == 0">
-            <div
-              class="item-list-item"
-              v-for="(p, i) in item.paragraphs"
-              @click="goDetail(p, index)"
-            >
-              {{ p.paragraphName }}
+            <div class="item-list-item" v-for="(p, i) in item.paragraphs" @click="goDetail(p, index)">
+              <div class="scroll-wrap">
+                <div class="scroll-item">
+                  {{ p.paragraphName }}
+                </div>
+              </div>
+
             </div>
             </div>
           </div>
           </div>
         </div>
         </div>
@@ -110,8 +98,10 @@ onMounted(() => {
     background: url(/src\assets\img\contentBg.png);
     background: url(/src\assets\img\contentBg.png);
     background-size: 100% 100%;
     background-size: 100% 100%;
     border-radius: 8px 8px 0 0;
     border-radius: 8px 8px 0 0;
+
     .top-img {
     .top-img {
       width: 100%;
       width: 100%;
+
       // height: 30vh;
       // height: 30vh;
       img {
       img {
         width: 100%;
         width: 100%;
@@ -120,6 +110,7 @@ onMounted(() => {
         box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
         box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
       }
       }
     }
     }
+
     .content-box {
     .content-box {
       width: 100%;
       width: 100%;
       height: 70vh;
       height: 70vh;
@@ -141,6 +132,7 @@ onMounted(() => {
           text-align: center;
           text-align: center;
           line-height: 8vh;
           line-height: 8vh;
           position: relative;
           position: relative;
+
           .scroll-wrap {
           .scroll-wrap {
             max-width: 100%;
             max-width: 100%;
             padding: 0 10px;
             padding: 0 10px;
@@ -148,10 +140,12 @@ onMounted(() => {
             vertical-align: top;
             vertical-align: top;
             overflow: hidden;
             overflow: hidden;
             white-space: nowrap;
             white-space: nowrap;
+
             .scroll-item {
             .scroll-item {
               animation: scroll linear 4s alternate infinite;
               animation: scroll linear 4s alternate infinite;
               float: left;
               float: left;
             }
             }
+
             @keyframes scroll {
             @keyframes scroll {
               0% {
               0% {
                 margin-left: 0;
                 margin-left: 0;
@@ -174,6 +168,7 @@ onMounted(() => {
               }
               }
             }
             }
           }
           }
+
           img {
           img {
             width: 6vw;
             width: 6vw;
             height: 6vw;
             height: 6vw;
@@ -187,6 +182,7 @@ onMounted(() => {
 
 
         .item-list {
         .item-list {
           transition: height 2s;
           transition: height 2s;
+
           &-item {
           &-item {
             width: 100%;
             width: 100%;
             height: 8vh;
             height: 8vh;
@@ -199,9 +195,45 @@ onMounted(() => {
             text-align: center;
             text-align: center;
             line-height: 8vh;
             line-height: 8vh;
             font-weight: bold;
             font-weight: bold;
+
             // white-space: nowrap;
             // white-space: nowrap;
             // overflow: hidden;
             // overflow: hidden;
             // text-overflow: ellipsis;
             // text-overflow: ellipsis;
+            .scroll-wrap {
+              max-width: 100%;
+              padding: 0 10px;
+              display: inline-block;
+              vertical-align: top;
+              overflow: hidden;
+              white-space: nowrap;
+
+              .scroll-item {
+                animation: scroll linear 4s alternate infinite;
+                float: left;
+              }
+
+              @keyframes scroll {
+                0% {
+                  margin-left: 0;
+                  transform: translateX(0);
+                }
+
+                10% {
+                  margin-left: 0;
+                  transform: translateX(0);
+                }
+
+                90% {
+                  margin-left: 100%;
+                  transform: translateX(-100%);
+                }
+
+                100% {
+                  margin-left: 100%;
+                  transform: translateX(-100%);
+                }
+              }
+            }
           }
           }
         }
         }
       }
       }
@@ -209,6 +241,7 @@ onMounted(() => {
       // background: url(/src\assets\img\contentBg.png);
       // background: url(/src\assets\img\contentBg.png);
       // background-size: 100% 100%;
       // background-size: 100% 100%;
     }
     }
+
     .content-box::-webkit-scrollbar-track {
     .content-box::-webkit-scrollbar-track {
       /*滚动条里面轨道*/
       /*滚动条里面轨道*/
       -webkit-box-shadow: inset 0 0 5px transparent;
       -webkit-box-shadow: inset 0 0 5px transparent;
@@ -216,6 +249,7 @@ onMounted(() => {
       background: transparent;
       background: transparent;
     }
     }
   }
   }
+
   .home-icon {
   .home-icon {
     width: 15vw;
     width: 15vw;
     height: 15vw;
     height: 15vw;