jichoi / lms_front star
이은진 이은진 2024-08-14
240814 이은진 단어장 카드 뒤집기 수정
@ca8f82b1b5cc262a12967fa62f23893c90fa4d3d
client/views/pages/main/Chapter/Chapter2_2.vue
--- client/views/pages/main/Chapter/Chapter2_2.vue
+++ client/views/pages/main/Chapter/Chapter2_2.vue
@@ -12,26 +12,26 @@
       <div class="flex justify-between align-center">
          <div class="pre-btn" @click="goToPage('Chapter2_3')"><img src="../../../../resources/img/left.png" alt="">
          </div>
-         <div class="content title-box" >
+         <div class="content title-box">
             <p class="title mt25 title-bg">STEP 2 - 단어로 공부하는 영어</p>
             <div class="flex align-center mb30" style="justify-content: space-between;margin-right: 9em;">
                <p class="subtitle2 mr20">카드를 뒤집어 보세요.</p>
                <div class="time-bg">
-               <div>
-                  <div class="time">
-                     <p class="second">{{ timer }}</p>
-                     <p class="text">sec</p>
+                  <div>
+                     <div class="time">
+                        <p class="second">{{ timer }}</p>
+                        <p class="text">sec</p>
+                     </div>
                   </div>
                </div>
-            </div>
                <!-- <button><img src="../../../../resources/img/btn10_s.png" alt="">
           </button> -->
             </div>
-   
+
 
             <div class="imgGroup">
                <div class="flex justify-center" style="gap: 90px;">
-                  <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)">
+                  <button class="popTxt" v-for="(item, index) in items" :key="index">
                      <div class="listenGroup">
                         <img :src="item.imgSrc1">
                         <p class="textbox"><img :src="item.imgSrc"></p>
@@ -74,17 +74,17 @@
          this.items[index].isSecondImageVisible = !this.items[index].isSecondImageVisible;
       },
       startTimer() {
-      // 현재 실행 중인 타이머가 있다면 정리
-      if (this.intervalId) {
-        clearInterval(this.intervalId);
-      }
+         // 현재 실행 중인 타이머가 있다면 정리
+         if (this.intervalId) {
+            clearInterval(this.intervalId);
+         }
 
-      // 타이머 및 이미지 토글 상태 초기화
-      this.timer = 0;
-      this.currentIndex = 0; // 현재 타이머 인덱스를 추적
+         // 타이머 및 이미지 토글 상태 초기화
+         this.timer = 0;
+         this.currentIndex = 0; // 현재 타이머 인덱스를 추적
 
-      // 시작 타이머 설정
-      this.runTimer();
+         // 시작 타이머 설정
+         this.runTimer();
       },
 
       runTimer() {
@@ -93,14 +93,14 @@
             if (this.currentIndex == this.items.length)
                return;
             if (this.timer < 3) {
-               this.timer++; 
+               this.timer++;
             } else {
                // 타이머가 끝났을 때, 다음 타이머 설정
                this.timer = 0;
 
                if (this.currentIndex < this.items.length) {
                   // 현재 인덱스에 해당하는 아이템으로 이미지 토글
-                  this.toggleImage(this.currentIndex); 
+                  this.toggleImage(this.currentIndex);
                   this.currentIndex++;
                } else {
                   // 모든 타이머가 완료되었으면 타이머 정리
@@ -110,7 +110,7 @@
                }
             }
          }, 1000);
-    },
+      },
    },
    mounted() {
       this.startTimer()
@@ -134,8 +134,9 @@
    top: 50%;
    left: 50%;
 }
+
 .questionBox {
-  justify-content: space-between;
-  align-items: flex-start;
+   justify-content: space-between;
+   align-items: flex-start;
 }
 </style>
(No newline at end of file)
Add a comment
List