jichoi / lms_front star
홍아랑 홍아랑 2024-08-13
240813 홍아랑 지도 문제 및 자물쇠 문제 로직 추가
@f35ba9f4847bcfc61e06845a1eee5ac8bce524a4
client/views/pages/main/Chapter/Chapter1_2.vue
--- client/views/pages/main/Chapter/Chapter1_2.vue
+++ client/views/pages/main/Chapter/Chapter1_2.vue
@@ -21,7 +21,7 @@
                 <article class="flex align-start mb10">
                   <div class="icon mr40">
                     <img src="../../../../resources/img/img37_s.png" alt="">
-                    <p class="name">발화좌</p>
+                    <p class="name">발화자</p>
                   </div>
                   <p class="read">What’s up man, nice to meet you Minsu. how are you today?</p>
                 </article>
@@ -29,13 +29,13 @@
                   <p class="read mr40">What’s up man, nice to meet you Minsu. how are you today?</p>
                   <div class="icon ">
                     <img src="../../../../resources/img/img37_s.png" alt="">
-                    <p class="name">발화좌</p>
+                    <p class="name">발화자</p>
                   </div>
                 </article>
                 <article class="flex align-start mb10">
                   <div class="icon mr40">
                     <img src="../../../../resources/img/img37_s.png" alt="">
-                    <p class="name">발화좌</p>
+                    <p class="name">발화자</p>
                   </div>
                   <p class="read">What’s up man, nice to meet you Minsu. how are you today?</p>
                 </article>
@@ -43,7 +43,7 @@
                   <p class="read mr40">What’s up man, nice to meet you Minsu. how are you today?</p>
                   <div class="icon ">
                     <img src="../../../../resources/img/img37_s.png" alt="">
-                    <p class="name">발화좌</p>
+                    <p class="name">발화자</p>
                   </div>
                 </article>
               </div>
client/views/pages/main/Chapter/Chapter2_10.vue
--- client/views/pages/main/Chapter/Chapter2_10.vue
+++ client/views/pages/main/Chapter/Chapter2_10.vue
@@ -15,54 +15,53 @@
         <p class="title mt25 title-bg">step2</p>
           <div class="flex align-center mb30">
           <p class="subtitle2 mr20">방문이 자물쇠로 잠겨져 있네? 세 개 중에 맞는 열쇠 하나를 찾아줘!</p>
-          <!-- <button><img src="../../../../resources/img/btn10_s.png" alt="">
-          </button> -->
         </div>
 
         <div class="flex align-center justify-center" style="gap: 113px;">
           <div class="imgGroup">
             <div class="flex" style="gap: 60px;">
               <button><img src="../../../../resources/img/img82_42s.png" alt="">
-                <p>1</p>
+                <p>Tell me</p>
               </button>
               <button><img src="../../../../resources/img/img159_42s.png" alt=""></button>
               <button><img src="../../../../resources/img/img83_42s.png" alt="">
-                <p>1</p>
+                <p>Why</p>
               </button>
             </div>
-
           </div>
           <div class="pickGroup">
             <div>
-              <article  class="flex justify-center mb50" style="gap: 60px;">
+              <article class="flex justify-center mb50" style="gap: 60px;">
                 <img src="../../../../resources/img/img84_42s.png" alt="">
                 <div class="flex">
-                  <button><img src="../../../../resources/img/img136_71s.png" alt="">
-                    <p>1</p>
+                  <button @click="handleClick('You are so upset.', 1)">
+                    <img src="../../../../resources/img/img136_71s.png" alt="">
+                    <p :class="{ active: selectedButton === 1 }">1</p>
                   </button>
-                  <p>a</p>
+                  <p>You are so upset.</p>
                 </div>
               </article>
-              <article  class="flex justify-center mb50" style="gap: 60px;">
+              <article class="flex justify-center mb50" style="gap: 60px;">
                 <img src="../../../../resources/img/img85_42s.png" alt="">
                 <div class="flex">
-                  <button><img src="../../../../resources/img/img136_71s.png" alt="">
-                    <p>2</p>
+                  <button @click="handleClick('You is so upset.', 2)">
+                    <img src="../../../../resources/img/img136_71s.png" alt="">
+                    <p :class="{ active: selectedButton === 2 }">2</p>
                   </button>
-                  <p>a</p>
+                  <p>You is so upset.</p>
                 </div>
               </article>
-              <article  class="flex justify-center" style="gap: 60px;">
+              <article class="flex justify-center" style="gap: 60px;">
                 <img src="../../../../resources/img/img86_42s.png" alt="">
                 <div class="flex">
-                  <button><img src="../../../../resources/img/img136_71s.png" alt="">
-                    <p>3</p>
+                  <button @click="handleClick('You am so upset.', 3)">
+                    <img src="../../../../resources/img/img136_71s.png" alt="">
+                    <p :class="{ active: selectedButton === 3 }">3</p>
                   </button>
-                  <p>a</p>
+                  <p>You am so upset.</p>
                 </div>
               </article>
             </div>
-
           </div>
         </div>
       </div>
@@ -75,26 +74,26 @@
 export default {
   data() {
     return {
-    }
+      selectedButton: null, // 선택된 버튼을 추적하기 위한 데이터
+    };
   },
   methods: {
     goToPage(page) {
       this.$router.push({ name: page });
+    },
+    handleClick(text, buttonNumber) {
+      this.selectedButton = buttonNumber; // 선택된 버튼 번호를 저장
+
+      if (text === 'You are so upset.') {
+        alert('정답입니다!');
+      } else {
+        alert('오답입니다!');
+      }
     }
-  },
-  watch: {
-
-  },
-  computed: {
-
-  },
-  components: {
-  },
-  mounted() {
-
   }
 }
 </script>
+
 <style scoped>
 .imgGroup{width: fit-content;}
 .imgGroup button {
@@ -112,7 +111,7 @@
   background: #ffffffb8;
   border-radius: 5px;
   padding: 10px;
-  font-size: 48px;
+  font-size: 23px;
   font-family: 'ONEMobilePOP';
 }
 
@@ -129,8 +128,18 @@
   left: 50%;
   transform: translate(-50%, -50%);
 }
-.pickGroup article img{object-fit: contain; width: -webkit-fill-available;}
-.pickGroup article >div >p {
-  font-size: 64px;
+
+.pickGroup article img {
+  object-fit: contain;
+  width: -webkit-fill-available;
 }
-</style>
(No newline at end of file)
+
+.pickGroup article >div >p {
+  font-size: 25px;
+  white-space: nowrap; /* 텍스트가 줄 바꿈 없이 한 줄로 표시되도록 설정 */
+}
+
+.pickGroup button p.active {
+  color: #000; /* 선택된 버튼의 숫자 색을 더 진하게 */
+}
+</style>
client/views/pages/main/Chapter/Chapter2_13.vue
--- client/views/pages/main/Chapter/Chapter2_13.vue
+++ client/views/pages/main/Chapter/Chapter2_13.vue
@@ -70,9 +70,9 @@
               </div>
                 </div>
                 <!-- 오답일 경우 아래의 이미지가 보여야함 -->
-                <div class="flex justify-center wrong-anwser" style="gap: 20px;">
+                <!-- <div class="flex justify-center wrong-anwser" style="gap: 20px;">
                   <img src="../../../../resources/img/img165_46s.png" alt="">
-                </div>
+                </div> -->
   
               </div>
             </div>
client/views/pages/main/Chapter/Chapter2_4.vue
--- client/views/pages/main/Chapter/Chapter2_4.vue
+++ client/views/pages/main/Chapter/Chapter2_4.vue
@@ -53,9 +53,9 @@
       return {
          items: [
             { imgSrc1: 'client/resources/img/img61_36s.png', imgSrc2: 'client/resources/img/img62_36s.png', imgSrc: 'client/resources/img/img59_36s.png', title: 'apple' },
-            { imgSrc1: 'client/resources/img/img61_36s.png', imgSrc2: 'client/resources/img/img62_36s.png', imgSrc: 'client/resources/img/img58_36s.png', title: 'a'},
-            { imgSrc1: 'client/resources/img/img61_36s.png', imgSrc2: 'client/resources/img/img62_36s.png', imgSrc: 'client/resources/img/img57_36s.png', title: 'a' },
-            { imgSrc1: 'client/resources/img/img61_36s.png', imgSrc2: 'client/resources/img/img62_36s.png', imgSrc: 'client/resources/img/img56_36s.png', title: 'a' },
+            { imgSrc1: 'client/resources/img/img61_36s.png', imgSrc2: 'client/resources/img/img62_36s.png', imgSrc: 'client/resources/img/img58_36s.png', title: 'cloud'},
+            { imgSrc1: 'client/resources/img/img61_36s.png', imgSrc2: 'client/resources/img/img62_36s.png', imgSrc: 'client/resources/img/img57_36s.png', title: 'car' },
+            { imgSrc1: 'client/resources/img/img61_36s.png', imgSrc2: 'client/resources/img/img62_36s.png', imgSrc: 'client/resources/img/img56_36s.png', title: 'guitar' },
          ],
          selectedIndex: 0,
          timer: "00",
client/views/pages/main/Chapter/Chapter2_8.vue
--- client/views/pages/main/Chapter/Chapter2_8.vue
+++ client/views/pages/main/Chapter/Chapter2_8.vue
@@ -1,78 +1,154 @@
 <template>
-    <div id="Chapter1_1" class="content-wrap">
-      <div style="margin: 30px 0px 50px">
-        <router-link to="/MyPlan.page">
-          <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt=""></div>
-        </router-link>
-      </div>
-      <div class="title-box mb25 flex align-center mt40">
-        <span class="title mr40">1. Hello WORLD</span>
-        <span class="subtitle">my name is dd</span>
-      </div>
-      <div class="flex justify-between align-center">
-        <div class="pre-btn" @click="goToPage('Chapter2_9')"><img src="../../../../resources/img/left.png" alt=""></div>
-        <div class="content title-box">
-          <p class="title mt25 title-bg">step2</p>
-          <div class="flex align-center mb30">
-          <p class="subtitle2 mr20">앗! 퍼즐이 망가졌어! 퍼즐을 맞춰 문장을 완성해보자!</p>
-          <!-- <button><img src="../../../../resources/img/btn10_s.png" alt="">
-          </button> -->
-        </div>
-  
-          <div class="text-ct">
-          <div class="dropGroup flex align-center justify-center mt30">
-            <div style="position: relative;" >
-              <img src="../../../../resources/img/img28_s.png" alt="">
-              <button style="    left: 30px;
-    top: 167px;"><img src="../../../../resources/img/img29_s_01.png" alt=""><p>a</p></button>
-              <button style="     right: 409px;
-    top: 133px;"><img src="../../../../resources/img/img30_s_01.png" alt=""><p>a</p></button>
-              <button style=" right: 46px;
-    top: 128px;"><img src="../../../../resources/img/img31_s_01.png" alt=""><p>a</p></button>
-               
-            </div>
-          </div>
-          <div class="dragGroup ">
-            <div class="flex justify-center" style="gap: 20px;">
-              <article style="  right: 0;
-    top: 36%;  "><button><img src="../../../../resources/img/img29_s.png" alt=""><p>a</p></button></article>
-            <article style="  left: 0;
-    top: 36%;   "><button><img src="../../../../resources/img/img30_s.png" alt=""><p>a</p></button></article>
-            <article style="left: 50%;
-    top: 10%;"><button><img src="../../../../resources/img/img31_s.png" alt=""><p>a</p></button></article>
-            </div>
-            
-          </div>
-        </div>
-        </div>
-        <div class="next-btn" @click="goToPage('Chapter2_12')"><img src="../../../../resources/img/right.png" alt=""></div>
-      </div>
+  <div id="Chapter1_1" class="content-wrap">
+    <div style="margin: 30px 0px 50px">
+      <router-link to="/MyPlan.page">
+        <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt=""></div>
+      </router-link>
     </div>
-  </template>
+    <div class="title-box mb25 flex align-center mt40">
+      <span class="title mr40">1. Hello WORLD</span>
+      <span class="subtitle">my name is dd</span>
+    </div>
+    <div class="flex justify-between align-center">
+      <div class="pre-btn" @click="goToPage('Chapter2_9')"><img src="../../../../resources/img/left.png" alt=""></div>
+      <div class="content title-box">
+        <p class="title mt25 title-bg">step2</p>
+        <div class="flex align-center mb30">
+          <p class="subtitle2 mr20">앗! 퍼즐이 망가졌어! 퍼즐을 맞춰 문장을 완성해보자!</p>
+        </div>
+
+        <div class="text-ct">
+          <div class="dropGroup flex align-center justify-center mt30">
+            <div style="position: relative;">
+              <img src="../../../../resources/img/img28_s.png" alt="">
+              <button class="dropzone" data-answer="This" style="left: 30px; top: 167px;">
+                <img src="../../../../resources/img/img29_s_01.png" alt="">
+                <p style="font-size: 35px;">?</p>
+              </button>
+              <button class="dropzone" data-answer="is" style="right: 409px; top: 133px;">
+                <img src="../../../../resources/img/img30_s_01.png" alt="">
+                <p style="font-size: 35px;">?</p>
+              </button>
+              <button class="dropzone" data-answer="a pen" style="right: 46px; top: 128px;">
+                <img src="../../../../resources/img/img31_s_01.png" alt="">
+                <p style="font-size: 35px;">?</p>
+              </button>
+            </div>
+          </div>
+          <div class="dragGroup flex justify-center" style="gap: 20px;">
+            <article style="right: 0; top: 36%;">
+              <button class="draggable" data-text="This" draggable="true">
+                <img src="../../../../resources/img/img29_s.png" alt="">
+                <p style="font-size: 35px;">This</p>
+              </button>
+            </article>
+            <article style="left: 0; top: 36%;">
+              <button class="draggable" data-text="is" draggable="true">
+                <img src="../../../../resources/img/img30_s.png" alt="">
+                <p style="font-size: 35px;">is</p>
+              </button>
+            </article>
+            <article style="left: 50%; top: 10%;">
+              <button class="draggable" data-text="a pen" draggable="true">
+                <img src="../../../../resources/img/img31_s.png" alt="">
+                <p style="font-size: 35px;">a pen</p>
+              </button>
+            </article>
+          </div>
+        </div>
+      </div>
+      <div class="next-btn" @click="goToPage('Chapter2_12')"><img src="../../../../resources/img/right.png" alt=""></div>
+    </div>
+  </div>
+</template>
+
   
-  <script>
-  export default {
-    data() {
-      return {
+<script>
+export default {
+  data() {
+    return {
+      draggedElement: null, // 현재 드래그 중인 요소
+    };
+  },
+  methods: {
+    goToPage(page) {
+      this.$router.push({ name: page });
+    },
+    handleDragStart(event) {
+      this.draggedElement = event.target; // 드래그한 요소 저장
+      event.dataTransfer.setData('text/plain', event.target.dataset.text);
+      event.target.style.cursor = 'grabbing'; // 드래그 중 커서 변경
+    },
+    handleDragEnd(event) {
+      event.target.style.cursor = 'grab'; // 드래그 종료 후 커서 변경
+    },
+    handleDragOver(event) {
+      event.preventDefault(); // 드롭 허용
+    },
+    handleDrop(event) {
+      event.preventDefault();
+      const dropZone = event.target.closest('button.dropzone');
+      const draggedText = this.draggedElement ? this.draggedElement.dataset.text : '';
+
+      if (dropZone) {
+        const expectedText = dropZone.dataset.answer;
+        if (draggedText === expectedText) {
+          // 드래그된 텍스트가 정답인 경우
+          const rect = dropZone.getBoundingClientRect();
+          // 버튼의 이미지 및 텍스트를 드롭존에 맞게 설정
+          dropZone.querySelector('p').textContent = draggedText;
+          dropZone.querySelector('img').style.display = 'none'; // 기존 이미지 숨기기
+
+          // 드래그된 버튼의 이미지와 텍스트를 드롭존에 복사
+          const draggedImage = this.draggedElement.querySelector('img').cloneNode();
+          const draggedTextElement = this.draggedElement.querySelector('p').cloneNode();
+
+          // 드롭존에 이미지 및 텍스트를 추가
+          dropZone.appendChild(draggedImage);
+          dropZone.appendChild(draggedTextElement);
+
+          // 드래그한 요소 숨기기
+          this.draggedElement.style.display = 'none';
+        } else {
+          // 정답이 아닌 경우
+          alert('오답입니다!'); // 오답 경고 메시지
+        }
       }
-    },
-    methods: {
-      goToPage(page) {
-        this.$router.push({ name: page });
-      }
-    },
-    watch: {
-  
-    },
-    computed: {
-  
-    },
-    components: {
-    },
-    mounted() {
-      
+
+      this.draggedElement = null; // 드래그 상태 초기화
     }
+  },
+  mounted() {
+    // 드래그 가능한 요소에 드래그 시작 및 종료 이벤트 추가
+    document.querySelectorAll('.draggable').forEach(button => {
+      button.addEventListener('dragstart', this.handleDragStart);
+      button.addEventListener('dragend', this.handleDragEnd);
+    });
+
+    // 드롭 가능한 영역에 드래그 오버 및 드롭 이벤트 추가
+    document.querySelectorAll('.dropzone').forEach(zone => {
+      zone.addEventListener('dragover', this.handleDragOver);
+      zone.addEventListener('drop', this.handleDrop);
+    });
   }
-  </script>
-  <style scoped>
+}
+</script>
+
+
+
+<style scoped>
+.draggable {
+  cursor: grab;
+}
+
+.draggable:active {
+  cursor: grabbing;
+}
+
+
+
+.dropzone img {
+  display: block; /* 이미지가 항상 보이도록 설정 */
+}
+
 </style>
(No newline at end of file)
client/views/pages/main/Chapter/Chapter2_9.vue
--- client/views/pages/main/Chapter/Chapter2_9.vue
+++ client/views/pages/main/Chapter/Chapter2_9.vue
@@ -1,5 +1,10 @@
 <template>
   <div id="Chapter1_1" class="content-wrap">
+    <div style="margin: 30px 0px 50px">
+      <router-link to="/MyPlan.page">
+        <div class="logo mb25"><img src="../../../../resources/img/logo2.png" alt=""></div>
+      </router-link>
+    </div>
     <div class="title-box mb25 flex align-center mt40">
       <span class="title mr40">1. Hello WORLD</span>
       <span class="subtitle">my name is dd</span>
@@ -24,9 +29,9 @@
                     </div>
                     <div class="flex align-start">
                       <div>
-                        <h3>sidewalk</h3>
+                        <h3>mountain</h3>
                         <div class="flex align-center mt10">
-                          <span class="title1">보도</span>
+                          <span class="title1">산</span>
                         </div>
                       </div>
                     </div>
@@ -37,9 +42,9 @@
                     </div>
                     <div class="flex align-start">
                       <div>
-                        <h3>sidewalk</h3>
+                        <h3>cat</h3>
                         <div class="flex align-center mt10">
-                          <span class="title1">보도</span>
+                          <span class="title1">고양이</span>
                         </div>
                       </div>
                     </div>
@@ -52,9 +57,9 @@
                     </div>
                     <div class="flex align-start">
                       <div>
-                        <h3>sidewalk</h3>
+                        <h3>watermelon</h3>
                         <div class="flex align-center mt10">
-                          <span class="title1">보도</span>
+                          <span class="title1">수박</span>
                         </div>
                       </div>
                     </div>
@@ -65,7 +70,7 @@
                     </div>
                     <div class="flex align-start">
                       <div>
-                        <h3>sidewalk</h3>
+                        <h3>america</h3>
                         <div class="flex align-center mt10">
                           <span class="title1">보도</span>
                         </div>
Add a comment
List