Spaces:
Running
Running
File size: 17,324 Bytes
51584a9 12bcf64 51584a9 12bcf64 51584a9 12bcf64 51584a9 7318db9 12bcf64 7318db9 12bcf64 51584a9 3453b9b 12bcf64 3453b9b 12bcf64 51584a9 12bcf64 51584a9 12bcf64 51584a9 12bcf64 51584a9 12bcf64 7318db9 12bcf64 7318db9 12bcf64 51584a9 12bcf64 3453b9b 12bcf64 51584a9 12bcf64 7318db9 12bcf64 7318db9 12bcf64 51584a9 12bcf64 51584a9 12bcf64 51584a9 12bcf64 51584a9 12bcf64 51584a9 12bcf64 51584a9 12bcf64 51584a9 12bcf64 51584a9 12bcf64 3453b9b 12bcf64 3453b9b 12bcf64 51584a9 12bcf64 3453b9b 12bcf64 3453b9b 12bcf64 3453b9b 12bcf64 3453b9b 51584a9 7318db9 3453b9b 12bcf64 51584a9 12bcf64 51584a9 12bcf64 3453b9b 51584a9 12bcf64 3453b9b 51584a9 3453b9b 12bcf64 51584a9 12bcf64 51584a9 12bcf64 7318db9 12bcf64 3453b9b 51584a9 12bcf64 51584a9 12bcf64 7318db9 51584a9 12bcf64 7318db9 12bcf64 51584a9 12bcf64 3453b9b 12bcf64 7318db9 51584a9 12bcf64 3453b9b 12bcf64 7318db9 3453b9b 12bcf64 7318db9 12bcf64 7318db9 12bcf64 7318db9 12bcf64 51584a9 12bcf64 51584a9 |
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 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Personalized Baby Name Generator</title>
<style>
:root {
--primary: #FF9FB0;
--secondary: #A6D9F7;
--accent: #B6E6BD;
--dark: #2D3748;
--light: #F7FAFC;
--shadow: rgba(0, 0, 0, 0.1);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Arial, sans-serif;
}
body {
background: linear-gradient(135deg, #f6f8fc 0%, #fff 100%);
color: var(--dark);
min-height: 100vh;
padding: 2rem;
}
.container {
max-width: 1000px;
margin: 0 auto;
}
.header {
text-align: center;
padding: 2rem;
background: white;
border-radius: 1rem;
box-shadow: 0 4px 6px var(--shadow);
margin-bottom: 2rem;
}
.header h1 {
color: var(--primary);
font-size: 2.5rem;
margin-bottom: 0.5rem;
}
.generator-form {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
}
.form-section {
background: white;
padding: 1.5rem;
border-radius: 1rem;
box-shadow: 0 4px 6px var(--shadow);
}
.form-section h2 {
color: var(--secondary);
margin-bottom: 1rem;
font-size: 1.5rem;
}
.input-group {
margin-bottom: 1rem;
}
.input-group label {
display: block;
margin-bottom: 0.5rem;
color: var(--dark);
font-weight: 500;
}
select, input {
width: 100%;
padding: 0.75rem;
border: 2px solid #E2E8F0;
border-radius: 0.5rem;
font-size: 1rem;
transition: all 0.3s ease;
}
select:focus, input:focus {
border-color: var(--primary);
outline: none;
box-shadow: 0 0 0 3px rgba(255, 159, 176, 0.2);
}
.traits-container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
gap: 0.5rem;
margin-top: 0.5rem;
}
.trait-chip {
padding: 0.5rem;
background: var(--light);
border: 1px solid #E2E8F0;
border-radius: 2rem;
cursor: pointer;
text-align: center;
transition: all 0.3s ease;
}
.trait-chip.selected {
background: var(--primary);
color: white;
border-color: var(--primary);
}
.generate-btn {
background: var(--primary);
color: white;
border: none;
padding: 1rem 2rem;
border-radius: 0.5rem;
font-size: 1.1rem;
font-weight: 600;
cursor: pointer;
width: 100%;
transition: all 0.3s ease;
margin-top: 1rem;
}
.generate-btn:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(255, 159, 176, 0.3);
}
.results-section {
margin-top: 2rem;
background: white;
padding: 2rem;
border-radius: 1rem;
box-shadow: 0 4px 6px var(--shadow);
}
.name-card {
background: var(--light);
padding: 1.5rem;
border-radius: 0.5rem;
margin-bottom: 1rem;
display: flex;
justify-content: space-between;
align-items: center;
transition: all 0.3s ease;
}
.name-card:hover {
transform: translateX(5px);
background: #F0F7FF;
}
.name-details h3 {
color: var(--primary);
font-size: 1.5rem;
margin-bottom: 0.5rem;
}
.name-meaning {
font-size: 0.9rem;
color: #666;
}
.personality-tags {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
margin-top: 0.5rem;
}
.personality-tag {
background: var(--secondary);
color: white;
padding: 0.25rem 0.75rem;
border-radius: 1rem;
font-size: 0.8rem;
}
.favorite-btn {
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
transition: all 0.3s ease;
}
.favorite-btn:hover {
transform: scale(1.2);
}
.favorites-section {
margin-top: 2rem;
background: white;
padding: 2rem;
border-radius: 1rem;
box-shadow: 0 4px 6px var(--shadow);
}
.favorites-section h2 {
color: var(--primary);
margin-bottom: 1rem;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.name-card {
animation: fadeIn 0.5s ease forwards;
}
@media (max-width: 768px) {
.container {
padding: 1rem;
}
.generator-form {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>👶 Personalized Baby Name Generator</h1>
<p>Create the perfect name based on your family's unique characteristics</p>
</div>
<div class="generator-form">
<div class="form-section">
<h2>Basic Information</h2>
<div class="input-group">
<label for="gender">Baby's Gender</label>
<select id="gender">
<option value="all">All</option>
<option value="boy">Boy</option>
<option value="girl">Girl</option>
<option value="neutral">Gender Neutral</option>
</select>
</div>
<div class="input-group">
<label for="origin">Cultural Background</label>
<select id="origin" multiple>
<option value="english">English</option>
<option value="french">French</option>
<option value="spanish">Spanish</option>
<option value="italian">Italian</option>
<option value="greek">Greek</option>
<option value="celtic">Celtic</option>
<option value="nordic">Nordic</option>
<option value="hebrew">Hebrew</option>
<option value="arabic">Arabic</option>
<option value="persian">Persian</option>
<option value="indian">Indian</option>
<option value="chinese">Chinese</option>
<option value="japanese">Japanese</option>
<option value="korean">Korean</option>
</select>
</div>
</div>
<div class="form-section">
<h2>Mother's Characteristics</h2>
<div class="input-group">
<label>Select Personality Traits</label>
<div class="traits-container" id="motherTraits">
<div class="trait-chip" data-trait="creative">Creative</div>
<div class="trait-chip" data-trait="intelligent">Intelligent</div>
<div class="trait-chip" data-trait="caring">Caring</div>
<div class="trait-chip" data-trait="strong">Strong</div>
<div class="trait-chip" data-trait="artistic">Artistic</div>
<div class="trait-chip" data-trait="adventurous">Adventurous</div>
<div class="trait-chip" data-trait="peaceful">Peaceful</div>
<div class="trait-chip" data-trait="wise">Wise</div>
</div>
</div>
</div>
<div class="form-section">
<h2>Father's Characteristics</h2>
<div class="input-group">
<label>Select Personality Traits</label>
<div class="traits-container" id="fatherTraits">
<div class="trait-chip" data-trait="protective">Protective</div>
<div class="trait-chip" data-trait="loyal">Loyal</div>
<div class="trait-chip" data-trait="brave">Brave</div>
<div class="trait-chip" data-trait="gentle">Gentle</div>
<div class="trait-chip" data-trait="ambitious">Ambitious</div>
<div class="trait-chip" data-trait="wise">Wise</div>
<div class="trait-chip" data-trait="humorous">Humorous</div>
<div class="trait-chip" data-trait="athletic">Athletic</div>
</div>
</div>
</div>
</div>
<button class="generate-btn" onclick="generateNames()">Generate Perfect Names</button>
<div class="results-section" id="results">
<!-- Generated names will appear here -->
</div>
<div class="favorites-section">
<h2>❤️ Favorite Names</h2>
<div id="favoritesList"></div>
</div>
</div>
<script>
// Extended name database with meanings and trait associations
const nameDatabase = {
boy: {
creative: ['Leonardo', 'Byron', 'Vincent', 'Aiden'],
intelligent: ['Solomon', 'Ethan', 'Adrian', 'Theodore'],
strong: ['Alexander', 'Thor', 'Viktor', 'Bruno'],
protective: ['William', 'Guardian', 'Ward', 'Reign'],
brave: ['Valor', 'Leo', 'Wyatt', 'Ethan'],
gentle: ['Oliver', 'Liam', 'Noah', 'Benjamin'],
wise: ['Sage', 'Solomon', 'Alvis', 'Kenneth']
},
girl: {
creative: ['Luna', 'Aurora', 'Aria', 'Maya'],
intelligent: ['Sophia', 'Athena', 'Claire', 'Ada'],
caring: ['Grace', 'Hannah', 'Lily', 'Mira'],
artistic: ['Melody', 'Violet', 'Iris', 'Aria'],
peaceful: ['Serena', 'Dove', 'Paz', 'Shanti'],
wise: ['Sophia', 'Minerva', 'Sage', 'Alena']
},
neutral: {
creative: ['Alex', 'River', 'Sky', 'Phoenix'],
strong: ['Morgan', 'Kai', 'Atlas', 'Storm'],
wise: ['Sage', 'Quinn', 'Blair', 'Eden'],
peaceful: ['Harmony', 'Peace', 'Robin', 'Dawn']
}
};
// Name meanings database
const nameMeanings = {
'Alexander': 'Defender of the people',
'Sophia': 'Wisdom',
'Luna': 'Moon',
'Ethan': 'Strong, enduring',
'Grace': 'Elegance and divine favor',
// Add more meanings as needed
};
let favorites = new Set();
let selectedTraits = {
mother: new Set(),
father: new Set()
};
// Setup trait selection
document.querySelectorAll('.trait-chip').forEach(chip => {
chip.addEventListener('click', () => {
const parent = chip.parentElement.id;
const trait = chip.dataset.trait;
const traitSet = parent === 'motherTraits' ? selectedTraits.mother : selectedTraits.father;
chip.classList.toggle('selected');
if (traitSet.has(trait)) {
traitSet.delete(trait);
} else {
traitSet.add(trait);
}
});
});
function generateNames() {
const gender = document.getElementById('gender').value;
const origins = Array.from(document.getElementById('origin').selectedOptions).map(option => option.value);
let names = new Set();
const traits = [...selectedTraits.mother, ...selectedTraits.father];
// Generate names based on selected traits
traits.forEach(trait => {
if (gender === 'all' || gender === 'neutral') {
if (nameDatabase.neutral[trait]) {
nameDatabase.neutral[trait].forEach(name => names.add(name));
}
}
if (gender === 'all' || gender === 'boy') {
if (nameDatabase.boy[trait]) {
nameDatabase.boy[trait].forEach(name => names.add(name));
}
}
if (gender === 'all' || gender === 'girl') {
if (nameDatabase.girl[trait]) {
nameDatabase.girl[trait].forEach(name => names.add(name));
}
}
});
displayResults(Array.from(names));
}
function displayResults(names) {
const resultsDiv = document.getElementById('results');
resultsDiv.innerHTML = '<h2>Suggested Names</h2>';
if (names.length === 0) {
resultsDiv.innerHTML += '<p>No names match your criteria. Try selecting different traits.</p>';
return;
}
names.forEach((name, index) => {
const nameCard = document.createElement('div');
nameCard.className = 'name-card';
nameCard.style.animationDelay = `${index * 0.1}s`;
const relatedTraits = findRelatedTraits(name);
const meaning = nameMeanings[name] || 'A beautiful name';
nameCard.innerHTML = `
<div class="name-details">
<h3>${name}</h3>
<div class="name-meaning">${meaning}</div>
<div class="personality-tags">
${relatedTraits.map(trait =>
`<span class="personality-tag">${trait}</span>`
).join('')}
</div>
</div>
<button class="favorite-btn" onclick="toggleFavorite('${name}')">
${favorites.has(name) ? '❤️' : '🤍'}
</button>
`;
resultsDiv.appendChild(nameCard);
});
}
function findRelatedTraits(name) {
let traits = new Set();
Object.entries(nameDatabase).forEach(([gender, traitGroups]) => {
Object.entries(traitGroups).forEach(([trait, names]) => {
if (names.includes(name)) {
traits.add(trait);
}
});
});
return Array.from(traits);
}
function toggleFavorite(name) {
if (favorites.has(name)) {
favorites.delete(name);
} else {
favorites.add(name);
}
updateFavorites();
generateNames(); // Refresh current results
}
function updateFavorites() {
const favoritesList = document.getElementById('favoritesList');
favoritesList.innerHTML = '';
if (favorites.size === 0) {
favoritesList.innerHTML = '<p>No favorite names yet</p>';
return;
}
[...favorites].forEach(name => {
const nameCard = document.createElement('div');
nameCard.className = 'name-card';
const relatedTraits = findRelatedTraits(name);
const meaning = nameMeanings[name] || 'A beautiful name';
nameCard.innerHTML = `
<div class="name-details">
<h3>${name}</h3>
<div class="name-meaning">${meaning}</div>
<div class="personality-tags">
${relatedTraits.map(trait =>
`<span class="personality-tag">${trait}</span>`
).join('')}
</div>
</div>
<button class="favorite-btn" onclick="toggleFavorite('${name}')">❤️</button>
`;
favoritesList.appendChild(nameCard);
});
}
// Initialize with empty results
generateNames();
</script>
</body>
</html> |