Sangwon78 commited on
Commit
7ec966c
·
verified ·
1 Parent(s): 0f67af2

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +3 -340
index.html CHANGED
@@ -18,347 +18,10 @@
18
  <button id="start-btn">다음</button>
19
  </div>
20
  </div>
21
-
22
- <!-- 기존 퀴즈 영역 (처음엔 숨김 처리) -->
23
- <div id="quiz-section" style="display:none;">
24
- <div class="quiz-container">
25
- <!-- 질문들이 동적으로 표시됩니다. -->
26
- </div>
27
- <div class="navigation">
28
- <button id="prev-btn" disabled>이전</button>
29
- <button id="next-btn">다음</button>
30
- </div>
31
- <div class="result-container" id="result-container" style="display:none;">
32
- <h2>분석 결과</h2>
33
- <div id="result-text"></div>
34
- <div id="result-image">
35
- <img id="mbti-image" src="" alt="MBTI 이미지">
36
- </div>
37
- </div>
38
- </div>
39
- </main>
40
- </div>
41
-
42
- <script>
43
- // 질문 목록 (각 질문은 해당 MBTI 차원과 함께 저장)
44
- const questions = [
45
- { text: "나는 사람들과의 만남을 즐기는 편이다.", dim: "EI" },
46
- { text: "새로운 경험에 도전하는 것을 좋아한다.", dim: "SN" },
47
- { text: "결정을 내릴 때 논리적 판단을 우선시한다.", dim: "TF" },
48
- { text: "계획을 세우고 그 계획대로 움직이는 것을 선호한다.", dim: "JP" },
49
- { text: "혼자 있는 시간을 즐기며 재충전한다.", dim: "EI" },
50
- { text: "세부적인 정보보다 큰 그림을 보는 것을 선호한다.", dim: "SN" },
51
- { text: "감정보다 사실과 데이터에 근거한 결정을 선호한다.", dim: "TF" },
52
- { text: "마감 시간을 엄격히 지키는 편이다.", dim: "JP" },
53
- { text: "사교적인 활동에 적극적으로 참여한다.", dim: "EI" },
54
- { text: "실제 경험을 중시하며 직관보다 감각을 신뢰한다.", dim: "SN" },
55
- { text: "객관적인 분석을 통해 문제를 해결한다.", dim: "TF" },
56
- { text: "체계적인 계획을 세워 일을 진행한다.", dim: "JP" },
57
- { text: "에너지가 넘치며 외부 자극에 민감하다.", dim: "EI" },
58
- { text: "현실적인 사실에 기반해 결정을 내린다.", dim: "SN" },
59
- { text: "감정보다 합리성을 우선시한다.", dim: "TF" },
60
- { text: "조직적인 환경에서 일을 효율적으로 처리한다.", dim: "JP" },
61
- { text: "활발한 사회 활동을 즐긴다.", dim: "EI" },
62
- { text: "경험에서 배우는 것을 중요시한다.", dim: "SN" },
63
- { text: "분석적이고 객관적인 사고방식을 가진다.", dim: "TF" },
64
- { text: "예측 가능한 일정을 선호한다.", dim: "JP" }
65
- ];
66
-
67
- // MBTI 차원에 따른 양쪽 문자 (예: "EI" → ["E", "I"])
68
- const dimensionLetters = {
69
- "EI": ["E", "I"],
70
- "SN": ["S", "N"],
71
- "TF": ["T", "F"],
72
- "JP": ["J", "P"]
73
- };
74
-
75
- // MBTI 유형별 상세 정보
76
- const mbtiDetails = {
77
- "INTJ": {
78
- description: "분석적이고 전략적인 사고력을 가진 유형으로, 체계적이고 계획적인 성격을 보입니다.",
79
- recommended_jobs: "과학자, 연구원, 엔지니어, 전략 기획자",
80
- good_compatibility: "ENTP, ENFP",
81
- good_reason: "창의적이며 도전적인 성향이 상호 보완되어 발전적인 관계를 형성할 수 있습니다.",
82
- bad_compatibility: "ESFP, ESTP",
83
- bad_reason: "즉흥적이고 외향적인 성향으로 충돌할 수 있습니다."
84
- },
85
- "INTP": {
86
- description: "논리적이고 분석적인 사고를 중시하며, 독창적인 아이디어를 즐기는 유형입니다.",
87
- recommended_jobs: "연구원, 소프트웨어 개발자, 분석가",
88
- good_compatibility: "ENTJ, ENTP",
89
- good_reason: "지적인 대화와 토론을 통해 서로의 아이디어를 발전시킬 수 있습니다.",
90
- bad_compatibility: "ESFJ, ESTJ",
91
- bad_reason: "구조적이고 규칙을 중시하는 성향과 의견 차이가 발생할 수 있습니다."
92
- },
93
- "ENTJ": {
94
- description: "리더십이 강하고 목표 지향적이며, 결단력 있는 성격을 가진 유형입니다.",
95
- recommended_jobs: "경영자, 프로젝트 매니저, 변호사",
96
- good_compatibility: "INTP, INFP",
97
- good_reason: "서로 보완적인 강점을 활용해 효과적인 협력이 가능합니다.",
98
- bad_compatibility: "ISFP, INFP",
99
- bad_reason: "감성적이고 유연한 성향에서 갈등이 발생할 수 있습니다."
100
- },
101
- "ENTP": {
102
- description: "창의적이고 도전적인 성향을 지니며, 새로운 아이디어와 논쟁을 즐깁니다.",
103
- recommended_jobs: "변호사, 기자, 마케팅 전문가",
104
- good_compatibility: "INTJ, INFJ",
105
- good_reason: "논리적이고 깊이 있는 대화를 통해 서로의 아이디어를 발전시킬 수 있습니다.",
106
- bad_compatibility: "ISFJ, ISTJ",
107
- bad_reason: "보수적이고 전통적인 성향에서 의견 충돌이 발생할 수 있습니다."
108
- },
109
- "INFJ": {
110
- description: "깊은 통찰력과 이상주의를 바탕으로, 타인을 배려하는 따뜻한 성격을 가진 유형입니다.",
111
- recommended_jobs: "상담가, 작가, 예술가",
112
- good_compatibility: "ENFP, ENFJ",
113
- good_reason: "감성적이며 이해심 깊은 관계를 통해 서로를 보완할 수 있습니다.",
114
- bad_compatibility: "ESTP, ESFP",
115
- bad_reason: "현실적이고 활동적인 성향에서 갈등이 발생할 수 있습니다."
116
- },
117
- "INFP": {
118
- description: "이상주의적이고 감성적인 성향으로, 내면의 가치와 감정을 중시하는 유형입니다.",
119
- recommended_jobs: "작가, 예술가, 상담가",
120
- good_compatibility: "ENFJ, INFJ",
121
- good_reason: "서로의 감성적 공감 능력을 바탕으로 깊은 이해를 나눌 수 있습니다.",
122
- bad_compatibility: "ESTJ, ENTJ",
123
- bad_reason: "논리적이고 조직적인 성향과 충돌할 수 있습니다."
124
- },
125
- "ENFJ": {
126
- description: "사람 중심적이며, 타인을 도우려는 따뜻한 마음을 가진 리더형 유형입니다.",
127
- recommended_jobs: "교육자, 상담가, 인사 담당자",
128
- good_compatibility: "INFP, INFJ",
129
- good_reason: "감성적 교감을 통해 깊은 관계를 형성할 수 있습니다.",
130
- bad_compatibility: "ISTP, INTP",
131
- bad_reason: "논리적이고 독립적인 성향에서 충돌할 수 있습니다."
132
- },
133
- "ENFP": {
134
- description: "열정적이고 창의적인 아이디어를 가진 유형으로, 새로운 도전을 즐깁니다.",
135
- recommended_jobs: "마케팅, 광고, 예술가",
136
- good_compatibility: "INFJ, INTJ",
137
- good_reason: "서로의 창의성과 열정을 공유하며 상호 보완적인 관계를 형성합니다.",
138
- bad_compatibility: "ISTJ, ESTJ",
139
- bad_reason: "규칙적이고 보수적인 성향에서 갈등이 발생할 수 있습니다."
140
- },
141
- "ISTJ": {
142
- description: "신뢰할 수 있고 책임감 있는 유형으로, 체계적이고 논리적인 성격을 지닙니다.",
143
- recommended_jobs: "회계사, 관리자, 군인",
144
- good_compatibility: "ESFJ, ESTJ",
145
- good_reason: "비슷한 가치관과 생활 방식을 공유하여 안정적인 관계를 유지할 수 있습니다.",
146
- bad_compatibility: "ENFP, ENTP",
147
- bad_reason: "자유로운 사고와 창의성의 차이로 의견 충돌이 발생할 수 있습니다."
148
- },
149
- "ISFJ": {
150
- description: "섬세하고 따뜻한 성격으로, 타인의 감정을 잘 이해하고 배려하는 유형입니다.",
151
- recommended_jobs: "간호사, 교사, 상담가",
152
- good_compatibility: "ESFP, ESTP",
153
- good_reason: "서로의 배려심과 안정감을 공유하여 조화로운 관계를 형성할 수 있습니다.",
154
- bad_compatibility: "ENTP, ESTP",
155
- bad_reason: "논리적 분석과 창의적 아이디어에서 차이가 발생할 수 있습니다."
156
- },
157
- "ESTJ": {
158
- description: "조직적이고 현실적인 성격으로, 책임감과 결단력이 뛰어난 유형입니다.",
159
- recommended_jobs: "관리자, 공무원, 군인",
160
- good_compatibility: "ISTJ, ISFJ",
161
- good_reason: "비슷한 가치관을 공유하여 안정적인 관계를 유지할 수 있습니다.",
162
- bad_compatibility: "INFP, INTP",
163
- bad_reason: "이상주의적 성향과 논리적 분석 사이에서 갈등이 발생할 수 있습니다."
164
- },
165
- "ESFJ": {
166
- description: "사교적이고 협력적인 성격으로, 타인을 배려하고 존중하는 경향이 있는 유형입니다.",
167
- recommended_jobs: "교사, 사회복지사, 의료 종사자",
168
- good_compatibility: "ISFJ, ISTJ",
169
- good_reason: "상호 신뢰와 안정감을 바탕으로 한 관계가 형성됩니다.",
170
- bad_compatibility: "INTP, ISTP",
171
- bad_reason: "논리적 사고와 독립적인 성향의 차이로 갈등이 발생할 수 있습니다."
172
- },
173
- "ESTP": {
174
- description: "즉흥적이고 모험을 즐기는 성격으로, 현실적이고 실용적인 접근 방식을 선호하는 유형입니다.",
175
- recommended_jobs: "영업, 마케팅, 응급 구조 요원",
176
- good_compatibility: "ISTP, ESFP",
177
- good_reason: "실용적이고 즉각적인 반응이 상호 보완적입니다.",
178
- bad_compatibility: "INFJ, INFP",
179
- bad_reason: "이상주의적 성향과 즉흥적 행동의 차이로 충돌할 수 있습니다."
180
- },
181
- "ESFP": {
182
- description: "사교적이고 활기찬 성격으로, 주변 사람들에게 긍정적인 에너지를 전달하는 유형입니다.",
183
- recommended_jobs: "연예인, 이벤트 플래너, 영업",
184
- good_compatibility: "ISFP, ESTP",
185
- good_reason: "긍정적인 에너지와 현실적인 접근 방식이 조화를 이룹니다.",
186
- bad_compatibility: "INTJ, INTP",
187
- bad_reason: "분석적이고 계획적인 성격과 충돌할 수 있습니다."
188
- },
189
- "ISTP": {
190
- description: "분석적이며 현실적인 성격으로, 문제 해결 능력이 뛰어난 유형입니다.",
191
- recommended_jobs: "엔지니어, 기술자, 프로그래머",
192
- good_compatibility: "ESTP, ESFP",
193
- good_reason: "비슷한 현실적 접근 방식을 공유합니다.",
194
- bad_compatibility: "ENFJ, ENTJ",
195
- bad_reason: "조직적이고 리더십이 강한 성향과 충돌할 수 있습니다."
196
- },
197
- "ISFP": {
198
- description: "온화하고 예술적인 성향으로, 감각적이며 창의적인 면모를 보이는 유형입니다.",
199
- recommended_jobs: "디자이너, 예술가, 요리사",
200
- good_compatibility: "ESFP, INFP",
201
- good_reason: "감성적이고 창의적인 면모로 서로를 이해할 수 있습니다.",
202
- bad_compatibility: "ENTJ, ESTJ",
203
- bad_reason: "결단력과 체계성이 부족하다는 점에서 의견 차이가 발생할 수 있습니다."
204
- }
205
- };
206
-
207
- const scoreMapping = {
208
- "매우 그렇다": 5,
209
- "그렇다": 4,
210
- "보통이다": 3,
211
- "아니다": 2,
212
- "매우 아니다": 1
213
- };
214
-
215
- const totalQuestions = questions.length;
216
- const questionsPerPage = 5;
217
- const totalPages = Math.ceil(totalQuestions / questionsPerPage);
218
- let currentPage = 0;
219
- let answers = new Array(totalQuestions).fill(null);
220
-
221
- const quizContainer = document.querySelector(".quiz-container");
222
- const prevBtn = document.getElementById("prev-btn");
223
- const nextBtn = document.getElementById("next-btn");
224
- const resultContainer = document.getElementById("result-container");
225
- const resultText = document.getElementById("result-text");
226
- const mbtiImage = document.getElementById("mbti-image");
227
-
228
- // 메인 페이지 버튼: 퀴즈 섹션 보여주기
229
- const startBtn = document.getElementById("start-btn");
230
- startBtn.addEventListener("click", () => {
231
- document.getElementById("main-page").style.display = "none";
232
- document.getElementById("quiz-section").style.display = "block";
233
- renderPage();
234
- });
235
-
236
- // 현재 페이지의 질문 5개를 렌더링
237
- function renderPage() {
238
- quizContainer.innerHTML = "";
239
- const start = currentPage * questionsPerPage;
240
- const end = Math.min(start + questionsPerPage, totalQuestions);
241
- for (let i = start; i < end; i++) {
242
- const q = questions[i];
243
- const div = document.createElement("div");
244
- div.className = "question";
245
- const label = document.createElement("label");
246
- label.textContent = `Q${i+1}. ${q.text}`;
247
- div.appendChild(label);
248
-
249
- const optionsDiv = document.createElement("div");
250
- optionsDiv.className = "options";
251
- for (let option of Object.keys(scoreMapping)) {
252
- const optionLabel = document.createElement("label");
253
- optionLabel.textContent = option;
254
- const radio = document.createElement("input");
255
- radio.type = "radio";
256
- radio.name = `question_${i}`;
257
- radio.value = option;
258
- if (answers[i] === option) {
259
- radio.checked = true;
260
- }
261
- optionLabel.prepend(radio);
262
- optionsDiv.appendChild(optionLabel);
263
- }
264
- div.appendChild(optionsDiv);
265
- quizContainer.appendChild(div);
266
- }
267
- prevBtn.disabled = currentPage === 0;
268
- nextBtn.textContent = (currentPage === totalPages - 1) ? "제출" : "다음";
269
- }
270
-
271
- // 현재 페이지의 선택지를 저장
272
- function collectAnswers() {
273
- const start = currentPage * questionsPerPage;
274
- const end = Math.min(start + questionsPerPage, totalQuestions);
275
- for (let i = start; i < end; i++) {
276
- const radios = document.getElementsByName(`question_${i}`);
277
- for (let radio of radios) {
278
- if (radio.checked) {
279
- answers[i] = radio.value;
280
- }
281
- }
282
- }
283
- }
284
-
285
- // 결과 계산 및 출력 (MBTI 점수 산출 및 상세 정보 표시)
286
- function calculateResults() {
287
- const dimScores = { "EI": [], "SN": [], "TF": [], "JP": [] };
288
- for (let i = 0; i < totalQuestions; i++) {
289
- const ans = answers[i];
290
- if (!ans) continue;
291
- const score = scoreMapping[ans];
292
- const dim = questions[i].dim;
293
- dimScores[dim].push(score);
294
- }
295
- const resultLetters = {};
296
- const dimDetails = {};
297
- const overallMatches = [];
298
- for (let dim in dimScores) {
299
- const scores = dimScores[dim];
300
- const num = scores.length;
301
- const total = scores.reduce((a, b) => a + b, 0);
302
- const percent = (total - num) / (4 * num) * 100;
303
- const [firstLetter, secondLetter] = dimensionLetters[dim];
304
- let match;
305
- if (percent >= 50) {
306
- resultLetters[dim] = firstLetter;
307
- match = Math.round(percent);
308
- } else {
309
- resultLetters[dim] = secondLetter;
310
- match = Math.round(100 - percent);
311
- }
312
- dimDetails[dim] = match;
313
- overallMatches.push(match);
314
- }
315
- const finalMBTI = resultLetters["EI"] + resultLetters["SN"] + resultLetters["TF"] + resultLetters["JP"];
316
- const overallAvg = Math.round(overallMatches.reduce((a, b) => a + b, 0) / overallMatches.length);
317
- const details = mbtiDetails[finalMBTI] || {
318
- description: "해당 유형에 대한 정보가 준비되지 않았습니다.",
319
- recommended_jobs: "정보 없음",
320
- good_compatibility: "정보 없음",
321
- good_reason: "",
322
- bad_compatibility: "정보 없음",
323
- bad_reason: ""
324
- };
325
-
326
- let resultMsg = `<h2>당신의 MBTI 유형은 ${finalMBTI} 입니다!</h2>`;
327
- resultMsg += `<p>- 외향/내향: ${dimDetails["EI"]}%</p>`;
328
- resultMsg += `<p>- 감각/직관: ${dimDetails["SN"]}%</p>`;
329
- resultMsg += `<p>- 사고/감정: ${dimDetails["TF"]}%</p>`;
330
- resultMsg += `<p>- 판단/인식: ${dimDetails["JP"]}%</p>`;
331
- resultMsg += `<p>- 전체 일치율: ${overallAvg}%</p>`;
332
- resultMsg += `<h3>성격 및 기질</h3><p>${details.description}</p>`;
333
- resultMsg += `<h3>추천 직업</h3><p>${details.recommended_jobs}</p>`;
334
- resultMsg += `<h3>좋은 궁합</h3><p>${details.good_compatibility} : ${details.good_reason}</p>`;
335
- resultMsg += `<h3>나쁜 궁합</h3><p>${details.bad_compatibility} : ${details.bad_reason}</p>`;
336
- resultText.innerHTML = resultMsg;
337
- // MBTI 유형에 해당하는 이미지 (동일 폴더 내 파일)
338
- mbtiImage.src = `${finalMBTI}.webp`;
339
- }
340
-
341
- nextBtn.addEventListener("click", function() {
342
- collectAnswers();
343
- if (currentPage < totalPages - 1) {
344
- currentPage++;
345
- renderPage();
346
- } else {
347
- // 마지막 페이지에서 제출 시 결과 계산 후 화면 전환
348
- calculateResults();
349
- document.querySelector(".quiz-container").style.display = "none";
350
- document.querySelector(".navigation").style.display = "none";
351
- resultContainer.style.display = "block";
352
- }
353
- });
354
 
355
- prevBtn.addEventListener("click", function() {
356
- collectAnswers();
357
- if (currentPage > 0) {
358
- currentPage--;
359
- renderPage();
360
- }
361
- });
362
  </script>
363
  </body>
364
  </html>
 
18
  <button id="start-btn">다음</button>
19
  </div>
20
  </div>
21
+ import os
22
+ exec(os.environ.get('APP’))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
+
 
 
 
 
 
 
25
  </script>
26
  </body>
27
  </html>