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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="ko">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>λμκ² μ΄μΈλ¦¬λ μ¬νμ§ μ°ΎκΈ° βοΈ</title>
|
7 |
+
<style>
|
8 |
+
body {
|
9 |
+
font-family: 'Arial', sans-serif;
|
10 |
+
line-height: 1.6;
|
11 |
+
background-color: #f4f4f4;
|
12 |
+
color: #333;
|
13 |
+
margin: 0;
|
14 |
+
padding: 20px;
|
15 |
+
display: flex;
|
16 |
+
justify-content: center;
|
17 |
+
align-items: center;
|
18 |
+
min-height: 100vh;
|
19 |
+
}
|
20 |
+
|
21 |
+
.quiz-container {
|
22 |
+
background-color: #fff;
|
23 |
+
padding: 30px;
|
24 |
+
border-radius: 8px;
|
25 |
+
box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
|
26 |
+
max-width: 600px;
|
27 |
+
width: 100%;
|
28 |
+
text-align: center;
|
29 |
+
}
|
30 |
+
|
31 |
+
h1 {
|
32 |
+
color: #0056b3;
|
33 |
+
margin-bottom: 20px;
|
34 |
+
}
|
35 |
+
|
36 |
+
.question-container {
|
37 |
+
margin-bottom: 20px;
|
38 |
+
}
|
39 |
+
|
40 |
+
.question-container p {
|
41 |
+
font-size: 1.2em;
|
42 |
+
margin-bottom: 15px;
|
43 |
+
font-weight: bold;
|
44 |
+
}
|
45 |
+
|
46 |
+
.options button {
|
47 |
+
display: block;
|
48 |
+
width: 100%;
|
49 |
+
padding: 12px;
|
50 |
+
margin-bottom: 10px;
|
51 |
+
border: 1px solid #ccc;
|
52 |
+
border-radius: 5px;
|
53 |
+
background-color: #eee;
|
54 |
+
font-size: 1em;
|
55 |
+
cursor: pointer;
|
56 |
+
transition: background-color 0.3s ease;
|
57 |
+
}
|
58 |
+
|
59 |
+
.options button:hover {
|
60 |
+
background-color: #ddd;
|
61 |
+
}
|
62 |
+
|
63 |
+
.options button:active {
|
64 |
+
background-color: #ccc;
|
65 |
+
}
|
66 |
+
|
67 |
+
.result-container {
|
68 |
+
display: none; /* μ΄κΈ°μλ μ¨κΉ */
|
69 |
+
text-align: center;
|
70 |
+
}
|
71 |
+
|
72 |
+
.result-container h2 {
|
73 |
+
color: #28a745;
|
74 |
+
margin-bottom: 15px;
|
75 |
+
}
|
76 |
+
|
77 |
+
.result-container p {
|
78 |
+
font-size: 1.1em;
|
79 |
+
margin-bottom: 20px;
|
80 |
+
}
|
81 |
+
|
82 |
+
.result-container a {
|
83 |
+
display: inline-block;
|
84 |
+
background-color: #ff5722; /* μΏ ν‘ μ€λ μ§μ λλ */
|
85 |
+
color: white;
|
86 |
+
padding: 12px 25px;
|
87 |
+
border-radius: 5px;
|
88 |
+
text-decoration: none;
|
89 |
+
font-size: 1.1em;
|
90 |
+
transition: background-color 0.3s ease;
|
91 |
+
}
|
92 |
+
|
93 |
+
.result-container a:hover {
|
94 |
+
background-color: #e64a19;
|
95 |
+
}
|
96 |
+
|
97 |
+
/* μ§λ¬Έ μ¨κΈ°κΈ°/보μ΄κΈ° μ λλ©μ΄μ
*/
|
98 |
+
.question-container.hidden {
|
99 |
+
display: none;
|
100 |
+
opacity: 0;
|
101 |
+
transition: opacity 0.5s ease;
|
102 |
+
}
|
103 |
+
.question-container.visible {
|
104 |
+
display: block;
|
105 |
+
opacity: 1;
|
106 |
+
transition: opacity 0.5s ease;
|
107 |
+
}
|
108 |
+
|
109 |
+
</style>
|
110 |
+
</head>
|
111 |
+
<body>
|
112 |
+
|
113 |
+
<div class="quiz-container">
|
114 |
+
<h1>λμκ² μ΄μΈλ¦¬λ μ¬νμ§ μ°ΎκΈ° βοΈ</h1>
|
115 |
+
<div id="intro" class="question-container visible">
|
116 |
+
<p>λͺ κ°μ§ μ§λ¬Έμ λ΅νκ³ λΉμ μκ² λ± λ§λ μ¬νμ§λ₯Ό μ°Ύμ보μΈμ!</p>
|
117 |
+
<div class="options">
|
118 |
+
<button onclick="startQuiz()">ν΄μ¦ μμνκΈ°</button>
|
119 |
+
</div>
|
120 |
+
</div>
|
121 |
+
|
122 |
+
<div id="question1" class="question-container hidden">
|
123 |
+
<p>1. μ΄λ€ μ’
λ₯μ μ¬νμ κ°μ₯ μ’μνμλμ?</p>
|
124 |
+
<div class="options">
|
125 |
+
<button onclick="answerQuestion(1, 'relax')">νΉ μ¬λ ν΄μ μ¬ν ποΈ</button>
|
126 |
+
<button onclick="answerQuestion(1, 'activity')">μ λλ μ‘ν°λΉν° μ¬ν π§ββοΈ</button>
|
127 |
+
<button onclick="answerQuestion(1, 'culture')">λ€μν λ¬Ένλ₯Ό κ²½ννλ μ¬ν ποΈ</button>
|
128 |
+
</div>
|
129 |
+
</div>
|
130 |
+
|
131 |
+
<div id="question2" class="question-container hidden">
|
132 |
+
<p>2. μ¬νμ§μμ κ°μ₯ μ€μνκ² μκ°νλ κ²μ?</p>
|
133 |
+
<div class="options">
|
134 |
+
<button onclick="answerQuestion(2, 'nature')">μλ¦λ€μ΄ μμ° κ²½κ΄ ποΈ</button>
|
135 |
+
<button onclick="answerQuestion(2, 'food')">λ§μλ νμ§ μμ π²</button>
|
136 |
+
<button onclick="answerQuestion(2, 'shopping')">λ€μν μΌν κΈ°ν ποΈ</button>
|
137 |
+
</div>
|
138 |
+
</div>
|
139 |
+
|
140 |
+
<div id="question3" class="question-container hidden">
|
141 |
+
<p>3. μ¬ν μμ°μ μ΄λ μ λ μκ°νμλμ?</p>
|
142 |
+
<div class="options">
|
143 |
+
<button onclick="answerQuestion(3, 'low')">μ λ ΄νκ² μ¦κΈ°λ μ¬ν π°</button>
|
144 |
+
<button onclick="answerQuestion(3, 'medium')">μ λΉν ν¬μνλ μ¬ν π</button>
|
145 |
+
<button onclick="answerQuestion(3, 'high')">μμ° μκ΄μμ΄ μ¦κΈ°λ μ¬ν λμ
리νκ² β¨</button>
|
146 |
+
</div>
|
147 |
+
</div>
|
148 |
+
|
149 |
+
<div id="question4" class="question-container hidden">
|
150 |
+
<p>4. λꡬμ ν¨κ» μ¬ννλ κ²μ μ νΈνμλμ?</p>
|
151 |
+
<div class="options">
|
152 |
+
<button onclick="answerQuestion(4, 'alone')">νΌμλ§μ μκ° μ¦κΈ°κΈ° πΆ</button>
|
153 |
+
<button onclick="answerQuestion(4, 'friends')">μΉκ΅¬ λλ μ°μΈκ³Ό ν¨κ» π«</button>
|
154 |
+
<button onclick="answerQuestion(4, 'family')">κ°μ‘±κ³Ό μμ€ν μΆμ΅ λ§λ€κΈ° π¨βπ©βπ§βπ¦</button>
|
155 |
+
</div>
|
156 |
+
</div>
|
157 |
+
|
158 |
+
|
159 |
+
<div id="result" class="result-container">
|
160 |
+
<h2>λΉμ μκ² μ΄μΈλ¦¬λ μ¬νμ§λ...</h2>
|
161 |
+
<p id="result-text"></p>
|
162 |
+
<a id="coupang-link" href="#" target="_blank">μΏ ν‘μμ κ΄λ ¨ μ¬ν μν μ°Ύμ보기 βοΈ</a>
|
163 |
+
</div>
|
164 |
+
</div>
|
165 |
+
|
166 |
+
<script>
|
167 |
+
let currentQuestion = 0;
|
168 |
+
const questions = ['intro', 'question1', 'question2', 'question3', 'question4']; // μ§λ¬Έ ID λͺ©λ‘
|
169 |
+
const answers = {}; // μ¬μ©μμ λ΅λ³μ μ μ₯ν κ°μ²΄
|
170 |
+
|
171 |
+
function startQuiz() {
|
172 |
+
document.getElementById('intro').classList.remove('visible');
|
173 |
+
document.getElementById('intro').classList.add('hidden');
|
174 |
+
currentQuestion++;
|
175 |
+
showQuestion(currentQuestion);
|
176 |
+
}
|
177 |
+
|
178 |
+
function showQuestion(index) {
|
179 |
+
if (index > questions.length - 1) {
|
180 |
+
showResult();
|
181 |
+
return;
|
182 |
+
}
|
183 |
+
|
184 |
+
// μ΄μ μ§λ¬Έ μ¨κΈ°κΈ° (λ§μ½ μλ€λ©΄)
|
185 |
+
if (currentQuestion > 0) {
|
186 |
+
const prevQuestionId = questions[currentQuestion - 1];
|
187 |
+
const prevQuestionElement = document.getElementById(prevQuestionId);
|
188 |
+
if (prevQuestionElement) {
|
189 |
+
prevQuestionElement.classList.remove('visible');
|
190 |
+
prevQuestionElement.classList.add('hidden');
|
191 |
+
}
|
192 |
+
}
|
193 |
+
|
194 |
+
|
195 |
+
const currentQuestionId = questions[index];
|
196 |
+
const currentQuestionElement = document.getElementById(currentQuestionId);
|
197 |
+
if (currentQuestionElement) {
|
198 |
+
currentQuestionElement.classList.remove('hidden');
|
199 |
+
currentQuestionElement.classList.add('visible');
|
200 |
+
}
|
201 |
+
}
|
202 |
+
|
203 |
+
function answerQuestion(questionNumber, answer) {
|
204 |
+
answers[questionNumber] = answer; // λ΅λ³ μ μ₯
|
205 |
+
currentQuestion++;
|
206 |
+
showQuestion(currentQuestion); // λ€μ μ§λ¬ΈμΌλ‘ μ΄λ
|
207 |
+
}
|
208 |
+
|
209 |
+
function showResult() {
|
210 |
+
// λͺ¨λ μ§λ¬Έμ μ¨κΉλλ€.
|
211 |
+
questions.forEach(id => {
|
212 |
+
const element = document.getElementById(id);
|
213 |
+
if (element) {
|
214 |
+
element.classList.remove('visible');
|
215 |
+
element.classList.add('hidden');
|
216 |
+
}
|
217 |
+
});
|
218 |
+
|
219 |
+
const resultElement = document.getElementById('result');
|
220 |
+
const resultTextElement = document.getElementById('result-text');
|
221 |
+
const coupangLinkElement = document.getElementById('coupang-link');
|
222 |
+
|
223 |
+
let result = "";
|
224 |
+
let coupangLink = "#"; // κΈ°λ³Έ μΏ ν‘ λ§ν¬ (λμ€μ μ€μ λ§ν¬λ‘ λ³κ²½ νμ)
|
225 |
+
|
226 |
+
// κ°λ¨ν λ‘μ§μΌλ‘ κ²°κ³Ό κ²°μ (κ° λ΅λ³μ μ‘°ν©μ λ°λΌ λ€λ₯Έ κ²°κ³Ό λμΆ)
|
227 |
+
// μ΄ λΆλΆμ λ 볡μ‘ν λ‘μ§μΌλ‘ λ°μ μν¬ μ μμ΅λλ€.
|
228 |
+
if (answers[1] === 'relax' && answers[2] === 'nature') {
|
229 |
+
result = "μλ¦λ€μ΄ ν΄λ³κ° ν΄μμ§ ποΈ";
|
230 |
+
coupangLink = "https://www.coupang.com/np/search?q=%ED%95%B4%EB%B3%80%EA%B0%80+%ED%9C%B4%EC%96%91&channel=user&component=list_vertical&source=user_component"; // μΏ ν‘ ν΄λ³κ° ν΄μ κ²μ λ§ν¬ (μμ)
|
231 |
+
} else if (answers[1] === 'activity' && answers[3] === 'medium') {
|
232 |
+
result = "μ λλ μ‘ν°λΉν° λμ μ¬ν ποΈ";
|
233 |
+
coupangLink = "https://www.coupang.com/np/search?q=%EB%8F%84%EC%8B%9C+%EC%97%AC%ED%96%89+%EC%95%A1%ED%8B%B0%EB%B9%84%ED%8B%B0&channel=user&component=list_vertical&source=user_component"; // μΏ ν‘ λμ μ¬ν μ‘ν°λΉν° κ²μ λ§ν¬ (μμ)
|
234 |
+
} else if (answers[1] === 'culture' && answers[4] === 'alone') {
|
235 |
+
result = "μμ¬μ λ¬Ένκ° μ΄μ μ¨μ¬λ κ³³ ποΈ";
|
236 |
+
coupangLink = "https://www.coupang.com/np/search?q=%EB%AC%B8%ED%99%94+%EC%97%AC%ED%96%89&channel=user&component=list_vertical&source=user_component"; // μΏ ν‘ λ¬Έν μ¬ν κ²μ λ§ν¬ (μμ)
|
237 |
+
} else if (answers[3] === 'low' && answers[4] === 'friends') {
|
238 |
+
result = "μ λ ΄νκ² μ¦κΈ°λ λ°°λμ¬ν λͺ
μ π";
|
239 |
+
coupangLink = "https://www.coupang.com/np/search?q=%EB%B0%B0%EB%82%AD%EC%97%AC%ED%96%85+%EB%AA%85%EC%86%8C&channel=user&component=list_vertical&source=user_component"; // μΏ ν‘ λ°°λμ¬ν λͺ
μ κ²μ λ§ν¬ (μμ)
|
240 |
+
}
|
241 |
+
// λ λ€μν κ²°κ³Ό μ‘°ν©μ μΆκ°ν μ μμ΅λλ€.
|
242 |
+
else {
|
243 |
+
result = "λΉμ μκ²λ λ€μ±λ‘μ΄ κ²½νμ΄ κ°λν μ¬νμ΄ μ΄μΈλ¦½λλ€! π";
|
244 |
+
coupangLink = "https://www.coupang.com/np/search?q=%ED%95%B4%EC%99%B8%EC%97%AC%ED%96%85&channel=user&component=list_vertical&source=user_component"; // μΏ ν‘ ν΄μΈμ¬ν μΉ΄ν
κ³ λ¦¬ λ§ν¬ (μμ)
|
245 |
+
}
|
246 |
+
|
247 |
+
|
248 |
+
resultTextElement.innerText = result;
|
249 |
+
coupangLinkElement.href = coupangLink; // μΏ ν‘ λ§ν¬ μ€μ
|
250 |
+
|
251 |
+
resultElement.style.display = 'block'; // κ²°κ³Ό 컨ν
μ΄λ νμ
|
252 |
+
}
|
253 |
+
|
254 |
+
</script>
|
255 |
+
|
256 |
+
</body>
|
257 |
+
</html>
|