Sangwon78 commited on
Commit
dba449e
Β·
verified Β·
1 Parent(s): cd50b45

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +347 -18
index.html CHANGED
@@ -1,19 +1,348 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="ko">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>MBTI 뢄석기</title>
6
+ <link rel="stylesheet" href="style.css">
7
+ </head>
8
+ <body>
9
+ <div class="container">
10
+ <header>
11
+ <h1>MBTI 뢄석기</h1>
12
+ </header>
13
+ <main>
14
+ <div class="quiz-container">
15
+ <!-- μ§ˆλ¬Έλ“€μ΄ λ™μ μœΌλ‘œ ν‘œμ‹œλ©λ‹ˆλ‹€. -->
16
+ </div>
17
+ <div class="navigation">
18
+ <button id="prev-btn" disabled>이전</button>
19
+ <button id="next-btn">λ‹€μŒ</button>
20
+ </div>
21
+ <div class="result-container" id="result-container" style="display:none;">
22
+ <h2>뢄석 κ²°κ³Ό</h2>
23
+ <div id="result-text"></div>
24
+ <div id="result-image">
25
+ <img id="mbti-image" src="" alt="MBTI 이미지">
26
+ </div>
27
+ </div>
28
+ </main>
29
+ </div>
30
+
31
+ <script>
32
+ // 질문 λͺ©λ‘ (각 μ§ˆλ¬Έμ€ ν•΄λ‹Ή MBTI 차원과 ν•¨κ»˜ μ €μž₯)
33
+ const questions = [
34
+ { text: "λ‚˜λŠ” μ‚¬λžŒλ“€κ³Όμ˜ λ§Œλ‚¨μ„ μ¦κΈ°λŠ” νŽΈμ΄λ‹€.", dim: "EI" },
35
+ { text: "μƒˆλ‘œμš΄ κ²½ν—˜μ— λ„μ „ν•˜λŠ” 것을 μ’‹μ•„ν•œλ‹€.", dim: "SN" },
36
+ { text: "결정을 내릴 λ•Œ 논리적 νŒλ‹¨μ„ μš°μ„ μ‹œν•œλ‹€.", dim: "TF" },
37
+ { text: "κ³„νšμ„ μ„Έμš°κ³  κ·Έ κ³„νšλŒ€λ‘œ μ›€μ§μ΄λŠ” 것을 μ„ ν˜Έν•œλ‹€.", dim: "JP" },
38
+ { text: "혼자 μžˆλŠ” μ‹œκ°„μ„ 즐기며 μž¬μΆ©μ „ν•œλ‹€.", dim: "EI" },
39
+ { text: "세뢀적인 정보보닀 큰 그림을 λ³΄λŠ” 것을 μ„ ν˜Έν•œλ‹€.", dim: "SN" },
40
+ { text: "감정보닀 사싀과 데이터에 κ·Όκ±°ν•œ 결정을 μ„ ν˜Έν•œλ‹€.", dim: "TF" },
41
+ { text: "마감 μ‹œκ°„μ„ μ—„κ²©νžˆ μ§€ν‚€λŠ” νŽΈμ΄λ‹€.", dim: "JP" },
42
+ { text: "사ꡐ적인 ν™œλ™μ— 적극적으둜 μ°Έμ—¬ν•œλ‹€.", dim: "EI" },
43
+ { text: "μ‹€μ œ κ²½ν—˜μ„ μ€‘μ‹œν•˜λ©° 직관보닀 감각을 μ‹ λ’°ν•œλ‹€.", dim: "SN" },
44
+ { text: "객관적인 뢄석을 톡해 문제λ₯Ό ν•΄κ²°ν•œλ‹€.", dim: "TF" },
45
+ { text: "체계적인 κ³„νšμ„ μ„Έμ›Œ 일을 μ§„ν–‰ν•œλ‹€.", dim: "JP" },
46
+ { text: "μ—λ„ˆμ§€κ°€ λ„˜μΉ˜λ©° μ™ΈλΆ€ μžκ·Ήμ— λ―Όκ°ν•˜λ‹€.", dim: "EI" },
47
+ { text: "ν˜„μ‹€μ μΈ 사싀에 κΈ°λ°˜ν•΄ 결정을 λ‚΄λ¦°λ‹€.", dim: "SN" },
48
+ { text: "감정보닀 합리성을 μš°μ„ μ‹œν•œλ‹€.", dim: "TF" },
49
+ { text: "쑰직적인 ν™˜κ²½μ—μ„œ 일을 효율적으둜 μ²˜λ¦¬ν•œλ‹€.", dim: "JP" },
50
+ { text: "ν™œλ°œν•œ μ‚¬νšŒ ν™œλ™μ„ 즐긴닀.", dim: "EI" },
51
+ { text: "κ²½ν—˜μ—μ„œ λ°°μš°λŠ” 것을 μ€‘μš”μ‹œν•œλ‹€.", dim: "SN" },
52
+ { text: "뢄석적이고 객관적인 사고방식을 κ°€μ§„λ‹€.", dim: "TF" },
53
+ { text: "예츑 κ°€λŠ₯ν•œ 일정을 μ„ ν˜Έν•œλ‹€.", dim: "JP" }
54
+ ];
55
+
56
+ // MBTI 차원에 λ”°λ₯Έ μ–‘μͺ½ 문자 (예: "EI" β†’ ["E", "I"])
57
+ const dimensionLetters = {
58
+ "EI": ["E", "I"],
59
+ "SN": ["S", "N"],
60
+ "TF": ["T", "F"],
61
+ "JP": ["J", "P"]
62
+ };
63
+
64
+ // MBTI μœ ν˜•λ³„ 상세 정보
65
+ const mbtiDetails = {
66
+ "INTJ": {
67
+ description: "뢄석적이고 μ „λž΅μ μΈ 사고λ ₯을 κ°€μ§„ μœ ν˜•μœΌλ‘œ, 체계적이고 κ³„νšμ μΈ 성격을 λ³΄μž…λ‹ˆλ‹€.",
68
+ recommended_jobs: "κ³Όν•™μž, 연ꡬ원, μ—”μ§€λ‹ˆμ–΄, μ „λž΅ 기획자",
69
+ good_compatibility: "ENTP, ENFP",
70
+ good_reason: "창의적이며 도전적인 μ„±ν–₯이 μƒν˜Έ λ³΄μ™„λ˜μ–΄ λ°œμ „μ μΈ 관계λ₯Ό ν˜•μ„±ν•  수 μžˆμŠ΅λ‹ˆλ‹€.",
71
+ bad_compatibility: "ESFP, ESTP",
72
+ bad_reason: "즉ν₯적이고 μ™Έν–₯적인 μ„±ν–₯으둜 μΆ©λŒν•  수 μžˆμŠ΅λ‹ˆλ‹€."
73
+ },
74
+ "INTP": {
75
+ description: "논리적이고 뢄석적인 사고λ₯Ό μ€‘μ‹œν•˜λ©°, 독창적인 아이디어λ₯Ό μ¦κΈ°λŠ” μœ ν˜•μž…λ‹ˆλ‹€.",
76
+ recommended_jobs: "연ꡬ원, μ†Œν”„νŠΈμ›¨μ–΄ 개발자, 뢄석가",
77
+ good_compatibility: "ENTJ, ENTP",
78
+ good_reason: "지적인 λŒ€ν™”μ™€ 토둠을 톡해 μ„œλ‘œμ˜ 아이디어λ₯Ό λ°œμ „μ‹œν‚¬ 수 μžˆμŠ΅λ‹ˆλ‹€.",
79
+ bad_compatibility: "ESFJ, ESTJ",
80
+ bad_reason: "ꡬ쑰적이고 κ·œμΉ™μ„ μ€‘μ‹œν•˜λŠ” μ„±ν–₯κ³Ό 의견 차이가 λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€."
81
+ },
82
+ "ENTJ": {
83
+ description: "리더십이 κ°•ν•˜κ³  λͺ©ν‘œ μ§€ν–₯적이며, 결단λ ₯ μžˆλŠ” 성격을 κ°€μ§„ μœ ν˜•μž…λ‹ˆλ‹€.",
84
+ recommended_jobs: "경영자, ν”„λ‘œμ νŠΈ λ§€λ‹ˆμ €, λ³€ν˜Έμ‚¬",
85
+ good_compatibility: "INTP, INFP",
86
+ good_reason: "μ„œλ‘œ 보완적인 강점을 ν™œμš©ν•΄ 효과적인 ν˜‘λ ₯이 κ°€λŠ₯ν•©λ‹ˆλ‹€.",
87
+ bad_compatibility: "ISFP, INFP",
88
+ bad_reason: "감성적이고 μœ μ—°ν•œ μ„±ν–₯μ—μ„œ κ°ˆλ“±μ΄ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€."
89
+ },
90
+ "ENTP": {
91
+ description: "창의적이고 도전적인 μ„±ν–₯을 μ§€λ‹ˆλ©°, μƒˆλ‘œμš΄ 아이디어와 λ…ΌμŸμ„ μ¦κΉλ‹ˆλ‹€.",
92
+ recommended_jobs: "λ³€ν˜Έμ‚¬, 기자, λ§ˆμΌ€νŒ… μ „λ¬Έκ°€",
93
+ good_compatibility: "INTJ, INFJ",
94
+ good_reason: "논리적이고 깊이 μžˆλŠ” λŒ€ν™”λ₯Ό 톡해 μ„œλ‘œμ˜ 아이디어λ₯Ό λ°œμ „μ‹œν‚¬ 수 μžˆμŠ΅λ‹ˆλ‹€.",
95
+ bad_compatibility: "ISFJ, ISTJ",
96
+ bad_reason: "보수적이고 전톡적인 μ„±ν–₯μ—μ„œ 의견 좩돌이 λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€."
97
+ },
98
+ "INFJ": {
99
+ description: "κΉŠμ€ 톡찰λ ₯κ³Ό μ΄μƒμ£Όμ˜λ₯Ό λ°”νƒ•μœΌλ‘œ, 타인을 λ°°λ €ν•˜λŠ” λ”°λœ»ν•œ 성격을 κ°€μ§„ μœ ν˜•μž…λ‹ˆλ‹€.",
100
+ recommended_jobs: "상담가, μž‘κ°€, μ˜ˆμˆ κ°€",
101
+ good_compatibility: "ENFP, ENFJ",
102
+ good_reason: "감성적이며 이해심 κΉŠμ€ 관계λ₯Ό 톡해 μ„œλ‘œλ₯Ό 보완할 수 μžˆμŠ΅λ‹ˆλ‹€.",
103
+ bad_compatibility: "ESTP, ESFP",
104
+ bad_reason: "ν˜„μ‹€μ μ΄κ³  ν™œλ™μ μΈ μ„±ν–₯μ—μ„œ κ°ˆλ“±μ΄ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€."
105
+ },
106
+ "INFP": {
107
+ description: "μ΄μƒμ£Όμ˜μ μ΄κ³  감성적인 μ„±ν–₯으둜, λ‚΄λ©΄μ˜ κ°€μΉ˜μ™€ 감정을 μ€‘μ‹œν•˜λŠ” μœ ν˜•μž…λ‹ˆλ‹€.",
108
+ recommended_jobs: "μž‘κ°€, μ˜ˆμˆ κ°€, 상담가",
109
+ good_compatibility: "ENFJ, INFJ",
110
+ good_reason: "μ„œλ‘œμ˜ 감성적 곡감 λŠ₯λ ₯을 λ°”νƒ•μœΌλ‘œ κΉŠμ€ 이해λ₯Ό λ‚˜λˆŒ 수 μžˆμŠ΅λ‹ˆλ‹€.",
111
+ bad_compatibility: "ESTJ, ENTJ",
112
+ bad_reason: "논리적이고 쑰직적인 μ„±ν–₯κ³Ό μΆ©λŒν•  수 μžˆμŠ΅λ‹ˆλ‹€."
113
+ },
114
+ "ENFJ": {
115
+ description: "μ‚¬λžŒ 쀑심적이며, 타인을 λ„μš°λ €λŠ” λ”°λœ»ν•œ λ§ˆμŒμ„ κ°€μ§„ λ¦¬λ”ν˜• μœ ν˜•μž…λ‹ˆλ‹€.",
116
+ recommended_jobs: "ꡐ윑자, 상담가, 인사 λ‹΄λ‹Ήμž",
117
+ good_compatibility: "INFP, INFJ",
118
+ good_reason: "감성적 ꡐ감을 톡해 κΉŠμ€ 관계λ₯Ό ν˜•μ„±ν•  수 μžˆμŠ΅λ‹ˆλ‹€.",
119
+ bad_compatibility: "ISTP, INTP",
120
+ bad_reason: "논리적이고 독립적인 μ„±ν–₯μ—μ„œ μΆ©λŒν•  수 μžˆμŠ΅λ‹ˆλ‹€."
121
+ },
122
+ "ENFP": {
123
+ description: "열정적이고 창의적인 아이디어λ₯Ό κ°€μ§„ μœ ν˜•μœΌλ‘œ, μƒˆλ‘œμš΄ 도전을 μ¦κΉλ‹ˆλ‹€.",
124
+ recommended_jobs: "λ§ˆμΌ€νŒ…, κ΄‘κ³ , μ˜ˆμˆ κ°€",
125
+ good_compatibility: "INFJ, INTJ",
126
+ good_reason: "μ„œλ‘œμ˜ μ°½μ˜μ„±κ³Ό 열정을 κ³΅μœ ν•˜λ©° μƒν˜Έ 보완적인 관계λ₯Ό ν˜•μ„±ν•©λ‹ˆλ‹€.",
127
+ bad_compatibility: "ISTJ, ESTJ",
128
+ bad_reason: "κ·œμΉ™μ μ΄κ³  보수적인 μ„±ν–₯μ—μ„œ κ°ˆλ“±μ΄ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€."
129
+ },
130
+ "ISTJ": {
131
+ description: "μ‹ λ’°ν•  수 있고 μ±…μž„κ° μžˆλŠ” μœ ν˜•μœΌλ‘œ, 체계적이고 논리적인 성격을 μ§€λ‹™λ‹ˆλ‹€.",
132
+ recommended_jobs: "νšŒκ³„μ‚¬, κ΄€λ¦¬μž, ꡰ인",
133
+ good_compatibility: "ESFJ, ESTJ",
134
+ good_reason: "λΉ„μŠ·ν•œ κ°€μΉ˜κ΄€κ³Ό μƒν™œ 방식을 κ³΅μœ ν•˜μ—¬ μ•ˆμ •μ μΈ 관계λ₯Ό μœ μ§€ν•  수 μžˆμŠ΅λ‹ˆλ‹€.",
135
+ bad_compatibility: "ENFP, ENTP",
136
+ bad_reason: "자유둜운 사고와 μ°½μ˜μ„±μ˜ 차이둜 의견 좩돌이 λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€."
137
+ },
138
+ "ISFJ": {
139
+ description: "μ„¬μ„Έν•˜κ³  λ”°λœ»ν•œ μ„±κ²©μœΌλ‘œ, νƒ€μΈμ˜ 감정을 잘 μ΄ν•΄ν•˜κ³  λ°°λ €ν•˜λŠ” μœ ν˜•μž…λ‹ˆλ‹€.",
140
+ recommended_jobs: "κ°„ν˜Έμ‚¬, ꡐ사, 상담가",
141
+ good_compatibility: "ESFP, ESTP",
142
+ good_reason: "μ„œλ‘œμ˜ 배렀심과 μ•ˆμ •κ°μ„ κ³΅μœ ν•˜μ—¬ μ‘°ν™”λ‘œμš΄ 관계λ₯Ό ν˜•μ„±ν•  수 μžˆμŠ΅λ‹ˆλ‹€.",
143
+ bad_compatibility: "ENTP, ESTP",
144
+ bad_reason: "논리적 뢄석과 창의적 μ•„μ΄λ””μ–΄μ—μ„œ 차이가 λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€."
145
+ },
146
+ "ESTJ": {
147
+ description: "쑰직적이고 ν˜„μ‹€μ μΈ μ„±κ²©μœΌλ‘œ, μ±…μž„κ°κ³Ό 결단λ ₯이 λ›°μ–΄λ‚œ μœ ν˜•μž…λ‹ˆλ‹€.",
148
+ recommended_jobs: "κ΄€λ¦¬μž, 곡무원, ꡰ인",
149
+ good_compatibility: "ISTJ, ISFJ",
150
+ good_reason: "λΉ„μŠ·ν•œ κ°€μΉ˜κ΄€μ„ κ³΅μœ ν•˜μ—¬ μ•ˆμ •μ μΈ 관계λ₯Ό μœ μ§€ν•  수 μžˆμŠ΅λ‹ˆλ‹€.",
151
+ bad_compatibility: "INFP, INTP",
152
+ bad_reason: "μ΄μƒμ£Όμ˜μ  μ„±ν–₯κ³Ό 논리적 뢄석 μ‚¬μ΄μ—μ„œ κ°ˆλ“±μ΄ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€."
153
+ },
154
+ "ESFJ": {
155
+ description: "사ꡐ적이고 ν˜‘λ ₯적인 μ„±κ²©μœΌλ‘œ, 타인을 λ°°λ €ν•˜κ³  μ‘΄μ€‘ν•˜λŠ” κ²½ν–₯이 μžˆλŠ” μœ ν˜•μž…λ‹ˆλ‹€.",
156
+ recommended_jobs: "ꡐ사, μ‚¬νšŒλ³΅μ§€μ‚¬, 의료 μ’…μ‚¬μž",
157
+ good_compatibility: "ISFJ, ISTJ",
158
+ good_reason: "μƒν˜Έ 신뒰와 μ•ˆμ •κ°μ„ λ°”νƒ•μœΌλ‘œ ν•œ 관계가 ν˜•μ„±λ©λ‹ˆλ‹€.",
159
+ bad_compatibility: "INTP, ISTP",
160
+ bad_reason: "논리적 사고와 독립적인 μ„±ν–₯의 차이둜 κ°ˆλ“±μ΄ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€."
161
+ },
162
+ "ESTP": {
163
+ description: "즉ν₯적이고 λͺ¨ν—˜μ„ μ¦κΈ°λŠ” μ„±κ²©μœΌλ‘œ, ν˜„μ‹€μ μ΄κ³  μ‹€μš©μ μΈ μ ‘κ·Ό 방식을 μ„ ν˜Έν•˜λŠ” μœ ν˜•μž…λ‹ˆλ‹€.",
164
+ recommended_jobs: "μ˜μ—…, λ§ˆμΌ€νŒ…, 응급 ꡬ쑰 μš”μ›",
165
+ good_compatibility: "ISTP, ESFP",
166
+ good_reason: "μ‹€μš©μ μ΄κ³  즉각적인 λ°˜μ‘μ΄ μƒν˜Έ λ³΄οΏ½οΏ½μ μž…λ‹ˆλ‹€.",
167
+ bad_compatibility: "INFJ, INFP",
168
+ bad_reason: "μ΄μƒμ£Όμ˜μ  μ„±ν–₯κ³Ό 즉ν₯적 ν–‰λ™μ˜ 차이둜 μΆ©λŒν•  수 μžˆμŠ΅λ‹ˆλ‹€."
169
+ },
170
+ "ESFP": {
171
+ description: "사ꡐ적이고 ν™œκΈ°μ°¬ μ„±κ²©μœΌλ‘œ, μ£Όλ³€ μ‚¬λžŒλ“€μ—κ²Œ 긍정적인 μ—λ„ˆμ§€λ₯Ό μ „λ‹¬ν•˜λŠ” μœ ν˜•μž…λ‹ˆλ‹€.",
172
+ recommended_jobs: "μ—°μ˜ˆμΈ, 이벀트 ν”Œλž˜λ„ˆ, μ˜μ—…",
173
+ good_compatibility: "ISFP, ESTP",
174
+ good_reason: "긍정적인 μ—λ„ˆμ§€μ™€ ν˜„μ‹€μ μΈ μ ‘κ·Ό 방식이 μ‘°ν™”λ₯Ό μ΄λ£Ήλ‹ˆλ‹€.",
175
+ bad_compatibility: "INTJ, INTP",
176
+ bad_reason: "뢄석적이고 κ³„νšμ μΈ 성격과 μΆ©λŒν•  수 μžˆμŠ΅λ‹ˆλ‹€."
177
+ },
178
+ "ISTP": {
179
+ description: "뢄석적이며 ν˜„μ‹€μ μΈ μ„±κ²©μœΌλ‘œ, 문제 ν•΄κ²° λŠ₯λ ₯이 λ›°μ–΄λ‚œ μœ ν˜•μž…λ‹ˆλ‹€.",
180
+ recommended_jobs: "μ—”μ§€λ‹ˆμ–΄, 기술자, ν”„λ‘œκ·Έλž˜λ¨Έ",
181
+ good_compatibility: "ESTP, ESFP",
182
+ good_reason: "λΉ„μŠ·ν•œ ν˜„μ‹€μ  μ ‘κ·Ό 방식을 κ³΅μœ ν•©λ‹ˆλ‹€.",
183
+ bad_compatibility: "ENFJ, ENTJ",
184
+ bad_reason: "쑰직적이고 리더십이 κ°•ν•œ μ„±ν–₯κ³Ό μΆ©λŒν•  수 μžˆμŠ΅λ‹ˆλ‹€."
185
+ },
186
+ "ISFP": {
187
+ description: "μ˜¨ν™”ν•˜κ³  예술적인 μ„±ν–₯으둜, 감각적이며 창의적인 λ©΄λͺ¨λ₯Ό λ³΄μ΄λŠ” μœ ν˜•μž…λ‹ˆλ‹€.",
188
+ recommended_jobs: "λ””μžμ΄λ„ˆ, μ˜ˆμˆ κ°€, μš”λ¦¬μ‚¬",
189
+ good_compatibility: "ESFP, INFP",
190
+ good_reason: "감성적이고 창의적인 λ©΄λͺ¨λ‘œ μ„œλ‘œλ₯Ό 이해할 수 μžˆμŠ΅λ‹ˆλ‹€.",
191
+ bad_compatibility: "ENTJ, ESTJ",
192
+ bad_reason: "결단λ ₯κ³Ό 체계성이 λΆ€μ‘±ν•˜λ‹€λŠ” μ μ—μ„œ 의견 차이가 λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€."
193
+ }
194
+ };
195
+
196
+ // 각 선택지에 ν•΄λ‹Ήν•˜λŠ” 점수
197
+ const scoreMapping = {
198
+ "맀우 κ·Έλ ‡λ‹€": 5,
199
+ "κ·Έλ ‡λ‹€": 4,
200
+ "보톡이닀": 3,
201
+ "μ•„λ‹ˆλ‹€": 2,
202
+ "맀우 μ•„λ‹ˆλ‹€": 1
203
+ };
204
+
205
+ const totalQuestions = questions.length;
206
+ const questionsPerPage = 5;
207
+ const totalPages = Math.ceil(totalQuestions / questionsPerPage);
208
+ let currentPage = 0;
209
+ let answers = new Array(totalQuestions).fill(null);
210
+
211
+ const quizContainer = document.querySelector(".quiz-container");
212
+ const prevBtn = document.getElementById("prev-btn");
213
+ const nextBtn = document.getElementById("next-btn");
214
+ const resultContainer = document.getElementById("result-container");
215
+ const resultText = document.getElementById("result-text");
216
+ const mbtiImage = document.getElementById("mbti-image");
217
+
218
+ // ν˜„μž¬ νŽ˜μ΄μ§€μ˜ 질문 5개λ₯Ό λ Œλ”λ§
219
+ function renderPage() {
220
+ quizContainer.innerHTML = "";
221
+ const start = currentPage * questionsPerPage;
222
+ const end = Math.min(start + questionsPerPage, totalQuestions);
223
+ for (let i = start; i < end; i++) {
224
+ const q = questions[i];
225
+ const div = document.createElement("div");
226
+ div.className = "question";
227
+ const label = document.createElement("label");
228
+ label.textContent = `Q${i+1}. ${q.text}`;
229
+ div.appendChild(label);
230
+
231
+ const optionsDiv = document.createElement("div");
232
+ optionsDiv.className = "options";
233
+ for (let option of Object.keys(scoreMapping)) {
234
+ const optionLabel = document.createElement("label");
235
+ optionLabel.textContent = option;
236
+ const radio = document.createElement("input");
237
+ radio.type = "radio";
238
+ radio.name = `question_${i}`;
239
+ radio.value = option;
240
+ if (answers[i] === option) {
241
+ radio.checked = true;
242
+ }
243
+ optionLabel.prepend(radio);
244
+ optionsDiv.appendChild(optionLabel);
245
+ }
246
+ div.appendChild(optionsDiv);
247
+ quizContainer.appendChild(div);
248
+ }
249
+ prevBtn.disabled = currentPage === 0;
250
+ nextBtn.textContent = (currentPage === totalPages - 1) ? "제좜" : "λ‹€μŒ";
251
+ }
252
+
253
+ // ν˜„μž¬ νŽ˜μ΄μ§€μ˜ 선택지λ₯Ό μ €μž₯
254
+ function collectAnswers() {
255
+ const start = currentPage * questionsPerPage;
256
+ const end = Math.min(start + questionsPerPage, totalQuestions);
257
+ for (let i = start; i < end; i++) {
258
+ const radios = document.getElementsByName(`question_${i}`);
259
+ for (let radio of radios) {
260
+ if (radio.checked) {
261
+ answers[i] = radio.value;
262
+ }
263
+ }
264
+ }
265
+ }
266
+
267
+ // κ²°κ³Ό 계산 및 좜λ ₯ (MBTI 점수 μ‚°μΆœ 및 상세 정보 ν‘œμ‹œ)
268
+ function calculateResults() {
269
+ const dimScores = { "EI": [], "SN": [], "TF": [], "JP": [] };
270
+ for (let i = 0; i < totalQuestions; i++) {
271
+ const ans = answers[i];
272
+ if (!ans) continue;
273
+ const score = scoreMapping[ans];
274
+ const dim = questions[i].dim;
275
+ dimScores[dim].push(score);
276
+ }
277
+ const resultLetters = {};
278
+ const dimDetails = {};
279
+ const overallMatches = [];
280
+ for (let dim in dimScores) {
281
+ const scores = dimScores[dim];
282
+ const num = scores.length;
283
+ const total = scores.reduce((a, b) => a + b, 0);
284
+ const percent = (total - num) / (4 * num) * 100;
285
+ const [firstLetter, secondLetter] = dimensionLetters[dim];
286
+ let match;
287
+ if (percent >= 50) {
288
+ resultLetters[dim] = firstLetter;
289
+ match = Math.round(percent);
290
+ } else {
291
+ resultLetters[dim] = secondLetter;
292
+ match = Math.round(100 - percent);
293
+ }
294
+ dimDetails[dim] = match;
295
+ overallMatches.push(match);
296
+ }
297
+ const finalMBTI = resultLetters["EI"] + resultLetters["SN"] + resultLetters["TF"] + resultLetters["JP"];
298
+ const overallAvg = Math.round(overallMatches.reduce((a, b) => a + b, 0) / overallMatches.length);
299
+ const details = mbtiDetails[finalMBTI] || {
300
+ description: "ν•΄λ‹Ή μœ ν˜•μ— λŒ€ν•œ 정보가 μ€€λΉ„λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.",
301
+ recommended_jobs: "정보 μ—†μŒ",
302
+ good_compatibility: "정보 μ—†μŒ",
303
+ good_reason: "",
304
+ bad_compatibility: "정보 μ—†μŒ",
305
+ bad_reason: ""
306
+ };
307
+
308
+ let resultMsg = `<h2>λ‹Ήμ‹ μ˜ MBTI μœ ν˜•μ€ ${finalMBTI} μž…λ‹ˆλ‹€!</h2>`;
309
+ resultMsg += `<p>- μ™Έν–₯/λ‚΄ν–₯: ${dimDetails["EI"]}%</p>`;
310
+ resultMsg += `<p>- 감각/직관: ${dimDetails["SN"]}%</p>`;
311
+ resultMsg += `<p>- 사고/감정: ${dimDetails["TF"]}%</p>`;
312
+ resultMsg += `<p>- νŒλ‹¨/인식: ${dimDetails["JP"]}%</p>`;
313
+ resultMsg += `<p>- 전체 일치율: ${overallAvg}%</p>`;
314
+ resultMsg += `<h3>성격 및 기질</h3><p>${details.description}</p>`;
315
+ resultMsg += `<h3>μΆ”μ²œ 직업</h3><p>${details.recommended_jobs}</p>`;
316
+ resultMsg += `<h3>쒋은 ꢁ합</h3><p>${details.good_compatibility} : ${details.good_reason}</p>`;
317
+ resultMsg += `<h3>λ‚˜μœ ꢁ합</h3><p>${details.bad_compatibility} : ${details.bad_reason}</p>`;
318
+ resultText.innerHTML = resultMsg;
319
+ // MBTI μœ ν˜•μ— ν•΄λ‹Ήν•˜λŠ” 이미지 (동일 폴더 λ‚΄ 파일)
320
+ mbtiImage.src = `${finalMBTI}.webp`;
321
+ }
322
+
323
+ nextBtn.addEventListener("click", function() {
324
+ collectAnswers();
325
+ if (currentPage < totalPages - 1) {
326
+ currentPage++;
327
+ renderPage();
328
+ } else {
329
+ // λ§ˆμ§€λ§‰ νŽ˜μ΄μ§€μ—μ„œ 제좜 μ‹œ κ²°κ³Ό 계산 ν›„ ν™”λ©΄ μ „ν™˜
330
+ calculateResults();
331
+ document.querySelector(".quiz-container").style.display = "none";
332
+ document.querySelector(".navigation").style.display = "none";
333
+ resultContainer.style.display = "block";
334
+ }
335
+ });
336
+
337
+ prevBtn.addEventListener("click", function() {
338
+ collectAnswers();
339
+ if (currentPage > 0) {
340
+ currentPage--;
341
+ renderPage();
342
+ }
343
+ });
344
+
345
+ renderPage();
346
+ </script>
347
+ </body>
348
  </html>