Spaces:
Running
Running
File size: 35,289 Bytes
e449d90 | 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 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mommy's Journey - Pregnancy & Postpartum Tracker</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
body {
font-family: 'Poppins', sans-serif;
background-color: #faf5ff;
}
.gradient-bg {
background: linear-gradient(135deg, #f3e5ff 0%, #e2c2ff 100%);
}
.pink-btn {
background: linear-gradient(to right, #ff6b9a, #ff8fab);
transition: all 0.3s ease;
}
.pink-btn:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(255, 107, 154, 0.3);
}
.purple-btn {
background: linear-gradient(to right, #9c6bff, #b58bff);
transition: all 0.3s ease;
}
.purple-btn:hover {
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(156, 107, 255, 0.3);
}
.baby-card {
transition: all 0.3s ease;
}
.baby-card:hover {
transform: translateY(-5px);
}
.milestone-item {
position: relative;
padding-left: 30px;
}
.milestone-item:before {
content: "";
position: absolute;
left: 0;
top: 8px;
width: 15px;
height: 15px;
border-radius: 50%;
background-color: #b58bff;
}
.timeline:before {
content: "";
position: absolute;
left: 7px;
top: 0;
bottom: 0;
width: 2px;
background-color: #e2c2ff;
}
.progress-ring__circle {
transition: stroke-dashoffset 0.35s;
transform: rotate(-90deg);
transform-origin: 50% 50%;
}
</style>
</head>
<body class="min-h-screen">
<div class="gradient-bg min-h-screen">
<!-- Header -->
<header class="py-6 px-4 md:px-8 lg:px-12">
<div class="container mx-auto flex justify-between items-center">
<div class="flex items-center">
<i class="fas fa-baby-carriage text-3xl text-purple-600 mr-3"></i>
<h1 class="text-2xl font-bold text-purple-800">Mommy's Journey</h1>
</div>
<nav class="hidden md:flex space-x-6">
<a href="#" class="text-purple-700 hover:text-purple-900 font-medium">Home</a>
<a href="#" class="text-purple-700 hover:text-purple-900 font-medium">Pregnancy</a>
<a href="#" class="text-purple-700 hover:text-purple-900 font-medium">Postpartum</a>
<a href="#" class="text-purple-700 hover:text-purple-900 font-medium">Resources</a>
</nav>
<button class="md:hidden text-purple-700">
<i class="fas fa-bars text-2xl"></i>
</button>
</div>
</header>
<!-- Main Content -->
<main class="container mx-auto px-4 md:px-8 lg:px-12 py-8">
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
<!-- Pregnancy Calculator -->
<div class="lg:col-span-2 bg-white rounded-2xl shadow-lg p-6">
<h2 class="text-2xl font-bold text-purple-800 mb-6 flex items-center">
<i class="fas fa-calculator text-purple-600 mr-3"></i>
Pregnancy Calculator
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
<div>
<label class="block text-purple-700 font-medium mb-2">Last Menstrual Period (LMP)</label>
<input type="date" id="lmpDate" class="w-full px-4 py-2 border border-purple-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-400">
</div>
<div>
<label class="block text-purple-700 font-medium mb-2">Ultrasound Due Date (Optional)</label>
<input type="date" id="ultrasoundDate" class="w-full px-4 py-2 border border-purple-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-400">
</div>
</div>
<button id="calculateBtn" class="pink-btn text-white font-bold py-3 px-6 rounded-full mb-6">
Calculate Pregnancy Progress
</button>
<div id="results" class="hidden bg-purple-50 rounded-xl p-6">
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
<div class="bg-white p-4 rounded-lg shadow-sm text-center">
<p class="text-purple-600 font-medium">Current Week</p>
<p id="currentWeek" class="text-3xl font-bold text-purple-800">-</p>
</div>
<div class="bg-white p-4 rounded-lg shadow-sm text-center">
<p class="text-purple-600 font-medium">Current Day</p>
<p id="currentDay" class="text-3xl font-bold text-purple-800">-</p>
</div>
<div class="bg-white p-4 rounded-lg shadow-sm text-center">
<p class="text-purple-600 font-medium">Trimester</p>
<p id="trimester" class="text-3xl font-bold text-purple-800">-</p>
</div>
</div>
<div class="mb-6">
<div class="flex justify-between mb-2">
<span class="text-purple-700 font-medium">Pregnancy Progress</span>
<span id="progressPercent" class="text-purple-700 font-bold">0%</span>
</div>
<div class="w-full bg-purple-100 rounded-full h-4">
<div id="progressBar" class="bg-gradient-to-r from-pink-400 to-purple-500 h-4 rounded-full" style="width: 0%"></div>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div class="bg-white p-4 rounded-lg shadow-sm">
<p class="text-purple-600 font-medium">Estimated Due Date</p>
<p id="dueDate" class="text-xl font-bold text-purple-800">-</p>
</div>
<div class="bg-white p-4 rounded-lg shadow-sm">
<p class="text-purple-600 font-medium">Conception Date</p>
<p id="conceptionDate" class="text-xl font-bold text-purple-800">-</p>
</div>
</div>
</div>
</div>
<!-- Baby Development -->
<div class="bg-white rounded-2xl shadow-lg p-6">
<h2 class="text-2xl font-bold text-purple-800 mb-6 flex items-center">
<i class="fas fa-baby text-purple-600 mr-3"></i>
Baby Development
</h2>
<div id="babyInfo" class="hidden">
<div class="baby-card bg-gradient-to-br from-pink-50 to-purple-50 rounded-xl p-6 mb-6 shadow-sm">
<div class="flex justify-between items-start mb-4">
<div>
<h3 id="babyWeek" class="text-xl font-bold text-purple-800">Week 12</h3>
<p id="babySize" class="text-purple-600">Size: About 2.1 inches</p>
</div>
<div class="w-16 h-16 relative">
<svg class="w-full h-full" viewBox="0 0 36 36">
<circle cx="18" cy="18" r="16" fill="none" stroke="#e2c2ff" stroke-width="2"></circle>
<circle id="babyProgressCircle" cx="18" cy="18" r="16" fill="none" stroke="#9c6bff" stroke-width="2" stroke-dasharray="100" stroke-dashoffset="40"></circle>
</svg>
<div class="absolute inset-0 flex items-center justify-center">
<span id="babyProgressText" class="text-xs font-bold text-purple-800">60%</span>
</div>
</div>
</div>
<p id="babyDescription" class="text-purple-700">Your baby is now the size of a lime! Facial features continue to develop and the baby can make tiny movements.</p>
</div>
<div class="mb-6">
<h4 class="font-bold text-purple-800 mb-3">Key Developments This Week</h4>
<ul class="space-y-2">
<li class="milestone-item text-purple-700">Reflexes are developing</li>
<li class="milestone-item text-purple-700">Fingerprints are forming</li>
<li class="milestone-item text-purple-700">Baby can make a fist</li>
<li class="milestone-item text-purple-700">Taste buds are forming</li>
</ul>
</div>
<button class="purple-btn text-white font-bold py-2 px-4 rounded-full w-full">
<i class="fas fa-book-medical mr-2"></i> Read More About This Stage
</button>
</div>
<div id="noBabyInfo" class="text-center py-8">
<i class="fas fa-baby text-4xl text-purple-300 mb-4"></i>
<p class="text-purple-600">Enter your pregnancy details to see your baby's development progress</p>
</div>
</div>
</div>
<!-- Postpartum Tracker -->
<div class="mt-8 bg-white rounded-2xl shadow-lg p-6">
<h2 class="text-2xl font-bold text-purple-800 mb-6 flex items-center">
<i class="fas fa-calendar-heart text-purple-600 mr-3"></i>
Postpartum Tracker
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
<div>
<label class="block text-purple-700 font-medium mb-2">Baby's Birth Date</label>
<input type="date" id="birthDate" class="w-full px-4 py-2 border border-purple-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-400">
</div>
<div>
<label class="block text-purple-700 font-medium mb-2">Your Recovery Status</label>
<select id="recoveryStatus" class="w-full px-4 py-2 border border-purple-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-400">
<option value="">Select your status</option>
<option value="normal">Normal delivery</option>
<option value="c-section">C-section</option>
<option value="complications">Delivery with complications</option>
</select>
</div>
</div>
<button id="trackPostpartumBtn" class="pink-btn text-white font-bold py-3 px-6 rounded-full mb-6">
Track Postpartum Progress
</button>
<div id="postpartumResults" class="hidden">
<div class="grid grid-cols-1 md:grid-cols-4 gap-4 mb-6">
<div class="bg-purple-50 p-4 rounded-lg shadow-sm text-center">
<p class="text-purple-600 font-medium">Days Postpartum</p>
<p id="daysPostpartum" class="text-3xl font-bold text-purple-800">-</p>
</div>
<div class="bg-purple-50 p-4 rounded-lg shadow-sm text-center">
<p class="text-purple-600 font-medium">Weeks Postpartum</p>
<p id="weeksPostpartum" class="text-3xl font-bold text-purple-800">-</p>
</div>
<div class="bg-purple-50 p-4 rounded-lg shadow-sm text-center">
<p class="text-purple-600 font-medium">Months Postpartum</p>
<p id="monthsPostpartum" class="text-3xl font-bold text-purple-800">-</p>
</div>
<div class="bg-purple-50 p-4 rounded-lg shadow-sm text-center">
<p class="text-purple-600 font-medium">Recovery Phase</p>
<p id="recoveryPhase" class="text-xl font-bold text-purple-800">-</p>
</div>
</div>
<div class="mb-6">
<h4 class="font-bold text-purple-800 mb-3">Postpartum Timeline</h4>
<div class="relative pl-8 timeline">
<div class="milestone-item mb-6">
<h5 class="font-bold text-purple-700">Immediate Postpartum (0-24 hours)</h5>
<p class="text-purple-600 text-sm">Your body begins healing from delivery. Focus on rest and bonding with your baby.</p>
</div>
<div class="milestone-item mb-6">
<h5 class="font-bold text-purple-700">Early Postpartum (Days 1-10)</h5>
<p class="text-purple-600 text-sm">Lochia (postpartum bleeding) is heaviest. Watch for signs of infection.</p>
</div>
<div class="milestone-item mb-6">
<h5 class="font-bold text-purple-700">Mid Postpartum (Weeks 2-6)</h5>
<p class="text-purple-600 text-sm">Physical recovery continues. You may start light exercises with doctor's approval.</p>
</div>
<div class="milestone-item">
<h5 class="font-bold text-purple-700">Late Postpartum (Months 2-12)</h5>
<p class="text-purple-600 text-sm">Body returns to pre-pregnancy state. Emotional adjustment continues.</p>
</div>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div class="bg-pink-50 rounded-xl p-6">
<h5 class="font-bold text-pink-800 mb-3 flex items-center">
<i class="fas fa-heartbeat mr-2"></i> Physical Recovery Tips
</h5>
<ul class="space-y-2 text-pink-700">
<li class="flex items-start">
<i class="fas fa-check-circle text-pink-400 mt-1 mr-2"></i>
<span>Stay hydrated and eat nutritious meals</span>
</li>
<li class="flex items-start">
<i class="fas fa-check-circle text-pink-400 mt-1 mr-2"></i>
<span>Practice pelvic floor exercises</span>
</li>
<li class="flex items-start">
<i class="fas fa-check-circle text-pink-400 mt-1 mr-2"></i>
<span>Get as much rest as possible</span>
</li>
<li class="flex items-start">
<i class="fas fa-check-circle text-pink-400 mt-1 mr-2"></i>
<span>Don't lift anything heavier than your baby</span>
</li>
</ul>
</div>
<div class="bg-purple-50 rounded-xl p-6">
<h5 class="font-bold text-purple-800 mb-3 flex items-center">
<i class="fas fa-smile-beam mr-2"></i> Emotional Wellbeing
</h5>
<ul class="space-y-2 text-purple-700">
<li class="flex items-start">
<i class="fas fa-check-circle text-purple-400 mt-1 mr-2"></i>
<span>Accept help from family and friends</span>
</li>
<li class="flex items-start">
<i class="fas fa-check-circle text-purple-400 mt-1 mr-2"></i>
<span>Join a new moms support group</span>
</li>
<li class="flex items-start">
<i class="fas fa-check-circle text-purple-400 mt-1 mr-2"></i>
<span>Be patient with yourself - recovery takes time</span>
</li>
<li class="flex items-start">
<i class="fas fa-check-circle text-purple-400 mt-1 mr-2"></i>
<span>Watch for signs of postpartum depression</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Resources Section -->
<div class="mt-8">
<h2 class="text-2xl font-bold text-purple-800 mb-6">Helpful Resources</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<div class="bg-white rounded-xl shadow-lg p-6 hover:shadow-xl transition-shadow">
<div class="bg-pink-100 w-12 h-12 rounded-full flex items-center justify-center mb-4">
<i class="fas fa-book text-pink-600 text-xl"></i>
</div>
<h3 class="font-bold text-purple-800 mb-2">Pregnancy Guides</h3>
<p class="text-purple-600 mb-4">Comprehensive week-by-week guides to your pregnancy journey.</p>
<button class="text-pink-600 font-medium flex items-center">
Explore <i class="fas fa-arrow-right ml-2"></i>
</button>
</div>
<div class="bg-white rounded-xl shadow-lg p-6 hover:shadow-xl transition-shadow">
<div class="bg-purple-100 w-12 h-12 rounded-full flex items-center justify-center mb-4">
<i class="fas fa-utensils text-purple-600 text-xl"></i>
</div>
<h3 class="font-bold text-purple-800 mb-2">Postpartum Nutrition</h3>
<p class="text-purple-600 mb-4">Meal plans and recipes to support your recovery and breastfeeding.</p>
<button class="text-purple-600 font-medium flex items-center">
Explore <i class="fas fa-arrow-right ml-2"></i>
</button>
</div>
<div class="bg-white rounded-xl shadow-lg p-6 hover:shadow-xl transition-shadow">
<div class="bg-pink-100 w-12 h-12 rounded-full flex items-center justify-center mb-4">
<i class="fas fa-hands-helping text-pink-600 text-xl"></i>
</div>
<h3 class="font-bold text-purple-800 mb-2">Support Groups</h3>
<p class="text-purple-600 mb-4">Connect with other moms going through similar experiences.</p>
<button class="text-pink-600 font-medium flex items-center">
Explore <i class="fas fa-arrow-right ml-2"></i>
</button>
</div>
</div>
</div>
</main>
<!-- Footer -->
<footer class="bg-purple-800 text-white py-8 mt-12">
<div class="container mx-auto px-4 md:px-8 lg:px-12">
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
<div>
<h3 class="text-xl font-bold mb-4 flex items-center">
<i class="fas fa-baby-carriage mr-2"></i> Mommy's Journey
</h3>
<p class="text-purple-200">Supporting mothers through every stage of pregnancy and beyond.</p>
</div>
<div>
<h4 class="font-bold mb-4">Quick Links</h4>
<ul class="space-y-2">
<li><a href="#" class="text-purple-200 hover:text-white">Home</a></li>
<li><a href="#" class="text-purple-200 hover:text-white">Pregnancy Calculator</a></li>
<li><a href="#" class="text-purple-200 hover:text-white">Postpartum Tracker</a></li>
<li><a href="#" class="text-purple-200 hover:text-white">Resources</a></li>
</ul>
</div>
<div>
<h4 class="font-bold mb-4">Support</h4>
<ul class="space-y-2">
<li><a href="#" class="text-purple-200 hover:text-white">FAQs</a></li>
<li><a href="#" class="text-purple-200 hover:text-white">Contact Us</a></li>
<li><a href="#" class="text-purple-200 hover:text-white">Privacy Policy</a></li>
<li><a href="#" class="text-purple-200 hover:text-white">Terms of Service</a></li>
</ul>
</div>
<div>
<h4 class="font-bold mb-4">Connect With Us</h4>
<div class="flex space-x-4">
<a href="#" class="w-10 h-10 bg-purple-700 rounded-full flex items-center justify-center hover:bg-purple-600">
<i class="fab fa-facebook-f"></i>
</a>
<a href="#" class="w-10 h-10 bg-purple-700 rounded-full flex items-center justify-center hover:bg-purple-600">
<i class="fab fa-instagram"></i>
</a>
<a href="#" class="w-10 h-10 bg-purple-700 rounded-full flex items-center justify-center hover:bg-purple-600">
<i class="fab fa-pinterest-p"></i>
</a>
<a href="#" class="w-10 h-10 bg-purple-700 rounded-full flex items-center justify-center hover:bg-purple-600">
<i class="fab fa-youtube"></i>
</a>
</div>
<p class="text-purple-200 mt-4">Subscribe to our newsletter</p>
<div class="mt-2 flex">
<input type="email" placeholder="Your email" class="px-3 py-2 text-purple-800 rounded-l-lg focus:outline-none w-full">
<button class="bg-pink-500 px-4 rounded-r-lg">
<i class="fas fa-paper-plane"></i>
</button>
</div>
</div>
</div>
<div class="border-t border-purple-700 mt-8 pt-6 text-center text-purple-300">
<p>© 2023 Mommy's Journey. All rights reserved.</p>
</div>
</div>
</footer>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Pregnancy Calculator
const calculateBtn = document.getElementById('calculateBtn');
const lmpDateInput = document.getElementById('lmpDate');
const ultrasoundDateInput = document.getElementById('ultrasoundDate');
const resultsSection = document.getElementById('results');
const babyInfoSection = document.getElementById('babyInfo');
const noBabyInfoSection = document.getElementById('noBabyInfo');
// Postpartum Tracker
const trackPostpartumBtn = document.getElementById('trackPostpartumBtn');
const birthDateInput = document.getElementById('birthDate');
const recoveryStatusSelect = document.getElementById('recoveryStatus');
const postpartumResultsSection = document.getElementById('postpartumResults');
// Set default dates for demo purposes
const today = new Date();
const defaultLMP = new Date();
defaultLMP.setDate(today.getDate() - 7 * 12); // 12 weeks ago
lmpDateInput.valueAsDate = defaultLMP;
const defaultBirthDate = new Date();
defaultBirthDate.setDate(today.getDate() - 14); // 2 weeks ago
birthDateInput.valueAsDate = defaultBirthDate;
// Pregnancy Calculator Logic
calculateBtn.addEventListener('click', function() {
const lmpDate = new Date(lmpDateInput.value);
const ultrasoundDate = ultrasoundDateInput.value ? new Date(ultrasoundDateInput.value) : null;
if (!lmpDateInput.value) {
alert('Please enter your Last Menstrual Period date');
return;
}
// Calculate based on LMP (standard 40-week pregnancy)
const today = new Date();
const pregnancyStart = new Date(lmpDate);
const daysPassed = Math.floor((today - pregnancyStart) / (1000 * 60 * 60 * 24));
const weeks = Math.floor(daysPassed / 7);
const days = daysPassed % 7;
const totalDays = weeks * 7 + days;
// Update pregnancy progress
document.getElementById('currentWeek').textContent = weeks;
document.getElementById('currentDay').textContent = days;
// Determine trimester
let trimester;
if (weeks < 13) trimester = "1st";
else if (weeks < 27) trimester = "2nd";
else trimester = "3rd";
document.getElementById('trimester').textContent = trimester;
// Calculate due date (LMP + 280 days)
const dueDate = new Date(pregnancyStart);
dueDate.setDate(pregnancyStart.getDate() + 280);
document.getElementById('dueDate').textContent = dueDate.toLocaleDateString();
// Calculate conception date (LMP + 14 days)
const conceptionDate = new Date(pregnancyStart);
conceptionDate.setDate(pregnancyStart.getDate() + 14);
document.getElementById('conceptionDate').textContent = conceptionDate.toLocaleDateString();
// Update progress bar
const progressPercent = Math.min(Math.floor((totalDays / 280) * 100), 100);
document.getElementById('progressPercent').textContent = `${progressPercent}%`;
document.getElementById('progressBar').style.width = `${progressPercent}%`;
// Show results
resultsSection.classList.remove('hidden');
// Update baby development info
updateBabyDevelopmentInfo(weeks, days);
});
// Update baby development information
function updateBabyDevelopmentInfo(weeks, days) {
if (weeks >= 0 && weeks <= 40) {
babyInfoSection.classList.remove('hidden');
noBabyInfoSection.classList.add('hidden');
// Sample baby development data (in a real app, this would be more comprehensive)
const babyData = getBabyDevelopmentData(weeks);
document.getElementById('babyWeek').textContent = `Week ${weeks}`;
document.getElementById('babySize').textContent = `Size: ${babyData.size}`;
document.getElementById('babyDescription').textContent = babyData.description;
// Update progress circle
const progressPercent = Math.min(Math.floor((weeks / 40) * 100), 100);
const circle = document.getElementById('babyProgressCircle');
const circumference = 2 * Math.PI * 16;
const offset = circumference - (progressPercent / 100) * circumference;
circle.style.strokeDashoffset = offset;
document.getElementById('babyProgressText').textContent = `${progressPercent}%`;
} else {
babyInfoSection.classList.add('hidden');
noBabyInfoSection.classList.remove('hidden');
}
}
// Sample baby development data
function getBabyDevelopmentData(week) {
const developmentData = {
4: { size: "Poppy seed", description: "The fertilized egg implants in your uterus. The placenta begins to form." },
8: { size: "Raspberry", description: "All major organs have begun to form. The heart beats regularly." },
12: { size: "Lime", description: "Facial features continue to develop and the baby can make tiny movements." },
16: { size: "Avocado", description: "The baby's sex can be seen on ultrasound. Muscles are growing stronger." },
20: { size: "Banana", description: "You may feel movement (quickening). The baby can hear sounds." },
24: { size: "Corn", description: "Lungs are developing. The baby practices breathing movements." },
28: { size: "Eggplant", description: "Eyes can open and close. The brain is developing rapidly." },
32: { size: "Squash", description: "Baby is gaining weight quickly. Bones are fully formed but still soft." },
36: { size: "Honeydew", description: "Baby is settling into head-down position. Lungs are nearly mature." },
40: { size: "Pumpkin", description: "Your baby is ready to meet the world! Any day now..." }
};
// Find the closest week with data
let closestWeek = week;
while (closestWeek > 0 && !developmentData[closestWeek]) {
closestWeek--;
}
return developmentData[closestWeek] || { size: "Unknown", description: "Development information not available for this week." };
}
// Postpartum Tracker Logic
trackPostpartumBtn.addEventListener('click', function() {
const birthDate = new Date(birthDateInput.value);
const recoveryStatus = recoveryStatusSelect.value;
if (!birthDateInput.value) {
alert('Please enter your baby\'s birth date');
return;
}
if (!recoveryStatus) {
alert('Please select your recovery status');
return;
}
const today = new Date();
const daysPassed = Math.floor((today - birthDate) / (1000 * 60 * 60 * 24));
const weeksPassed = Math.floor(daysPassed / 7);
const monthsPassed = Math.floor(daysPassed / 30);
// Update postpartum progress
document.getElementById('daysPostpartum').textContent = daysPassed;
document.getElementById('weeksPostpartum').textContent = weeksPassed;
document.getElementById('monthsPostpartum').textContent = monthsPassed;
// Determine recovery phase
let recoveryPhase;
if (daysPassed <= 1) recoveryPhase = "Immediate";
else if (daysPassed <= 10) recoveryPhase = "Early";
else if (weeksPassed <= 6) recoveryPhase = "Mid";
else recoveryPhase = "Late";
document.getElementById('recoveryPhase').textContent = `${recoveryPhase} Phase`;
// Show results
postpartumResultsSection.classList.remove('hidden');
});
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=machuabo07/pregapp" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |