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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="zh-CN">
|
| 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 |
+
* {
|
| 9 |
+
margin: 0;
|
| 10 |
+
padding: 0;
|
| 11 |
+
box-sizing: border-box;
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
body {
|
| 15 |
+
font-family: 'Microsoft YaHei', sans-serif;
|
| 16 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 17 |
+
min-height: 100vh;
|
| 18 |
+
padding: 20px;
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
.container {
|
| 22 |
+
max-width: 1200px;
|
| 23 |
+
margin: 0 auto;
|
| 24 |
+
display: grid;
|
| 25 |
+
grid-template-columns: 1fr 1fr;
|
| 26 |
+
gap: 30px;
|
| 27 |
+
align-items: start;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
.analyzer-panel, .history-panel {
|
| 31 |
+
background: rgba(255, 255, 255, 0.95);
|
| 32 |
+
backdrop-filter: blur(10px);
|
| 33 |
+
border-radius: 20px;
|
| 34 |
+
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
|
| 35 |
+
padding: 30px;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
.title {
|
| 39 |
+
font-size: 2.2em;
|
| 40 |
+
color: #333;
|
| 41 |
+
margin-bottom: 10px;
|
| 42 |
+
background: linear-gradient(45deg, #667eea, #764ba2);
|
| 43 |
+
-webkit-background-clip: text;
|
| 44 |
+
-webkit-text-fill-color: transparent;
|
| 45 |
+
font-weight: bold;
|
| 46 |
+
text-align: center;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
.subtitle {
|
| 50 |
+
color: #666;
|
| 51 |
+
margin-bottom: 30px;
|
| 52 |
+
font-size: 1em;
|
| 53 |
+
text-align: center;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
.input-section {
|
| 57 |
+
margin-bottom: 30px;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
.input-group {
|
| 61 |
+
position: relative;
|
| 62 |
+
margin-bottom: 20px;
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
input[type="text"] {
|
| 66 |
+
width: 100%;
|
| 67 |
+
padding: 15px 20px;
|
| 68 |
+
font-size: 1.1em;
|
| 69 |
+
border: 2px solid #e0e0e0;
|
| 70 |
+
border-radius: 15px;
|
| 71 |
+
outline: none;
|
| 72 |
+
transition: all 0.3s ease;
|
| 73 |
+
background: rgba(255, 255, 255, 0.8);
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
input[type="text"]:focus {
|
| 77 |
+
border-color: #667eea;
|
| 78 |
+
box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
.analyze-btn {
|
| 82 |
+
background: linear-gradient(45deg, #667eea, #764ba2);
|
| 83 |
+
color: white;
|
| 84 |
+
border: none;
|
| 85 |
+
padding: 15px 40px;
|
| 86 |
+
font-size: 1.2em;
|
| 87 |
+
border-radius: 25px;
|
| 88 |
+
cursor: pointer;
|
| 89 |
+
transition: all 0.3s ease;
|
| 90 |
+
box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
|
| 91 |
+
width: 100%;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
.analyze-btn:hover {
|
| 95 |
+
transform: translateY(-2px);
|
| 96 |
+
box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
.result-section {
|
| 100 |
+
margin-top: 30px;
|
| 101 |
+
padding: 25px;
|
| 102 |
+
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
|
| 103 |
+
border-radius: 15px;
|
| 104 |
+
display: none;
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
.score-display {
|
| 108 |
+
font-size: 2.5em;
|
| 109 |
+
font-weight: bold;
|
| 110 |
+
color: #333;
|
| 111 |
+
margin-bottom: 15px;
|
| 112 |
+
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
|
| 113 |
+
text-align: center;
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
.fortune-type {
|
| 117 |
+
font-size: 1.2em;
|
| 118 |
+
color: #667eea;
|
| 119 |
+
margin-bottom: 20px;
|
| 120 |
+
font-weight: bold;
|
| 121 |
+
text-align: center;
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
.analysis-details {
|
| 125 |
+
text-align: left;
|
| 126 |
+
background: white;
|
| 127 |
+
padding: 20px;
|
| 128 |
+
border-radius: 10px;
|
| 129 |
+
margin-top: 15px;
|
| 130 |
+
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
.detail-item {
|
| 134 |
+
margin-bottom: 10px;
|
| 135 |
+
padding: 8px 0;
|
| 136 |
+
border-bottom: 1px solid #f0f0f0;
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
.detail-label {
|
| 140 |
+
font-weight: bold;
|
| 141 |
+
color: #333;
|
| 142 |
+
display: inline-block;
|
| 143 |
+
width: 60px;
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
.detail-value {
|
| 147 |
+
color: #666;
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
.fortune-desc {
|
| 151 |
+
margin-top: 15px;
|
| 152 |
+
padding: 15px;
|
| 153 |
+
background: linear-gradient(45deg, #ffeaa7, #fab1a0);
|
| 154 |
+
border-radius: 10px;
|
| 155 |
+
color: #2d3436;
|
| 156 |
+
font-style: italic;
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
/* 历史记录样式 */
|
| 160 |
+
.history-title {
|
| 161 |
+
font-size: 1.8em;
|
| 162 |
+
color: #333;
|
| 163 |
+
margin-bottom: 20px;
|
| 164 |
+
text-align: center;
|
| 165 |
+
background: linear-gradient(45deg, #667eea, #764ba2);
|
| 166 |
+
-webkit-background-clip: text;
|
| 167 |
+
-webkit-text-fill-color: transparent;
|
| 168 |
+
font-weight: bold;
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
.history-table {
|
| 172 |
+
width: 100%;
|
| 173 |
+
border-collapse: collapse;
|
| 174 |
+
background: white;
|
| 175 |
+
border-radius: 10px;
|
| 176 |
+
overflow: hidden;
|
| 177 |
+
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
.history-table th,
|
| 181 |
+
.history-table td {
|
| 182 |
+
padding: 12px 15px;
|
| 183 |
+
text-align: left;
|
| 184 |
+
border-bottom: 1px solid #f0f0f0;
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
.history-table th {
|
| 188 |
+
background: linear-gradient(45deg, #667eea, #764ba2);
|
| 189 |
+
color: white;
|
| 190 |
+
font-weight: bold;
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
.history-table tr:hover {
|
| 194 |
+
background: #f8f9ff;
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
.score-cell {
|
| 198 |
+
font-weight: bold;
|
| 199 |
+
font-size: 1.2em;
|
| 200 |
+
color: #667eea;
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
.fortune-cell {
|
| 204 |
+
font-size: 0.9em;
|
| 205 |
+
padding: 4px 8px;
|
| 206 |
+
border-radius: 15px;
|
| 207 |
+
color: white;
|
| 208 |
+
text-align: center;
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
.fortune-great { background: linear-gradient(45deg, #ff6b6b, #ee5a52); }
|
| 212 |
+
.fortune-good { background: linear-gradient(45deg, #4ecdc4, #44a08d); }
|
| 213 |
+
.fortune-normal { background: linear-gradient(45deg, #45b7d1, #96c93d); }
|
| 214 |
+
.fortune-average { background: linear-gradient(45deg, #f9ca24, #f0932b); }
|
| 215 |
+
.fortune-poor { background: linear-gradient(45deg, #eb4d4b, #6c5ce7); }
|
| 216 |
+
|
| 217 |
+
.pagination {
|
| 218 |
+
margin-top: 20px;
|
| 219 |
+
display: flex;
|
| 220 |
+
justify-content: center;
|
| 221 |
+
align-items: center;
|
| 222 |
+
gap: 10px;
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
.pagination button {
|
| 226 |
+
padding: 8px 15px;
|
| 227 |
+
border: 1px solid #ddd;
|
| 228 |
+
background: white;
|
| 229 |
+
color: #666;
|
| 230 |
+
border-radius: 8px;
|
| 231 |
+
cursor: pointer;
|
| 232 |
+
transition: all 0.3s ease;
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
.pagination button:hover {
|
| 236 |
+
background: #667eea;
|
| 237 |
+
color: white;
|
| 238 |
+
border-color: #667eea;
|
| 239 |
+
}
|
| 240 |
+
|
| 241 |
+
.pagination button.active {
|
| 242 |
+
background: #667eea;
|
| 243 |
+
color: white;
|
| 244 |
+
border-color: #667eea;
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
.pagination button:disabled {
|
| 248 |
+
opacity: 0.5;
|
| 249 |
+
cursor: not-allowed;
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
.pagination button:disabled:hover {
|
| 253 |
+
background: white;
|
| 254 |
+
color: #666;
|
| 255 |
+
border-color: #ddd;
|
| 256 |
+
}
|
| 257 |
+
|
| 258 |
+
.page-info {
|
| 259 |
+
color: #666;
|
| 260 |
+
font-size: 0.9em;
|
| 261 |
+
}
|
| 262 |
+
|
| 263 |
+
@keyframes fadeInUp {
|
| 264 |
+
from {
|
| 265 |
+
opacity: 0;
|
| 266 |
+
transform: translateY(30px);
|
| 267 |
+
}
|
| 268 |
+
to {
|
| 269 |
+
opacity: 1;
|
| 270 |
+
transform: translateY(0);
|
| 271 |
+
}
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
.result-section.show {
|
| 275 |
+
display: block;
|
| 276 |
+
animation: fadeInUp 0.6s ease;
|
| 277 |
+
}
|
| 278 |
+
|
| 279 |
+
@media (max-width: 768px) {
|
| 280 |
+
.container {
|
| 281 |
+
grid-template-columns: 1fr;
|
| 282 |
+
gap: 20px;
|
| 283 |
+
}
|
| 284 |
+
|
| 285 |
+
.title {
|
| 286 |
+
font-size: 1.8em;
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
.history-table {
|
| 290 |
+
font-size: 0.9em;
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
.history-table th,
|
| 294 |
+
.history-table td {
|
| 295 |
+
padding: 8px 10px;
|
| 296 |
+
}
|
| 297 |
+
}
|
| 298 |
+
</style>
|
| 299 |
+
</head>
|
| 300 |
+
<body>
|
| 301 |
+
<div class="container">
|
| 302 |
+
<!-- 分析面板 -->
|
| 303 |
+
<div class="analyzer-panel">
|
| 304 |
+
<h1 class="title">姓名评分</h1>
|
| 305 |
+
<p class="subtitle">基于传统命理学的姓名分析</p>
|
| 306 |
+
|
| 307 |
+
<div class="input-section">
|
| 308 |
+
<div class="input-group">
|
| 309 |
+
<input type="text" id="nameInput" placeholder="请输入您的姓名" maxlength="10">
|
| 310 |
+
</div>
|
| 311 |
+
<button class="analyze-btn" onclick="analyzeName()">开始分析</button>
|
| 312 |
+
</div>
|
| 313 |
+
|
| 314 |
+
<div class="result-section" id="resultSection">
|
| 315 |
+
<div class="score-display" id="scoreDisplay">85</div>
|
| 316 |
+
<div class="fortune-type" id="fortuneType">富贵命</div>
|
| 317 |
+
|
| 318 |
+
<div class="analysis-details">
|
| 319 |
+
<div class="detail-item">
|
| 320 |
+
<span class="detail-label">天格:</span>
|
| 321 |
+
<span class="detail-value" id="tianGe">12</span>
|
| 322 |
+
</div>
|
| 323 |
+
<div class="detail-item">
|
| 324 |
+
<span class="detail-label">人格:</span>
|
| 325 |
+
<span class="detail-value" id="renGe">23</span>
|
| 326 |
+
</div>
|
| 327 |
+
<div class="detail-item">
|
| 328 |
+
<span class="detail-label">地格:</span>
|
| 329 |
+
<span class="detail-value" id="diGe">18</span>
|
| 330 |
+
</div>
|
| 331 |
+
<div class="detail-item">
|
| 332 |
+
<span class="detail-label">总格:</span>
|
| 333 |
+
<span class="detail-value" id="zongGe">30</span>
|
| 334 |
+
</div>
|
| 335 |
+
<div class="detail-item">
|
| 336 |
+
<span class="detail-label">外格:</span>
|
| 337 |
+
<span class="detail-value" id="waiGe">7</span>
|
| 338 |
+
</div>
|
| 339 |
+
</div>
|
| 340 |
+
|
| 341 |
+
<div class="fortune-desc" id="fortuneDesc">
|
| 342 |
+
此名五行搭配和谐,天人地三才相生,预示着事业有成���财运亨通。
|
| 343 |
+
</div>
|
| 344 |
+
</div>
|
| 345 |
+
</div>
|
| 346 |
+
|
| 347 |
+
<!-- 历史记录面板 -->
|
| 348 |
+
<div class="history-panel">
|
| 349 |
+
<h2 class="history-title">姓名评分记录</h2>
|
| 350 |
+
|
| 351 |
+
<table class="history-table">
|
| 352 |
+
<thead>
|
| 353 |
+
<tr>
|
| 354 |
+
<th>姓名</th>
|
| 355 |
+
<th>分数</th>
|
| 356 |
+
<th>命格</th>
|
| 357 |
+
</tr>
|
| 358 |
+
</thead>
|
| 359 |
+
<tbody id="historyTableBody">
|
| 360 |
+
<!-- 数据将通过JavaScript动态填充 -->
|
| 361 |
+
</tbody>
|
| 362 |
+
</table>
|
| 363 |
+
|
| 364 |
+
<div class="pagination" id="pagination">
|
| 365 |
+
<!-- 分页控件将通过JavaScript动态生成 -->
|
| 366 |
+
</div>
|
| 367 |
+
</div>
|
| 368 |
+
</div>
|
| 369 |
+
|
| 370 |
+
<script>
|
| 371 |
+
let nameHistory = [];
|
| 372 |
+
|
| 373 |
+
const strokeMap = {
|
| 374 |
+
// 基本数字
|
| 375 |
+
'一': 1, '二': 2, '三': 3, '四': 4, '五': 5, '六': 6, '七': 7, '八': 8, '九': 9, '十': 2,
|
| 376 |
+
'零': 13, '百': 6, '千': 3, '万': 15, '亿': 3,
|
| 377 |
+
|
| 378 |
+
// 常见姓氏(扩展)
|
| 379 |
+
'王': 4, '李': 7, '张': 11, '刘': 15, '陈': 16, '杨': 13, '赵': 14, '黄': 12, '周': 8,
|
| 380 |
+
'吴': 7, '徐': 10, '孙': 10, '胡': 9, '朱': 6, '高': 10, '林': 8, '何': 7, '郭': 15,
|
| 381 |
+
'马': 10, '罗': 19, '梁': 11, '宋': 7, '郑': 19, '谢': 17, '韩': 17, '唐': 10, '冯': 12,
|
| 382 |
+
'于': 3, '董': 15, '萧': 18, '程': 12, '曹': 11, '袁': 10, '邓': 19, '许': 11, '傅': 12,
|
| 383 |
+
'沈': 7, '曾': 12, '彭': 12, '吕': 6, '苏': 22, '卢': 16, '蒋': 17, '蔡': 17, '贾': 13,
|
| 384 |
+
'丁': 2, '魏': 18, '薛': 19, '叶': 15, '阎': 16, '余': 7, '潘': 16, '杜': 7, '戴': 18,
|
| 385 |
+
'夏': 10, '钟': 17, '汪': 8, '田': 5, '任': 6, '姜': 9, '范': 15, '方': 4, '石': 5,
|
| 386 |
+
'秦': 10, '江': 7, '顾': 21, '史': 5, '侯': 9, '邵': 12, '孟': 8, '龙': 16,
|
| 387 |
+
'段': 9, '雷': 13, '钱': 16, '汤': 13, '尹': 4, '黎': 15, '易': 8, '常': 11, '武': 8,
|
| 388 |
+
'乔': 12, '贺': 12, '赖': 16, '龚': 22, '文': 4, '庞': 19, '樊': 15, '兰': 23, '殷': 10,
|
| 389 |
+
'温': 13, '包': 5, '左': 5, '右': 5, '司': 5, '上': 3, '欧': 15,
|
| 390 |
+
'牛': 4, '车': 7, '白': 5, '葛': 15, '严': 20, '苗': 11, '鲁': 15, '韦': 9, '昌': 8,
|
| 391 |
+
'卞': 4, '邹': 17, '单': 12, '云': 12, '窦': 20, '章': 11, '鲍': 17,
|
| 392 |
+
'费': 12, '倪': 10, '甘': 5, '季': 8, '贝': 7, '管': 14, '鞠': 17, '房': 8, '裘': 13,
|
| 393 |
+
|
| 394 |
+
// 常见名字用字(大幅扩展)
|
| 395 |
+
'明': 8, '华': 14, '军': 9, '建': 9, '国': 11, '强': 12, '伟': 11, '新': 13,
|
| 396 |
+
'志': 7, '勇': 9, '毅': 15, '俊': 9, '峰': 10, '刚': 10, '海': 11, '亮': 9,
|
| 397 |
+
'敏': 11, '梅': 11, '凤': 14, '洁': 16, '芳': 10, '燕': 16, '红': 9, '丽': 19,
|
| 398 |
+
'美': 9, '娜': 10, '静': 16, '欣': 8, '飞': 9, '雪': 11, '桂': 10, '英': 11, '莲': 17,
|
| 399 |
+
'虎': 8, '鹏': 19, '鸿': 17, '宇': 6, '辰': 7, '星': 9, '月': 4,
|
| 400 |
+
'阳': 17, '光': 6, '辉': 15, '磊': 15, '鑫': 24, '淼': 12, '森': 12, '焱': 12, '垚': 9,
|
| 401 |
+
'琳': 13, '瑶': 15, '珊': 10, '莎': 13, '娟': 10, '秀': 7, '娇': 15, '艳': 24, '芬': 10,
|
| 402 |
+
'婷': 12, '颖': 16, '慧': 15, '巧': 5, '淑': 12, '惠': 12,
|
| 403 |
+
'珠': 11, '翠': 14, '雅': 12, '芝': 10, '玉': 5, '萍': 14, '娥': 10, '玲': 10,
|
| 404 |
+
'彩': 11, '春': 9, '菊': 14,
|
| 405 |
+
|
| 406 |
+
// 品德相关字
|
| 407 |
+
'诚': 14, '信': 9, '义': 13, '礼': 18, '智': 12, '仁': 4, '勤': 13, '俭': 15, '廉': 13,
|
| 408 |
+
'孝': 7, '悌': 11, '忠': 8, '恕': 10, '恒': 10, '谦': 17, '和': 8, '善': 12, '慈': 14,
|
| 409 |
+
'爱': 13, '德': 15, '行': 6, '修': 10, '养': 15, '品': 9, '格': 10, '操': 16, '节': 13,
|
| 410 |
+
|
| 411 |
+
// 成功事业相关字
|
| 412 |
+
'成': 7, '功': 5, '业': 13, '就': 12, '达': 16, '兴': 16, '旺': 8, '盛': 12,
|
| 413 |
+
'荣': 14, '贵': 12, '权': 22, '势': 13, '威': 9, '名': 6, '声': 17,
|
| 414 |
+
'誉': 21, '望': 11, '才': 4, '能': 10, '干': 3, '展': 10, '创': 12, '进': 15,
|
| 415 |
+
'取': 8, '拼': 10, '搏': 14, '奋': 16, '斗': 4, '争': 8, '胜': 12, '赢': 20, '超': 12,
|
| 416 |
+
|
| 417 |
+
// 自然元素
|
| 418 |
+
'天': 4, '地': 6, '山': 3, '水': 4, '火': 4, '木': 4, '金': 8, '土': 3,
|
| 419 |
+
'风': 9, '雨': 8, '电': 13, '霜': 17, '冰': 6, '雾': 19,
|
| 420 |
+
'日': 4, '照': 13,
|
| 421 |
+
'河': 9, '湖': 13, '泉': 9, '溪': 14, '流': 10, '波': 9, '涛': 18,
|
| 422 |
+
'树': 16, '花': 8, '草': 12, '根': 10, '枝': 8, '果': 8,
|
| 423 |
+
|
| 424 |
+
// 颜色相关
|
| 425 |
+
'橙': 16, '绿': 14, '青': 8, '蓝': 20, '紫': 12, '黑': 12,
|
| 426 |
+
'灰': 6, '银': 14, '色': 6, '暗': 13, '淡': 12, '浓': 16,
|
| 427 |
+
|
| 428 |
+
// 动��相关
|
| 429 |
+
'狮': 13, '豹': 10, '鹰': 24, '雁': 12, '鸽': 17,
|
| 430 |
+
'鹤': 21, '鹿': 11, '羊': 6, '猪': 11, '狗': 8, '猫': 16, '兔': 8,
|
| 431 |
+
'鱼': 11, '鸟': 11, '蝶': 15, '蜂': 13, '龟': 16, '蛇': 11, '鼠': 13, '猴': 12, '鸡': 18,
|
| 432 |
+
|
| 433 |
+
// 植物相关
|
| 434 |
+
'松': 8, '柏': 9, '竹': 6, '荷': 13,
|
| 435 |
+
'桃': 10, '杏': 7, '枣': 8, '柿': 9, '橘': 16, '苹': 22, '梨': 11, '葡': 15,
|
| 436 |
+
'萄': 15, '茎': 11, '实': 14,
|
| 437 |
+
|
| 438 |
+
// 时间相关
|
| 439 |
+
'秋': 9, '冬': 5, '年': 6, '时': 10, '分': 4,
|
| 440 |
+
'秒': 9, '刻': 8, '瞬': 18, '永': 5, '久': 3, '短': 12, '慢': 14,
|
| 441 |
+
'早': 6, '晚': 11, '今': 4, '昔': 8, '古': 5, '老': 6, '少': 4, '幼': 5,
|
| 442 |
+
|
| 443 |
+
// 方位相关
|
| 444 |
+
'南': 9, '西': 6, '北': 5, '中': 4, '下': 3,
|
| 445 |
+
'前': 9, '内': 4, '外': 5, '里': 7, '表': 8, '远': 17, '近': 11, '高': 10,
|
| 446 |
+
'低': 7, '深': 12, '浅': 12, '宽': 15, '窄': 10, '大': 3, '小': 3,
|
| 447 |
+
|
| 448 |
+
// 情感相关
|
| 449 |
+
'恨': 9, '怒': 9, '哀': 9, '乐': 15, '悲': 12, '欢': 22, '愁': 13,
|
| 450 |
+
'忧': 7, '思': 9, '念': 8, '想': 13, '盼': 9, '愿': 14, '希': 7, '求': 7,
|
| 451 |
+
'得': 11, '失': 5, '来': 8, '去': 5, '归': 18, '离': 18, '聚': 14, '散': 12, '合': 6,
|
| 452 |
+
|
| 453 |
+
// 学习工作相关
|
| 454 |
+
'习': 11, '读': 14, '写': 15, '画': 12, '唱': 11, '跳': 13, '演': 14,
|
| 455 |
+
'讲': 17, '说': 14, '话': 13, '语': 14, '言': 7, '词': 12, '句': 5,
|
| 456 |
+
'字': 6, '笔': 10, '纸': 10, '墨': 15, '砚': 9, '琴': 13, '棋': 12, '诗': 13,
|
| 457 |
+
|
| 458 |
+
// 身体部位
|
| 459 |
+
'头': 16, '脸': 17, '眼': 11, '耳': 6, '鼻': 14, '嘴': 16, '牙': 4, '舌': 6, '手': 4,
|
| 460 |
+
'脚': 13, '心': 4, '肝': 7, '肺': 9, '肾': 8, '脑': 10, '血': 6, '肉': 6, '骨': 10,
|
| 461 |
+
'皮': 5, '毛': 4, '发': 12, '须': 12, '眉': 9, '睫': 13, '指': 9, '掌': 12,
|
| 462 |
+
|
| 463 |
+
// 特殊字符(原有的保留和补充)
|
| 464 |
+
'卫': 15, '广': 15, '印': 6, '耀': 20, '正': 5, '午': 7, '宝': 20, '宏': 7,
|
| 465 |
+
'羽': 6, '凡': 3, '长': 8, '彦': 9, '传': 13, '庆': 15, '后': 9, '健': 11,
|
| 466 |
+
'甫': 7, '伯': 7, '仲': 6, '叔': 8, '季': 8, '纯': 10, '良': 7, '嘉': 14, '哲': 10,
|
| 467 |
+
'瑞': 14, '祥': 11, '吉': 6, '泰': 10, '安': 6, '平': 5, '顺': 12, '通': 14,
|
| 468 |
+
'康': 11, '宁': 14, '寿': 14, '福': 14, '禄': 13, '禧': 17, '祺': 13, '祯': 14,
|
| 469 |
+
|
| 470 |
+
// 数量和量词
|
| 471 |
+
'个': 10, '只': 5, '匹': 4, '条': 11, '支': 4, '把': 7, '件': 6,
|
| 472 |
+
'套': 10, '双': 4, '对': 14, '副': 11, '群': 13, '批': 7, '些': 8, '点': 9, '滴': 14,
|
| 473 |
+
|
| 474 |
+
// 常用动词扩展
|
| 475 |
+
'是': 9, '有': 6, '在': 6, '了': 2, '着': 11, '过': 12, '出': 5,
|
| 476 |
+
'到': 8, '开': 12, '关': 19, '放': 8, '拿': 10, '给': 12, '让': 24,
|
| 477 |
+
'叫': 5, '听': 22, '看': 9, '知': 8, '道': 16, '会': 13, '要': 9,
|
| 478 |
+
'用': 5, '作': 7, '做': 11, '为': 9, '被': 11, '从': 11, '向': 6,
|
| 479 |
+
'跟': 13, '与': 14, '于': 3, '按': 10, '依': 8,
|
| 480 |
+
'兮': 4, '之': 4, '乎': 5, '者': 10, '也': 3, '矣': 7, '哉': 9, '焉': 11, '然': 12, // 虚词
|
| 481 |
+
'子': 3, '涵': 12, '轩': 10, '梓': 11, '睿': 14, '浩': 11, '诺': 16, '伊': 6, // 现代常用名
|
| 482 |
+
'琪': 13, '辰': 7, '皓': 12, '沐': 8, '宸': 10, '萱': 15, '泽': 17, '怡': 9, '彤': 7
|
| 483 |
+
};
|
| 484 |
+
|
| 485 |
+
// This defaultHistoryData is from your original code.
|
| 486 |
+
// If the calculateScore function below does not perfectly match
|
| 487 |
+
// the *exact* logic that generated these scores, there will be discrepancies.
|
| 488 |
+
const defaultHistoryData = [
|
| 489 |
+
{ name: '贾卫星', score: 77, type: '小康之家' }, { name: '罗广华', score: 70, type: '平凡人生' },
|
| 490 |
+
{ name: '刘印', score: 77, type: '小康之家' }, { name: '宋强', score: 76, type: '小康之家' },
|
| 491 |
+
{ name: '聂耀军', score: 77, type: '小康之家' }, { name: '张正午', score: 91, type: '富贵命' },
|
| 492 |
+
{ name: '孙宝华', score: 89, type: '富贵命' }, { name: '毛宏羽', score: 99, type: '大富大贵' },
|
| 493 |
+
{ name: '白超凡', score: 95, type: '大富大贵' }, { name: '李长安', score: 91, type: '富贵命' },
|
| 494 |
+
{ name: '王明华', score: 85, type: '富贵命' }, { name: '陈建国', score: 82, type: '富贵命' },
|
| 495 |
+
{ name: '张伟强', score: 78, type: '小康之家' }, { name: '刘德华', score: 88, type: '富贵命' },
|
| 496 |
+
{ name: '杨过', score: 92, type: '富贵命' }, { name: '赵云', score: 96, type: '大富大贵' },
|
| 497 |
+
{ name: '马云', score: 87, type: '富贵命' }, { name: '马化腾', score: 93, type: '大富大贵' },
|
| 498 |
+
{ name: '李彦宏', score: 89, type: '富贵命' }, { name: '任正非', score: 94, type: '大富大贵' },
|
| 499 |
+
{ name: '董明珠', score: 86, type: '富贵命' },
|
| 500 |
+
{ name: '柳传志', score: 90, type: '富贵命' },
|
| 501 |
+
{ name: '宗庆后', score: 88, type: '富贵命' }, { name: '王健林', score: 92, type: '富贵命' },
|
| 502 |
+
{ name: '许家印', score: 84, type: '富贵命' }
|
| 503 |
+
];
|
| 504 |
+
|
| 505 |
+
function initializeHistoryData() {
|
| 506 |
+
const storedData = localStorage.getItem('nameHistoryData');
|
| 507 |
+
if (storedData) {
|
| 508 |
+
try {
|
| 509 |
+
nameHistory = JSON.parse(storedData);
|
| 510 |
+
if (!Array.isArray(nameHistory) || nameHistory.length === 0) {
|
| 511 |
+
nameHistory = [...defaultHistoryData];
|
| 512 |
+
saveHistoryData();
|
| 513 |
+
}
|
| 514 |
+
} catch (e) {
|
| 515 |
+
console.error("Error parsing name history from localStorage:", e);
|
| 516 |
+
nameHistory = [...defaultHistoryData];
|
| 517 |
+
saveHistoryData();
|
| 518 |
+
}
|
| 519 |
+
} else {
|
| 520 |
+
nameHistory = [...defaultHistoryData];
|
| 521 |
+
saveHistoryData();
|
| 522 |
+
}
|
| 523 |
+
}
|
| 524 |
+
|
| 525 |
+
function saveHistoryData() {
|
| 526 |
+
try {
|
| 527 |
+
localStorage.setItem('nameHistoryData', JSON.stringify(nameHistory));
|
| 528 |
+
} catch (e) {
|
| 529 |
+
console.error("Error saving name history to localStorage:", e);
|
| 530 |
+
}
|
| 531 |
+
}
|
| 532 |
+
|
| 533 |
+
let currentPage = 1;
|
| 534 |
+
const itemsPerPage = 8;
|
| 535 |
+
|
| 536 |
+
const wuxingMap = {
|
| 537 |
+
1: '木', 2: '木', 3: '火', 4: '火', 5: '土', 6: '土', 7: '金', 8: '金', 9: '水', 0: '水'
|
| 538 |
+
};
|
| 539 |
+
|
| 540 |
+
const fortuneTypes = [
|
| 541 |
+
{ range: [90, 100], type: '大富大贵', desc: '天赋异禀,命中注定大富大贵,一生荣华富贵。', class: 'fortune-great' },
|
| 542 |
+
{ range: [80, 89], type: '富贵命', desc: '财运亨通,事业有成,生活富足安康。', class: 'fortune-good' },
|
| 543 |
+
{ range: [70, 79], type: '小康之家', desc: '生活安稳,衣食无忧,家庭和睦。', class: 'fortune-normal' },
|
| 544 |
+
{ range: [60, 69], type: '平凡人生', desc: '平平淡淡才是真,虽无大富大贵,但生活平安。', class: 'fortune-average' },
|
| 545 |
+
{ range: [50, 59], type: '需要努力', desc: '通过自身努力可以改善命运,坚持不懈必有收获。', class: 'fortune-poor' },
|
| 546 |
+
{ range: [0, 49], type: '多加修行', desc: '需要多做善事,修身养性,方能转运。', class: 'fortune-poor' }
|
| 547 |
+
];
|
| 548 |
+
|
| 549 |
+
function getStrokeCount(char) {
|
| 550 |
+
if (strokeMap[char] !== undefined) {
|
| 551 |
+
return strokeMap[char];
|
| 552 |
+
}
|
| 553 |
+
console.warn(`Stroke count not found for character: "${char}". Using fallback.`);
|
| 554 |
+
const charCode = char.charCodeAt(0);
|
| 555 |
+
return ((charCode % 15) + 5);
|
| 556 |
+
}
|
| 557 |
+
|
| 558 |
+
function getWuxing(num) {
|
| 559 |
+
return wuxingMap[num % 10];
|
| 560 |
+
}
|
| 561 |
+
|
| 562 |
+
// === YOUR ORIGINAL SCORING LOGIC (First Version) ===
|
| 563 |
+
function calculateScore(tianGe, renGe, diGe, zongGe, waiGe) {
|
| 564 |
+
let score = 50;
|
| 565 |
+
|
| 566 |
+
if (tianGe % 10 === 1 || tianGe % 10 === 3 || tianGe % 10 === 5 || tianGe % 10 === 8) {
|
| 567 |
+
score += 10;
|
| 568 |
+
}
|
| 569 |
+
|
| 570 |
+
if (renGe % 10 === 1 || renGe % 10 === 3 || renGe % 10 === 5 || renGe % 10 === 8) {
|
| 571 |
+
score += 15;
|
| 572 |
+
}
|
| 573 |
+
if (renGe >= 13 && renGe <= 16) score += 5;
|
| 574 |
+
if (renGe >= 21 && renGe <= 23) score += 8;
|
| 575 |
+
|
| 576 |
+
if (diGe % 10 === 1 || diGe % 10 === 3 || diGe % 10 === 5 || diGe % 10 === 8) {
|
| 577 |
+
score += 10;
|
| 578 |
+
}
|
| 579 |
+
|
| 580 |
+
if (zongGe % 10 === 1 || zongGe % 10 === 3 || zongGe % 10 === 5 || zongGe % 10 === 8) {
|
| 581 |
+
score += 10;
|
| 582 |
+
}
|
| 583 |
+
|
| 584 |
+
if (waiGe % 10 === 1 || waiGe % 10 === 3 || waiGe % 10 === 5 || waiGe % 10 === 8) {
|
| 585 |
+
score += 5;
|
| 586 |
+
}
|
| 587 |
+
|
| 588 |
+
const tianWuxing = getWuxing(tianGe);
|
| 589 |
+
const renWuxing = getWuxing(renGe);
|
| 590 |
+
const diWuxing = getWuxing(diGe);
|
| 591 |
+
|
| 592 |
+
// 天 -> 人 相生
|
| 593 |
+
if ((tianWuxing === '木' && renWuxing === '火') ||
|
| 594 |
+
(tianWuxing === '火' && renWuxing === '土') ||
|
| 595 |
+
(tianWuxing === '土' && renWuxing === '金') ||
|
| 596 |
+
(tianWuxing === '金' && renWuxing === '水') ||
|
| 597 |
+
(tianWuxing === '水' && renWuxing === '木')) {
|
| 598 |
+
score += 5;
|
| 599 |
+
}
|
| 600 |
+
|
| 601 |
+
// 人 -> 地 相生
|
| 602 |
+
if ((renWuxing === '木' && diWuxing === '火') ||
|
| 603 |
+
(renWuxing === '火' && diWuxing === '土') ||
|
| 604 |
+
(renWuxing === '土' && diWuxing === '金') ||
|
| 605 |
+
(renWuxing === '金' && diWuxing === '水') ||
|
| 606 |
+
(renWuxing === '水' && diWuxing === '木')) {
|
| 607 |
+
score += 5;
|
| 608 |
+
}
|
| 609 |
+
|
| 610 |
+
return Math.min(99, Math.max(45, Math.floor(score))); // Original score range 45-99
|
| 611 |
+
}
|
| 612 |
+
// === SCORING LOGIC END ===
|
| 613 |
+
|
| 614 |
+
|
| 615 |
+
function getFortuneType(score) {
|
| 616 |
+
for (let fortune of fortuneTypes) {
|
| 617 |
+
if (score >= fortune.range[0] && score <= fortune.range[1]) {
|
| 618 |
+
return fortune;
|
| 619 |
+
}
|
| 620 |
+
}
|
| 621 |
+
return fortuneTypes[fortuneTypes.length - 1];
|
| 622 |
+
}
|
| 623 |
+
|
| 624 |
+
function getFortuneClass(type) {
|
| 625 |
+
const fortune = fortuneTypes.find(f => f.type === type);
|
| 626 |
+
return fortune ? fortune.class : 'fortune-poor';
|
| 627 |
+
}
|
| 628 |
+
|
| 629 |
+
function analyzeName() {
|
| 630 |
+
const name = document.getElementById('nameInput').value.trim();
|
| 631 |
+
|
| 632 |
+
if (!name) {
|
| 633 |
+
alert('请输入姓名');
|
| 634 |
+
return;
|
| 635 |
+
}
|
| 636 |
+
|
| 637 |
+
const chineseCharRegex = /^[\u4e00-\u9fa5]+$/;
|
| 638 |
+
if (!chineseCharRegex.test(name)) {
|
| 639 |
+
alert('姓名中只能包含汉字');
|
| 640 |
+
return;
|
| 641 |
+
}
|
| 642 |
+
|
| 643 |
+
if (name.length < 2 || name.length > 4) {
|
| 644 |
+
alert('请输入2-4个字的姓名');
|
| 645 |
+
return;
|
| 646 |
+
}
|
| 647 |
+
|
| 648 |
+
const strokes = [];
|
| 649 |
+
for (let char of name) {
|
| 650 |
+
strokes.push(getStrokeCount(char));
|
| 651 |
+
}
|
| 652 |
+
|
| 653 |
+
let tianGe, renGe, diGe, zongGe, waiGe;
|
| 654 |
+
|
| 655 |
+
if (name.length === 2) {
|
| 656 |
+
tianGe = strokes[0] + 1;
|
| 657 |
+
renGe = strokes[0] + strokes[1];
|
| 658 |
+
diGe = strokes[1] + 1;
|
| 659 |
+
zongGe = strokes[0] + strokes[1];
|
| 660 |
+
waiGe = 2;
|
| 661 |
+
} else if (name.length === 3) {
|
| 662 |
+
tianGe = strokes[0] + 1;
|
| 663 |
+
renGe = strokes[0] + strokes[1];
|
| 664 |
+
diGe = strokes[1] + strokes[2];
|
| 665 |
+
zongGe = strokes[0] + strokes[1] + strokes[2];
|
| 666 |
+
waiGe = strokes[2] + 1;
|
| 667 |
+
} else { // name.length === 4
|
| 668 |
+
tianGe = strokes[0] + strokes[1];
|
| 669 |
+
renGe = strokes[1] + strokes[2];
|
| 670 |
+
diGe = strokes[2] + strokes[3];
|
| 671 |
+
zongGe = strokes[0] + strokes[1] + strokes[2] + strokes[3];
|
| 672 |
+
waiGe = strokes[0] + strokes[3];
|
| 673 |
+
}
|
| 674 |
+
|
| 675 |
+
const score = calculateScore(tianGe, renGe, diGe, zongGe, waiGe);
|
| 676 |
+
const fortune = getFortuneType(score);
|
| 677 |
+
|
| 678 |
+
const existingIndex = nameHistory.findIndex(item => item.name === name);
|
| 679 |
+
if (existingIndex !== -1) {
|
| 680 |
+
const updatedItem = { name, score, type: fortune.type };
|
| 681 |
+
nameHistory.splice(existingIndex, 1);
|
| 682 |
+
nameHistory.unshift(updatedItem);
|
| 683 |
+
} else {
|
| 684 |
+
nameHistory.unshift({ name, score, type: fortune.type });
|
| 685 |
+
}
|
| 686 |
+
|
| 687 |
+
saveHistoryData();
|
| 688 |
+
|
| 689 |
+
document.getElementById('scoreDisplay').textContent = score;
|
| 690 |
+
document.getElementById('fortuneType').textContent = fortune.type;
|
| 691 |
+
document.getElementById('tianGe').textContent = `${tianGe}`;
|
| 692 |
+
document.getElementById('renGe').textContent = `${renGe}`;
|
| 693 |
+
document.getElementById('diGe').textContent = `${diGe}`;
|
| 694 |
+
document.getElementById('zongGe').textContent = `${zongGe}`;
|
| 695 |
+
document.getElementById('waiGe').textContent = `${waiGe}`;
|
| 696 |
+
document.getElementById('fortuneDesc').textContent = fortune.desc;
|
| 697 |
+
|
| 698 |
+
document.getElementById('resultSection').classList.add('show');
|
| 699 |
+
|
| 700 |
+
currentPage = 1;
|
| 701 |
+
displayHistory();
|
| 702 |
+
}
|
| 703 |
+
|
| 704 |
+
function displayHistory() {
|
| 705 |
+
const tbody = document.getElementById('historyTableBody');
|
| 706 |
+
const startIndex = (currentPage - 1) * itemsPerPage;
|
| 707 |
+
const endIndex = startIndex + itemsPerPage;
|
| 708 |
+
const pageData = nameHistory.slice(startIndex, endIndex);
|
| 709 |
+
|
| 710 |
+
tbody.innerHTML = '';
|
| 711 |
+
|
| 712 |
+
pageData.forEach(item => {
|
| 713 |
+
const row = document.createElement('tr');
|
| 714 |
+
row.innerHTML = `
|
| 715 |
+
<td>${item.name}</td>
|
| 716 |
+
<td class="score-cell">${item.score}</td>
|
| 717 |
+
<td><span class="fortune-cell ${getFortuneClass(item.type)}">${item.type}</span></td>
|
| 718 |
+
`;
|
| 719 |
+
tbody.appendChild(row);
|
| 720 |
+
});
|
| 721 |
+
|
| 722 |
+
displayPagination();
|
| 723 |
+
}
|
| 724 |
+
|
| 725 |
+
function displayPagination() {
|
| 726 |
+
const totalPages = Math.ceil(nameHistory.length / itemsPerPage);
|
| 727 |
+
const pagination = document.getElementById('pagination');
|
| 728 |
+
|
| 729 |
+
pagination.innerHTML = '';
|
| 730 |
+
|
| 731 |
+
if (totalPages <= 1) return;
|
| 732 |
+
|
| 733 |
+
const prevBtn = document.createElement('button');
|
| 734 |
+
prevBtn.textContent = '上一页';
|
| 735 |
+
prevBtn.disabled = currentPage === 1;
|
| 736 |
+
prevBtn.onclick = () => {
|
| 737 |
+
if (currentPage > 1) {
|
| 738 |
+
currentPage--;
|
| 739 |
+
displayHistory();
|
| 740 |
+
}
|
| 741 |
+
};
|
| 742 |
+
pagination.appendChild(prevBtn);
|
| 743 |
+
|
| 744 |
+
let startPage = Math.max(1, currentPage - 2);
|
| 745 |
+
let endPage = Math.min(totalPages, currentPage + 2);
|
| 746 |
+
|
| 747 |
+
if (currentPage <= 3) {
|
| 748 |
+
endPage = Math.min(totalPages, 5);
|
| 749 |
+
}
|
| 750 |
+
if (currentPage >= totalPages - 2) {
|
| 751 |
+
startPage = Math.max(1, totalPages - 4);
|
| 752 |
+
}
|
| 753 |
+
|
| 754 |
+
for (let i = startPage; i <= endPage; i++) {
|
| 755 |
+
const pageBtn = document.createElement('button');
|
| 756 |
+
pageBtn.textContent = i;
|
| 757 |
+
pageBtn.className = i === currentPage ? 'active' : '';
|
| 758 |
+
pageBtn.onclick = () => {
|
| 759 |
+
currentPage = i;
|
| 760 |
+
displayHistory();
|
| 761 |
+
};
|
| 762 |
+
pagination.appendChild(pageBtn);
|
| 763 |
+
}
|
| 764 |
+
|
| 765 |
+
const nextBtn = document.createElement('button');
|
| 766 |
+
nextBtn.textContent = '下一页';
|
| 767 |
+
nextBtn.disabled = currentPage === totalPages;
|
| 768 |
+
nextBtn.onclick = () => {
|
| 769 |
+
if (currentPage < totalPages) {
|
| 770 |
+
currentPage++;
|
| 771 |
+
displayHistory();
|
| 772 |
+
}
|
| 773 |
+
};
|
| 774 |
+
pagination.appendChild(nextBtn);
|
| 775 |
+
|
| 776 |
+
const pageInfo = document.createElement('span');
|
| 777 |
+
pageInfo.className = 'page-info';
|
| 778 |
+
pageInfo.textContent = `第 ${currentPage} 页 / 共 ${totalPages} 页`;
|
| 779 |
+
pagination.appendChild(pageInfo);
|
| 780 |
+
}
|
| 781 |
+
|
| 782 |
+
document.getElementById('nameInput').addEventListener('keypress', function(e) {
|
| 783 |
+
if (e.key === 'Enter') {
|
| 784 |
+
analyzeName();
|
| 785 |
+
}
|
| 786 |
+
});
|
| 787 |
+
|
| 788 |
+
window.onload = function() {
|
| 789 |
+
initializeHistoryData();
|
| 790 |
+
displayHistory();
|
| 791 |
+
};
|
| 792 |
+
</script>
|
| 793 |
+
</body>
|
| 794 |
+
</html>
|