-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlove_result.html
More file actions
214 lines (200 loc) Β· 8.83 KB
/
love_result.html
File metadata and controls
214 lines (200 loc) Β· 8.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>μ¬λμ ν κ²μ¬ κ²°κ³Ό</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body
class="bg-gradient-to-b from-pink-50 via-pink-100 to-rose-50 text-gray-800 font-sans"
>
<div class="max-w-5xl mx-auto px-5 py-10">
<!-- ν€λ -->
<header class="mb-6 text-center">
<h1 class="text-3xl md:text-4xl font-extrabold text-pink-700">
π μ¬λμ ν κ²μ¬ κ²°κ³Ό
</h1>
<p class="mt-2 text-sm text-pink-700">
μ νλ³ μ μμ μ€λͺ
μ νμΈνμΈμ. (κ° μ ν μ΅λ 12μ )
</p>
</header>
<!-- TOP λ°°μ§ -->
<div id="topBadge" class="hidden mb-4 text-center">
<span
class="inline-flex items-center gap-2 rounded-full bg-pink-100 px-4 py-1.5 text-sm font-semibold text-pink-700 border border-pink-200"
>
π μ΅κ³ μ ν: <span id="topTypesText"></span>
</span>
</div>
<section
class="rounded-xl border border-gray-300 overflow-hidden shadow-sm bg-white"
>
<div class="bg-black text-white px-4 py-2 font-semibold text-sm">
μ¬λμ ν κ²°κ³Όν
</div>
<div class="divide-y divide-gray-200" id="resultRows"></div>
</section>
<div class="mt-6 flex flex-wrap gap-3">
<button
id="copyBtn"
class="rounded-xl border border-gray-300 bg-white px-4 py-2 text-sm hover:bg-gray-50"
>
κ²°κ³Ό 볡μ¬
</button>
<a
href="test2.html"
class="rounded-xl bg-pink-500 text-white px-4 py-2 text-sm font-semibold hover:bg-pink-600"
>λ€μ κ²μ¬</a
>
<a
href="index.html"
class="rounded-xl border border-gray-300 bg-white px-4 py-2 text-sm hover:bg-gray-50"
>κ²μ¬ μ νμΌλ‘</a
>
</div>
</div>
<script>
const TYPE_INFO = {
coworker: {
ko: "λλ£μ μ¬λ",
latin: "Storge",
bullets: [
"μΉκ΅¬μκ²μ λλΌλ μ°μ κ°μ μ¬λ",
"μ¬λμ λ§μ μκ°κ³Ό νλμ 곡μ νλ νΉλ³ν μ°μ μ΄λΌκ³ κΈ°λν¨",
"μλλ°©μ λν λ¨κ±°μ΄ μ΄μ 보λ€λ μΌμμ μΈ νμ μ΄ κ°μ
λμ§λ μμΌλ κΉμ μ λ’°μ μ‘΄μ€μ λ°νμ λ ",
"μ) νμλμ μΈμμ ννλ₯Ό ν¨κ» ν€μ³ μ¨ λλ°μ κ°μ μ¬λ",
],
},
altruistic: {
ko: "μ΄νμ μ¬λ",
latin: "Agape",
bullets: [
"무쑰건μ μ΄κ³ νμ μ μΌλ‘ νμΈμ μνκ³ λ³΄μ΄νΌλ μ¬λ",
"쑰건μμ΄ μ’μνκ³ λλ΄μ£Όλ©°, μ©μνκ³ λ² νμ΄μ£Όλ μκΈ° ν¬μμ μ¬λ",
"μ§μ ν μ¬λμ΄λ λ°λ κ²μ΄ μλλΌ μ£Όλ κ²μ΄λΌκ³ μκ°νλ νΈ",
"μ¬λμ 쑰건μ μλκ° μμ μ μΌλ§λ νμλ‘ νλλμ΄κΈ° λλ¬Έμ, λ μ΄μ μλκ° μμ μ νμλ‘ νμ§ μλλ€κ³ νμ νλ©΄ μ¬λμ΄ λλ¨",
"μ) μ μ μ¬λ, λΆλͺ¨μ μ¬λ",
],
},
logical: {
ko: "λ
Όλ¦¬μ μ¬λ",
latin: "Pragma",
bullets: [
"νλͺ
νκ² μ¬λμ νλ €λ μ¬λλ€μ μ¬λ",
"μμ μ΄ μ΄λ€ μ νμ μλλ₯Ό μ νΈνλ κΈ°μ€μ΄ ꡬ체μ μΌ λΏλ§ μλλΌ μκΈ° μμ μ κ°μ κ³Ό μ½μ λ μΆ©λΆν κ³ λ €νκ³ μμ",
"λ
Όλ¦¬μ μ¬λμ νλ μ¬λμ΄λΌκ³ ν΄μ λλ§μ κ°μΉλ₯Ό μ ν μΈμ νμ§ μλ κ²μ μλ",
"μ) μ μ΄λ μ€λ§€λ₯Ό ν΅ν΄ μμ μκ² μ ν©ν 쑰건μ μ§λ μλλ₯Ό λ§λκ³ μ¬λνκ² λ¨",
],
},
possessive: {
ko: "μμ μ μ¬λ",
latin: "Mania",
bullets: [
"μ¬λμ΄λ μλλ°©μ μμ ν μμ νλ κ²μ΄λΌκ³ μκ°νλ λμμ μλλ‘λΆν° λ΄κ° μμ λΉνλ κ²μ΄λΌκ³ μκ°νλ μ ν",
"μ¬λν μλ‘ λλ €μν¨ β μ¬λμ νκ²Ήκ³ κ³ ν΅μ€λ½λ€κ³ μ¬κΉ",
"μ¬λμ μ»κΈ° μν΄ νμ€μ μΈ λ
Έλ ₯μ κΈ°μΈμ",
"μλλ₯Ό λ§€μΌ λ§λλ κ²μ ν΅ν΄ ν볡μ λλ",
"μ’
μ’
μμ κ³Ό μλλ°©μ λ―Έλ λͺ¨μ΅μ μμνκΈ°λ ν¨",
],
},
romantic: {
ko: "λλ§μ μ¬λ",
latin: "Eros",
bullets: [
"λ¨κ±°μ΄ μ΄μ μ΄ μ€μν μμκ° λλ κ°λ ¬ν μ¬λ",
"μ¬λμ μμν κ²μ΄λΌλ μ λ
, μ¬λνλ μ¬λμ λν κ³μμ μΈ μκ°, μ¬λμ μν΄ λ¬΄μμ΄λ νλ €λ μΆ©λμ΄ κ°μ
λ¨",
"λλ§μ μ¬λμ κΏκΎΈλ μ¬λμ μμ λ λν μ μ£ΌμΈκ³΅μ²λΌ μκΈ°λ₯Ό μν¨",
"μΈμμμ λλ§μ μ΄κ³ μ΄μ μ μΈ μ¬λμ΄ κ°μ₯ μ€μνλ€κ³ λ―Ώμ",
"μ) λ‘λ―Έμ€μ μ€λ¦¬μ£μ μ¬λ",
],
},
playful: {
ko: "μ ν¬μ μ¬λ",
latin: "Ludus",
bullets: [
"λμ΄μ κ°μ΄ μ¬λ―Έμ μΎλ½μ μ€μμνλ μ¬λ",
"μ¬λμ μ¦κΈ°κΈ° μν λμ , μ΄κΈ°κΈ° μν μν©μΌλ‘ μ¬κΈ°κΈ°λ ν¨",
"μ¬λμ νμ λ³΄λ€ μ¬λ―Έλ₯Ό μν κ², κ΄κ³μ κ°μ₯ μ€μν κ²μΌλ‘ λ³΄μ§ μλ νΈ",
"μ¬λ¬ λͺ
μ ννΈλλ₯Ό λ‘κ±°λ λμμ μ¬λνλ κ²μ μμ¬μ κ°μ±
μ λλΌμ§ μμ",
"μ) μμ μ νΈ, μμ΄μ€λΈλ μ΄νΉμ μμ
μ μ¬λμ λν μ νΈμ λ€μμ±",
],
},
};
const ORDER = [
"coworker",
"altruistic",
"logical",
"possessive",
"romantic",
"playful",
];
const params = new URLSearchParams(location.search);
const scores = Object.fromEntries(
ORDER.map((k) => [k, Number(params.get(k) || 0)])
);
const maxScore = Math.max(...Object.values(scores));
const topTypes = ORDER.filter(
(k) => scores[k] === maxScore && maxScore > 0
);
if (topTypes.length) {
document.getElementById("topTypesText").textContent = topTypes
.map((k) => `${TYPE_INFO[k].ko}`)
.join(", ");
document.getElementById("topBadge").classList.remove("hidden");
}
const rows = document.getElementById("resultRows");
ORDER.forEach((k) => {
const info = TYPE_INFO[k];
const score = scores[k];
const isTop = score === maxScore && maxScore > 0;
const row = document.createElement("div");
row.className = `grid grid-cols-[10rem_1fr_5rem] items-stretch ${
isTop ? "bg-pink-50 ring-2 ring-pink-300" : ""
}`;
const left = document.createElement("div");
left.className = "px-3 py-4 border-r border-gray-200 bg-gray-50";
left.innerHTML = `<div class="font-bold text-gray-800">${info.ko}</div>
<div class="text-xs text-gray-500">${info.latin}</div>`;
const mid = document.createElement("div");
mid.className = "px-4 py-3";
const ul = document.createElement("ul");
ul.className = "list-disc pl-5 leading-7 text-sm";
info.bullets.forEach((t) => {
const li = document.createElement("li");
li.textContent = t;
ul.appendChild(li);
});
mid.appendChild(ul);
const right = document.createElement("div");
right.className =
"relative px-3 py-3 border-l border-gray-200 text-right";
const topBadge = isTop
? '<span class="absolute -top-2 -right-2 inline-flex items-center rounded-full bg-pink-500 text-white text-[10px] px-2 py-0.5 shadow">TOP</span>'
: "";
right.innerHTML = `${topBadge}
<div class="text-[11px] text-gray-400">μ </div>
<div class="text-xl font-extrabold">${score}</div>
<div class="mt-2 h-2 rounded bg-gray-100 overflow-hidden">
<div class="h-full bg-gradient-to-r from-pink-300 to-rose-400" style="width: ${
(score / 12) * 100
}%"></div>
</div>`;
row.appendChild(left);
row.appendChild(mid);
row.appendChild(right);
rows.appendChild(row);
});
document.getElementById("copyBtn").addEventListener("click", async () => {
const lines = ORDER.map((k) => `${TYPE_INFO[k].ko}: ${scores[k]}`);
const topLine = topTypes.length
? `\nμ΅κ³ μ ν: ${topTypes.map((k) => TYPE_INFO[k].ko).join(", ")}`
: "";
const text = "μ¬λμ ν κ²μ¬ κ²°κ³Ό\n" + lines.join("\n") + topLine;
try {
await navigator.clipboard.writeText(text);
} catch (e) {}
});
</script>
</body>
</html>