<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>2027 Digital Life Planner — Suha</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');
:root {
--bg-cream: #F6EFEA;
--bg-card: #FAF6F3;
--bg-inner: #EFE3E1;
--bg-pill: #F3E5E3;
--rose-primary: #DF9CA9;
--rose-deep: #C47A88;
--blush-soft: #F4C2C9;
--lavender-muted: #B6A8CE;
--lavender-soft: #E5E0EE;
--sage-green: #A7C2AE;
--sage-soft: #E1ECE4;
--text-dark: #433638;
--text-muted: #7C6B6E;
--shadow-card: 0 6px 18px rgba(120, 88, 92, 0.06);
--radius-lg: 20px;
--radius-md: 14px;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
-webkit-tap-highlight-color: transparent;
}
body {
font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
background-color: #EAE1DC;
color: var(--text-dark);
line-height: 1.45;
display: flex;
justify-content: center;
min-height: 100vh;
}
h1, h2, h3, .serif {
font-family: 'Playfair Display', Georgia, serif;
font-weight: 600;
color: var(--text-dark);
}
/* ==================== 1. OPENING COVER ==================== */
#cover {
position: fixed;
inset: 0;
z-index: 50;
background: #efe9e4 url(cover.jpg) center/cover no-repeat;
display: flex;
align-items: flex-end;
justify-content: center;
padding-bottom: 9vh;
animation: fade 2.2s ease both;
transition: opacity 1s, transform 1s;
}
#cover.go {
opacity: 0;
transform: scale(1.06);
pointer-events: none;
}
#openBtn {
background: rgba(253, 243, 240, .92);
color: #c9708a;
padding: 15px 38px;
border-radius: 40px;
border: 0;
font-family: Georgia, serif;
font-size: 1.1rem;
cursor: pointer;
box-shadow: 0 8px 24px rgba(150, 90, 100, .3);
transition: .3s;
}
#openBtn:hover, #openBtn:active {
background: #e58aa4;
color: #fff;
transform: translateY(-2px);
}
@keyframes fade {
from { opacity: 0; }
to { opacity: 1; }
}
/* ==================== MOBILE PHONE FRAME ==================== */
#app {
width: 100%;
max-width: 460px;
min-height: 100vh;
background-color: var(--bg-cream);
position: relative;
padding-bottom: 84px;
box-shadow: 0 0 40px rgba(70, 50, 54, 0.08);
}
#app[hidden] {
display: none;
}
/* Sticky Top Header */
.mobile-header {
position: sticky;
top: 0;
z-index: 20;
background: rgba(246, 239, 234, 0.92);
backdrop-filter: blur(12px);
padding: 14px 16px 10px;
border-bottom: 1px solid rgba(223, 156, 169, 0.25);
text-align: center;
}
.header-title {
font-family: 'Playfair Display', serif;
font-size: 1.55rem;
font-weight: 700;
color: var(--text-dark);
display: inline-flex;
align-items: center;
gap: 6px;
}
.header-heart {
color: var(--rose-primary);
font-size: 1rem;
}
.header-sub {
font-size: 0.65rem;
letter-spacing: 0.24em;
text-transform: uppercase;
color: var(--text-muted);
margin-top: 1px;
}
/* Top Horizontal Quick Chips */
.top-chips {
display: flex;
gap: 8px;
overflow-x: auto;
padding: 10px 14px 4px;
scrollbar-width: none;
}
.top-chips::-webkit-scrollbar {
display: none;
}
.chip-btn {
flex-shrink: 0;
padding: 7px 14px;
border-radius: 30px;
border: none;
background: var(--bg-pill);
color: var(--text-dark);
font-family: 'Playfair Display', serif;
font-size: 0.85rem;
font-weight: 600;
cursor: pointer;
transition: 0.2s;
}
.chip-btn.active {
background: var(--rose-primary);
color: #fff;
box-shadow: 0 4px 12px rgba(223, 156, 169, 0.35);
}
/* Content Container */
.phone-body {
padding: 12px 14px 20px;
}
.view-section {
display: none;
animation: fadeView 0.28s ease;
}
.view-section.active {
display: block;
}
@keyframes fadeView {
from { opacity: 0; transform: translateY(5px); }
to { opacity: 1; transform: translateY(0); }
}
/* Bottom App Navigation Bar */
.bottom-nav {
position: fixed;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 100%;
max-width: 460px;
z-index: 30;
background: rgba(250, 246, 243, 0.96);
backdrop-filter: blur(14px);
border-top: 1px solid rgba(223, 156, 169, 0.28);
display: grid;
grid-template-columns: repeat(5, 1fr);
padding: 8px 4px 10px;
}
.bnav-btn {
background: transparent;
border: none;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 3px;
font-size: 0.68rem;
font-weight: 600;
color: var(--text-muted);
cursor: pointer;
padding: 4px 2px;
}
.bnav-btn svg {
width: 20px;
height: 20px;
stroke: var(--text-muted);
transition: 0.2s;
}
.bnav-btn.active {
color: var(--rose-deep);
}
.bnav-btn.active svg {
stroke: var(--rose-deep);
}
/* ==================== CARDS & MOBILE INPUTS ==================== */
.card {
background: var(--bg-card);
border-radius: var(--radius-lg);
padding: 16px;
margin-bottom: 14px;
box-shadow: var(--shadow-card);
border: 1px solid rgba(255, 255, 255, 0.85);
}
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 11px;
gap: 8px;
}
.card-title {
font-family: 'Playfair Display', serif;
font-size: 1.08rem;
font-weight: 600;
display: flex;
align-items: center;
gap: 7px;
}
.badge-pill {
font-size: 0.72rem;
padding: 3px 10px;
border-radius: 30px;
background: var(--bg-inner);
color: var(--text-muted);
font-weight: 600;
white-space: nowrap;
}
input[type="text"], input[type="date"], input[type="number"], select, textarea {
font-family: inherit;
font-size: 16px; /* Prevents iOS auto-zoom on tap */
color: var(--text-dark);
background: var(--bg-inner);
border: 1px solid transparent;
border-radius: 11px;
padding: 10px 12px;
width: 100%;
}
input:focus, select:focus, textarea:focus {
outline: none;
background: #FFFFFF;
border-color: var(--rose-primary);
}
textarea {
resize: vertical;
min-height: 70px;
font-size: 0.92rem;
}
.btn-soft {
background: var(--rose-primary);
color: #fff;
border: none;
border-radius: 11px;
padding: 10px 15px;
font-size: 0.86rem;
font-weight: 600;
cursor: pointer;
flex-shrink: 0;
}
.btn-soft:active {
background: var(--rose-deep);
}
.btn-outline {
background: var(--bg-inner);
color: var(--text-dark);
border: none;
border-radius: 10px;
padding: 6px 11px;
font-size: 0.76rem;
font-weight: 600;
cursor: pointer;
}
/* Checkboxes & Task Items */
.task-item {
display: flex;
align-items: center;
gap: 10px;
background: var(--bg-inner);
padding: 9px 11px;
border-radius: 12px;
margin-bottom: 8px;
}
.pastel-check {
appearance: none;
-webkit-appearance: none;
width: 22px;
height: 22px;
border-radius: 7px;
border: 2px solid var(--rose-primary);
background: #FAF6F3;
cursor: pointer;
flex-shrink: 0;
display: grid;
place-content: center;
}
.pastel-check:checked {
background: var(--rose-primary);
border-color: var(--rose-primary);
}
.pastel-check:checked::after {
content: "✓";
color: #fff;
font-size: 0.82rem;
font-weight: 700;
}
.task-text {
flex: 1;
font-size: 0.9rem;
background: transparent !important;
border: none !important;
color: var(--text-dark);
padding: 2px 0 !important;
}
.task-text.completed {
text-decoration: line-through;
color: var(--text-muted);
opacity: 0.75;
}
.del-item-btn {
background: transparent;
border: none;
color: var(--text-muted);
font-size: 1.1rem;
padding: 2px 6px;
cursor: pointer;
}
.add-row {
display: flex;
gap: 8px;
margin-top: 8px;
}
/* ==================== DAILY ROUTINE TIMELINE ==================== */
.routine-banner {
background: linear-gradient(145deg, #F3E5E8, #EAE5F3);
border-radius: 16px;
padding: 13px 14px;
margin-bottom: 14px;
border-left: 4px solid var(--rose-primary);
}
.routine-block {
background: var(--bg-card);
border-radius: 18px;
padding: 14px;
margin-bottom: 11px;
box-shadow: var(--shadow-card);
border-left: 4px solid var(--rose-primary);
transition: 0.2s;
}
.routine-block.done-block {
opacity: 0.72;
border-left-color: var(--sage-green);
}
.routine-time-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin-bottom: 8px;
}
.routine-time-badge {
font-size: 0.78rem;
font-weight: 700;
color: var(--rose-deep);
background: var(--bg-inner);
padding: 4px 10px;
border-radius: 20px;
}
.routine-items-ul {
list-style: none;
display: flex;
flex-direction: column;
gap: 5px;
padding-left: 4px;
}
.routine-items-ul li {
font-size: 0.86rem;
color: var(--text-dark);
display: flex;
align-items: flex-start;
gap: 7px;
}
.routine-items-ul li::before {
content: "•";
color: var(--rose-primary);
font-weight: 700;
}
/* Calendar Widget */
.cal-nav {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
}
.cal-nav button {
width: 30px;
height: 30px;
border-radius: 50%;
border: none;
background: var(--bg-inner);
color: var(--text-dark);
font-weight: 700;
}
.cal-grid {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 4px;
text-align: center;
font-size: 0.8rem;
}
.cal-day-name {
font-weight: 600;
color: var(--text-muted);
font-size: 0.7rem;
padding-bottom: 4px;
}
.cal-day {
aspect-ratio: 1;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
cursor: pointer;
}
.cal-day.selected {
background: var(--rose-primary);
color: #fff;
font-weight: 700;
}
/* Progress Bars */
.prog-row {
margin-bottom: 11px;
}
.prog-label {
display: flex;
justify-content: space-between;
font-size: 0.8rem;
font-weight: 600;
margin-bottom: 4px;
}
.prog-track {
height: 10px;
background: var(--bg-inner);
border-radius: 20px;
overflow: hidden;
}
.prog-fill {
height: 100%;
border-radius: 20px;
transition: width 0.35s ease;
}
/* Pillar Cards */
.pillar-card {
border-radius: 18px;
padding: 15px;
margin-bottom: 12px;
box-shadow: var(--shadow-card);
}
.pillar-iman { background: linear-gradient(145deg, #FAF6F3, #F3E9EE); border-left: 4px solid var(--rose-primary); }
.pillar-college { background: linear-gradient(145deg, #FAF6F3, #ECE9F4); border-left: 4px solid var(--lavender-muted); }
.pillar-career { background: linear-gradient(145deg, #FAF6F3, #E8F1EB); border-left: 4px solid var(--sage-green); }
.pillar-project { background: linear-gradient(145deg, #FAF6F3, #F6E9E6); border-left: 4px solid var(--blush-soft); }
.pillar-business { background: linear-gradient(145deg, #FAF6F3, #EEF2EA); border-left: 4px solid #9DB8A5; }
.pillar-growth { background: linear-gradient(145deg, #FAF6F3, #F2E8EC); border-left: 4px solid #D392A0; }
.pillar-tags {
display: flex;
flex-wrap: wrap;
gap: 5px;
margin: 8px 0 10px;
}
.pillar-tag {
font-size: 0.7rem;
padding: 2px 8px;
border-radius: 20px;
background: rgba(255,255,255,0.8);
color: var(--text-muted);
}
/* Habit Matrix Mobile */
.habit-scroll {
overflow-x: auto;
padding-bottom: 6px;
}
.habit-table {
width: 100%;
border-collapse: collapse;
min-width: 780px;
}
.habit-table th, .habit-table td {
padding: 7px 4px;
text-align: center;
border-bottom: 1px solid var(--bg-inner);
font-size: 0.75rem;
}
.habit-table td:first-child, .habit-table th:first-child {
text-align: left;
padding-left: 6px;
font-weight: 600;
min-width: 128px;
position: sticky;
left: 0;
background: var(--bg-card);
z-index: 2;
}
.habit-cell-btn {
width: 22px;
height: 22px;
border-radius: 6px;
border: 1.5px solid #DCC5C9;
background: #FAF6F3;
color: transparent;
font-size: 0.72rem;
cursor: pointer;
}
.habit-cell-btn.checked {
background: var(--rose-primary);
border-color: var(--rose-primary);
color: #fff;
}
.lined-notes {
background-color: #EFEBF5;
background-image: repeating-linear-gradient(transparent, transparent 27px, rgba(182, 168, 206, 0.35) 28px);
line-height: 28px;
padding: 4px 10px;
min-height: 115px;
}
.status-pill {
padding: 3px 9px;
border-radius: 20px;
font-size: 0.72rem;
font-weight: 600;
display: inline-block;
}
.st-progress { background: var(--lavender-soft); color: #5C4E78; }
.st-done { background: var(--sage-soft); color: #3D5E46; }
.st-planned { background: var(--bg-inner); color: var(--text-muted); }
</style>
</head>
<body>
<!-- ==================== 1. OPENING COVER ==================== -->
<div id="cover"><button id="openBtn">Open My Planner</button></div>
<!-- ==================== MOBILE PHONE PLANNER ==================== -->
<div id="app" hidden>
<!-- Mobile Top Header -->
<header class="mobile-header">
<div class="header-title">Digital Planner <span class="header-heart">♡</span></div>
<div class="header-sub">2027 — BEGIN TO BLOOM · SUHA</div>
<!-- Horizontal Quick View Chips -->
<div class="top-chips">
<button class="chip-btn active" data-view="dashboard">Dashboard</button>
<button class="chip-btn" data-view="routine">🌷 My Routine</button>
<button class="chip-btn" data-view="daily">Daily Plan</button>
<button class="chip-btn" data-view="weekly">Weekly</button>
<button class="chip-btn" data-view="monthly">Monthly</button>
<button class="chip-btn" data-view="yearly">Yearly 2027</button>
<button class="chip-btn" data-view="habits">Habits</button>
<button class="chip-btn" data-view="goals">Goals</button>
<button class="chip-btn" data-view="business">Projects & Biz</button>
</div>
</header>
<main class="phone-body">
<!-- ==================== 1. DASHBOARD VIEW ==================== -->
<section id="view-dashboard" class="view-section active">
<!-- Gentle Reminder Card -->
<div class="routine-banner">
<div style="font-size: 0.72rem; font-weight: 700; color: var(--rose-deep); letter-spacing: 0.08em; text-transform: uppercase;">🌸 Daily Reminder</div>
<div class="serif" style="font-size: 1.02rem; margin-top: 3px;">Small progress every day is better than waiting for a perfect day.</div>
<div style="font-size: 0.78rem; color: var(--text-muted); margin-top: 4px;">Daily Goal: Complete important tasks by 11:00 PM.</div>
</div>
<!-- Monthly Calendar -->
<div class="card">
<div class="card-header">
<div class="card-title">Monthly Overview</div>
<span class="badge-pill" id="dash-selected-date-label">Jan 1, 2027</span>
</div>
<div class="cal-nav">
<button id="cal-prev-btn">‹</button>
<strong class="serif" id="cal-month-year">January 2027</strong>
<button id="cal-next-btn">›</button>
</div>
<div class="cal-grid" id="dash-calendar-grid"></div>
</div>
<!-- Today's Routine Preview Card -->
<div class="card">
<div class="card-header">
<div class="card-title">🌷 My Daily Routine</div>
<button class="btn-outline" onclick="switchView('routine')">Full Schedule →</button>
</div>
<div id="dash-routine-preview"></div>
</div>
<!-- Daily Goals -->
<div class="card">
<div class="card-header">
<div class="card-title">◎ Daily Goals</div>
</div>
<div id="dash-daily-goals-list"></div>
<div class="add-row">
<input type="text" id="new-daily-goal-input" placeholder="Add a daily goal...">
<button class="btn-soft" id="add-daily-goal-btn">Add</button>
</div>
</div>
<!-- To-Do List -->
<div class="card">
<div class="card-header">
<div class="card-title">✓ To-Do List</div>
<span class="badge-pill" id="dash-todo-count">0/0</span>
</div>
<div id="dash-todo-list"></div>
<div class="add-row">
<input type="text" id="new-dash-todo" placeholder="Add a task...">
<button class="btn-soft" id="add-dash-todo-btn">+</button>
</div>
</div>
<!-- Goals & Progress -->
<div class="card">
<div class="card-header">
<div class="card-title">Goals & Progress</div>
<button class="btn-outline" onclick="switchView('goals')">Details</button>
</div>
<div id="dash-goals-bars"></div>
</div>
<!-- Quick Notes & Duas -->
<div class="card">
<div class="card-header">
<div class="card-title">✎ Notes & Duas</div>
</div>
<textarea id="dash-notes-area" class="lined-notes" placeholder="Write reminders, duas, or thoughts..."></textarea>
</div>
<!-- 6 Life Categories -->
<h2 class="serif" style="font-size: 1.25rem; margin: 18px 2px 10px;">My 2027 Life Categories</h2>
<div id="dash-pillars-grid"></div>
<!-- Reset Button -->
<div style="text-align: center; margin: 18px 0 6px;">
<button id="reset-planner-btn" style="background:transparent; border:1px dashed var(--rose-deep); color:var(--text-muted); padding:9px 20px; border-radius:30px; font-size:0.8rem;">Reset Planner Data</button>
</div>
</section>
<!-- ==================== 2. MY DAILY ROUTINE VIEW ==================== -->
<section id="view-routine" class="view-section">
<div class="routine-banner">
<div style="display:flex; justify-content:space-between; align-items:center;">
<h2 class="serif" style="font-size: 1.22rem;">🌷 My Daily Routine</h2>
<span class="badge-pill" id="routine-progress-pill">0/11 Done</span>
</div>
<p style="font-size: 0.8rem; color: var(--text-dark); margin-top: 6px;">
<strong>Daily goal:</strong> Complete important tasks by 11:00 PM.<br>
<span style="color: var(--text-muted);">Prayer times can be adjusted according to the actual Salah timings.</span>
</p>
</div>
<div id="routine-timeline-list"></div>
<!-- Add Custom Routine Slot -->
<div class="card">
<div class="card-title" style="margin-bottom: 10px;">+ Add Custom Time Block</div>
<div style="display: flex; flex-direction: column; gap: 8px;">
<input type="text" id="new-rt-time" placeholder="Time (e.g., 4:30 PM – 5:00 PM)">
<input type="text" id="new-rt-items" placeholder="Activities (comma separated)">
<button class="btn-soft" id="add-rt-btn" style="width: 100%;">Add Routine Block</button>
</div>
</div>
<div class="card" style="text-align: center; background: linear-gradient(145deg, #FAF6F3, #F3E9EE);">
<p class="serif" style="font-style: italic; font-size: 1rem;">“Small progress every day is better than waiting for a perfect day. 🌸”</p>
</div>
</section>
<!-- ==================== 3. DAILY PLANNER VIEW ==================== -->
<section id="view-daily" class="view-section">
<div class="card">
<div class="card-header">
<h2 class="serif" style="font-size: 1.18rem;">Daily Journal</h2>
<input type="date" id="daily-date-picker" value="2027-01-01" min="2027-01-01" max="2027-12-31" style="width: 155px; padding: 7px 10px;">
</div>
<div style="font-size: 0.78rem; color: var(--text-muted);">Target: Complete important tasks by 11:00 PM ✦</div>
</div>
<div class="card">
<div class="card-header">
<div class="card-title">✦ Daily Top 3 Priorities</div>
</div>
<div id="daily-top3-list"></div>
</div>
<div class="card">
<div class="card-header">
<div class="card-title">☾ Prayer & Quran Checklist</div>
<span class="badge-pill" id="daily-prayer-badge">0/6</span>
</div>
<div id="daily-prayer-list"></div>
</div>
<div id="daily-category-tasks-col"></div>
<div class="card">
<div class="card-header">
<div class="card-title">✎ Gratitude & Reflection</div>
</div>
<label style="font-size: 0.78rem; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 4px;">Alhamdulillah — Today I am grateful for:</label>
<textarea id="daily-gratitude" placeholder="Write your blessings..."></textarea>
<label style="font-size: 0.78rem; font-weight: 600; color: var(--text-muted); display: block; margin: 10px 0 4px;">Evening Reflection (11:00 PM Review):</label>
<textarea id="daily-notes" placeholder="How did today go? Tomorrow's priority..."></textarea>
</div>
</section>
<!-- ==================== 4. WEEKLY PLANNER VIEW ==================== -->
<section id="view-weekly" class="view-section">
<div class="card">
<div class="card-header">
<h2 class="serif" style="font-size: 1.18rem;">Weekly Planner</h2>
<select id="week-select" style="width: 155px; padding: 7px 10px;"></select>
</div>
</div>
<div id="weekly-sections-grid"></div>
<div class="card">
<div class="card-header">
<div class="card-title">✿ Weekly Review</div>
</div>
<textarea id="weekly-review-text" placeholder="Reflect on your week..."></textarea>
</div>
</section>
<!-- ==================== 5. MONTHLY PLANNER VIEW ==================== -->
<section id="view-monthly" class="view-section">
<div class="card">
<div class="card-header">
<h2 class="serif" style="font-size: 1.18rem;">Monthly Plan</h2>
<select id="monthly-select" style="width: 155px; padding: 7px 10px;"></select>
</div>
</div>
<div id="monthly-categories-grid"></div>
</section>
<!-- ==================== 6. YEARLY PLANNER VIEW ==================== -->
<section id="view-yearly" class="view-section">
<div class="card">
<div class="card-header">
<h2 class="serif" style="font-size: 1.18rem;">2027 Yearly Overview</h2>
<span class="badge-pill" id="yearly-avg-badge">Avg: 0%</span>
</div>
<div id="yearly-chart-bars" style="display:grid; grid-template-columns: repeat(12, 1fr); gap: 5px; align-items: flex-end; height: 110px; background: var(--bg-inner); padding: 10px 6px 4px; border-radius: 14px;"></div>
</div>
<div id="yearly-months-grid"></div>
</section>
<!-- ==================== 7. HABIT TRACKER VIEW ==================== -->
<section id="view-habits" class="view-section">
<div class="card">
<div class="card-header">
<h2 class="serif" style="font-size: 1.18rem;">Habit Tracker</h2>
<select id="habit-month-select" style="width: 150px; padding: 7px 10px;"></select>
</div>
<p style="font-size: 0.76rem; color: var(--text-muted); margin-bottom: 10px;">Swipe left/right on the table to check off all days of the month.</p>
<div class="habit-scroll">
<table class="habit-table" id="habit-matrix-table"></table>
</div>
</div>
</section>
<!-- ==================== 8. GOALS & PROGRESS VIEW ==================== -->
<section id="view-goals" class="view-section">
<div class="card">
<h2 class="serif" style="font-size: 1.18rem;">2027 Goals & Progress</h2>
<p style="font-size: 0.8rem; color: var(--text-muted);">Track Iman, College, Career, Projects, Business & Personal Growth.</p>
</div>
<div id="goals-detailed-grid"></div>
</section>
<!-- ==================== 9. PROJECTS & BUSINESS VIEW ==================== -->
<section id="view-business" class="view-section">
<div class="card">
<div class="card-header">
<h2 class="serif" style="font-size: 1.15rem;">Projects & Milestones</h2>
</div>
<div style="display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px;">
<input type="text" id="proj-name" placeholder="Project Name (e.g. Final-Year Project)">
<input type="text" id="proj-milestone" placeholder="Milestone">
<input type="text" id="proj-task" placeholder="Next Task">
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 8px;">
<input type="date" id="proj-deadline" value="2027-02-28">
<select id="proj-status">
<option value="In Progress">In Progress</option>
<option value="Planned">Planned</option>
<option value="Completed">Completed</option>
</select>
</div>
<button class="btn-soft" id="add-proj-btn">+ Add Project</button>
</div>
<div id="projects-cards-list"></div>
</div>
<div class="card">
<div class="card-header">
<h3 class="serif" style="font-size: 1.12rem;">Zero-Investment Digital Service</h3>
</div>
<div style="display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px;">
<input type="text" id="biz-idea" placeholder="Business Idea">
<input type="text" id="biz-service" placeholder="Service Offered">
<input type="text" id="biz-sample" placeholder="Portfolio Sample">
<input type="text" id="biz-action" placeholder="Customer Action">
<button class="btn-soft" id="add-biz-btn">+ Add Service Item</button>
</div>
<div id="biz-items-list"></div>
</div>
<div class="card">
<div class="card-header">
<h3 class="serif" style="font-size: 1.12rem;">Income & Expenses</h3>
<span class="badge-pill" id="net-profit-badge">Net: $0.00</span>
</div>
<div style="display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px;">
<input type="text" id="fin-desc" placeholder="Description">
<div style="display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px;">
<select id="fin-type">
<option value="income">Income (+)</option>
<option value="expense">Expense (-)</option>
</select>
<input type="number" id="fin-amount" placeholder="Amount" min="0" step="0.01">
<button class="btn-soft" id="add-fin-btn">+</button>
</div>
</div>
<div id="fin-ledger-list"></div>
</div>
</section>
</main>
<!-- Bottom Thumb-Friendly Navigation -->
<nav class="bottom-nav">
<button class="bnav-btn active" data-view="dashboard">
<svg viewBox="0 0 24 24" fill="none" stroke-width="2"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
<span>Home</span>
</button>
<button class="bnav-btn" data-view="routine">
<svg viewBox="0 0 24 24" fill="none" stroke-width="2"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
<span>Routine</span>
</button>
<button class="bnav-btn" data-view="daily">
<svg viewBox="0 0 24 24" fill="none" stroke-width="2"><polyline points="9 11 12 14 22 4"/><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"/></svg>
<span>Daily</span>
</button>
<button class="bnav-btn" data-view="habits">
<svg viewBox="0 0 24 24" fill="none" stroke-width="2"><path d="M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z"/></svg>
<span>Habits</span>
</button>
<button class="bnav-btn" data-view="goals">
<svg viewBox="0 0 24 24" fill="none" stroke-width="2"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="4"/></svg>
<span>Goals</span>
</button>
</nav>
</div>
<script>
/* ==================== STORAGE & DEFAULT ROUTINE ==================== */
const STORAGE_KEY = 'suha_2027_mobile_planner_v1';
const MONTHS = [
'January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December'
];
const DAYS_IN_MONTH_2027 = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
const DEFAULT_ROUTINE = [
{
id: 1,
time: '5:00 AM – 5:20 AM',
items: ['Wake up for Fajr', 'Perform Fajr Salah', 'Read Quran', 'Go back to sleep'],
done: false
},
{
id: 2,
time: '7:15 AM – 8:05 AM',
items: ['Wake up', 'Freshen up and get ready', 'Breakfast', 'Prepare college bag', 'Leave for bus stop at 8:05 AM'],
done: false
},
{
id: 3,
time: '8:20 AM – 1:45 PM',
items: ['College', 'Attend classes', 'Complete class notes', 'Participate in academic activities'],
done: false
},
{
id: 4,
time: '1:45 PM – 2:30 PM',
items: ['Return home', 'Freshen up', 'Lunch', 'Relax'],
done: false
},
{
id: 5,
time: '2:30 PM – 3:30 PM',
items: ['Short nap and rest'],
done: false
},
{
id: 6,
time: '3:30 PM – 5:00 PM',
items: ['English speaking practice', 'Python programming', 'College assignments and classwork'],
done: false
},
{
id: 7,
time: '5:00 PM – 6:30 PM',
items: ['Asr Salah', 'Cybersecurity learning', 'SOC Analyst roadmap', 'Practical labs and security tools'],
done: false
},
{
id: 8,
time: '6:30 PM – 7:30 PM',
items: ['Maghrib Salah', 'Quran reading', 'Internship tasks and project development'],
done: false
},
{
id: 9,
time: '7:30 PM – 9:00 PM',
items: ['Interview preparation', 'Technical questions', 'Final-year project', 'Security automation practice'],
done: false
},
{
id: 10,
time: '9:00 PM – 10:00 PM',
items: ['Isha Salah', 'Dinner', 'Family time and relaxation'],
done: false
},
{
id: 11,
time: '10:00 PM – 11:00 PM',
items: ['College revision', 'CA 2 preparation', 'Complete pending assignments'],
done: false
},
{
id: 12,
time: '11:00 PM – 12:00 AM',
items: ['Personal development', 'Review daily progress', "Prepare tomorrow's tasks", 'Journal and reflection'],
done: false
},
{
id: 13,
time: '12:00 AM – 12:30 AM',
items: ['Get ready for bed', 'Sleep'],
done: false
}
];
const CATEGORIES = [
{
id: 'iman',
name: 'Iman',
cssClass: 'pillar-iman',
color: '#DF9CA9',
tags: ['Fajr to Isha Salah', 'Quran', 'Dua', 'Gratitude'],
desc: 'Strengthening my Iman and relationship with Allah every single day.'
},
{
id: 'college',
name: 'College',
cssClass: 'pillar-college',
color: '#B6A8CE',
tags: ['Classes & Notes', 'CA 2 Prep', 'Assignments', 'Revision'],
desc: 'Completing my college studies, CA 2 preparation, and assignments with focus.'
},
{
id: 'career',
name: 'Career & Cyber/AI',
cssClass: 'pillar-career',
color: '#A7C2AE',
tags: ['Make & M8A Academy', 'SOC Analyst', 'Python', 'Security Automation'],
desc: 'Building practical AI, workflow automation, Python, and SOC Analyst skills.'
},
{
id: 'project',
name: 'Project',
cssClass: 'pillar-project',
color: '#E5A3AF',
tags: ['Final-Year Project', 'Internship Tasks', 'Labs & Tools'],
desc: 'Developing and completing my final-year project and hands-on builds.'
},
{
id: 'business',
name: 'Business',
cssClass: 'pillar-business',
color: '#9DB8A5',
tags: ['Zero-Investment', 'Portfolio Samples', 'Customer Actions', 'Income'],
desc: 'Starting and growing my zero-investment digital service business.'
},
{
id: 'growth',
name: 'Personal Growth',
cssClass: 'pillar-growth',
color: '#D392A0',
tags: ['English Speaking', 'Interview Prep', 'Rest & Sleep', 'Discipline'],
desc: 'Improving confidence, English speaking fluency, rest, and steady discipline.'
}
];
const HABIT_LIST = [
'Salah (5 Daily)',
'Quran Reading',
'Dua & Dhikr',
'College Study & CA 2',
'Python & Cyber Labs',
'Make / M8A Academy',
'Project Work',
'English Speaking',
'Business Action',
'Water (2L)',
'Sleep by 12:30 AM'
];
function createInitialState() {
const yearly = MONTHS.map((m) => ({
month: m,
theme: '',
goals: '',
tasks: '',
progress: 0,
reflection: ''
}));
const monthly = {};
MONTHS.forEach((_, mIdx) => {
monthly[mIdx] = {};
CATEGORIES.forEach(cat => {
monthly[mIdx][cat.id] = { goal: '', tasks: [] };
});
});
return {
selectedMonth: 0,
selectedDate: '2027-01-01',
selectedWeek: 1,
habitMonth: 0,
routine: JSON.parse(JSON.stringify(DEFAULT_ROUTINE)),
dashTodos: [],
dailyGoals: [
{ id: 1, text: 'Complete important tasks by 11:00 PM', done: false }
],
dashNotes: 'Small progress every day is better than waiting for a perfect day. 🌸',
yearly,
monthly,
weekly: {},
daily: {},
habits: {},
categoryGoals: {
iman: [],
college: [],
career: [],
project: [],
business: [],
growth: []
},
projects: [],
businessItems: [],
ledger: []
};
}
let state = loadState();
function loadState() {
try {
const saved = localStorage.getItem(STORAGE_KEY);
if (saved) return JSON.parse(saved);
} catch (e) {}
return createInitialState();
}
function saveState() {
try {
localStorage.setItem(STORAGE_KEY, JSON.stringify(state));
} catch (e) {}
}
/* ==================== COVER & NAVIGATION ==================== */
document.getElementById('openBtn').onclick = () => {
const c = document.getElementById('cover');
c.classList.add('go');
document.getElementById('app').hidden = false;
render();
setTimeout(() => c.remove(), 1000);
};
function switchView(viewName) {
document.querySelectorAll('.chip-btn').forEach(btn => {
btn.classList.toggle('active', btn.dataset.view === viewName);
});
document.querySelectorAll('.bnav-btn').forEach(btn => {
btn.classList.toggle('active', btn.dataset.view === viewName);
});
document.querySelectorAll('.view-section').forEach(sec => {
sec.classList.toggle('active', sec.id === `view-${viewName}`);
});
window.scrollTo({ top: 0, behavior: 'smooth' });
renderActiveView(viewName);
}
document.querySelectorAll('.chip-btn, .bnav-btn').forEach(btn => {
btn.addEventListener('click', () => switchView(btn.dataset.view));
});
document.getElementById('reset-planner-btn').addEventListener('click', () => {
if (confirm('Reset all tasks, goals, and notes? Your daily routine schedule will remain ready.')) {
localStorage.removeItem(STORAGE_KEY);
state = createInitialState();
saveState();
render();
}
});
/* ==================== ROUTINE RENDERING ==================== */
function renderRoutine() {
const list = document.getElementById('routine-timeline-list');
const preview = document.getElementById('dash-routine-preview');
list.innerHTML = '';
preview.innerHTML = '';
const doneCount = state.routine.filter(r => r.done).length;
document.getElementById('routine-progress-pill').textContent = `${doneCount}/${state.routine.length} Done`;
state.routine.forEach((slot, idx) => {
const block = document.createElement('div');
block.className = `routine-block ${slot.done ? 'done-block' : ''}`;
block.innerHTML = `
<div class="routine-time-row">
<span class="routine-time-badge">${escapeHtml(slot.time)}</span>
<div style="display:flex; align-items:center; gap:8px;">
<input type="checkbox" class="pastel-check" ${slot.done ? 'checked' : ''}>
<button class="del-item-btn" title="Delete slot">×</button>
</div>
</div>
<ul class="routine-items-ul">
${slot.items.map(it => `<li><span>${escapeHtml(it)}</span></li>`).join('')}
</ul>
`;
block.querySelector('.pastel-check').addEventListener('change', (e) => {
state.routine[idx].done = e.target.checked;
saveState();
renderRoutine();
});
block.querySelector('.del-item-btn').addEventListener('click', () => {
state.routine.splice(idx, 1);
saveState();
renderRoutine();
});
list.appendChild(block);
// Show first 3 unchecked or first 3 blocks on dashboard preview
if (idx < 3) {
const pRow = document.createElement('div');
pRow.className = 'task-item';
pRow.innerHTML = `
<input type="checkbox" class="pastel-check" ${slot.done ? 'checked' : ''}>
<div style="flex:1; font-size:0.83rem;">
<strong style="color:var(--rose-deep);">${escapeHtml(slot.time)}</strong><br>
<span style="color:var(--text-muted);">${escapeHtml(slot.items.slice(0, 2).join(' · '))}</span>
</div>
`;
pRow.querySelector('.pastel-check').addEventListener('change', (e) => {
state.routine[idx].done = e.target.checked;
saveState();
renderRoutine();
});
preview.appendChild(pRow);
}
});
}
document.getElementById('add-rt-btn').addEventListener('click', () => {
const time = document.getElementById('new-rt-time').value.trim();
const rawItems = document.getElementById('new-rt-items').value.trim();
if (!time || !rawItems) return;
const items = rawItems.split(',').map(s => s.trim()).filter(Boolean);
state.routine.push({ id: Date.now(), time, items, done: false });
document.getElementById('new-rt-time').value = '';
document.getElementById('new-rt-items').value = '';
saveState();
renderRoutine();
});
/* ==================== PROGRESS CALCULATION ==================== */
function getCategoryStats(catId) {
const goals = state.categoryGoals[catId] || [];
let total = goals.length;
let completed = goals.filter(g => g.done).length;
const mTasks = state.monthly[state.selectedMonth]?.[catId]?.tasks || [];
total += mTasks.length;
completed += mTasks.filter(t => t.done).length;
const pct = total === 0 ? 0 : Math.round((completed / total) * 100);
return { total, completed, remaining: total - completed, pct };
}
/* ==================== DASHBOARD RENDERING ==================== */
function renderCalendar() {
const m = state.selectedMonth;
document.getElementById('cal-month-year').textContent = `${MONTHS[m]} 2027`;
const grid = document.getElementById('dash-calendar-grid');
grid.innerHTML = '';
['M', 'T', 'W', 'T', 'F', 'S', 'S'].forEach(d => {
const el = document.createElement('div');
el.className = 'cal-day-name';
el.textContent = d;
grid.appendChild(el);
});
const firstDayJS = new Date(2027, m, 1).getDay();
const offset = (firstDayJS + 6) % 7;
for (let i = 0; i < offset; i++) {
const empty = document.createElement('div');
empty.className = 'cal-day';
grid.appendChild(empty);
}
const daysCount = DAYS_IN_MONTH_2027[m];
for (let d = 1; d <= daysCount; d++) {
const cell = document.createElement('div');
cell.className = 'cal-day';
const iso = `2027-${String(m + 1).padStart(2, '0')}-${String(d).padStart(2, '0')}`;
if (state.selectedDate === iso) cell.classList.add('selected');
cell.textContent = d;
cell.addEventListener('click', () => {
state.selectedDate = iso;
saveState();
document.getElementById('dash-selected-date-label').textContent = `${MONTHS[m].slice(0, 3)} ${d}, 2027`;
document.getElementById('daily-date-picker').value = iso;
renderCalendar();
});
grid.appendChild(cell);
}
}
document.getElementById('cal-prev-btn').addEventListener('click', () => {
state.selectedMonth = (state.selectedMonth + 11) % 12;
saveState();
renderCalendar();
renderDashGoalBars();
renderPillarsGrid();
});
document.getElementById('cal-next-btn').addEventListener('click', () => {
state.selectedMonth = (state.selectedMonth + 1) % 12;
saveState();
renderCalendar();
renderDashGoalBars();
renderPillarsGrid();
});
function renderDashTodos() {
const list = document.getElementById('dash-todo-list');
list.innerHTML = '';
const doneCount = state.dashTodos.filter(t => t.done).length;
document.getElementById('dash-todo-count').textContent = `${doneCount}/${state.dashTodos.length}`;
state.dashTodos.forEach((item, idx) => {
const row = document.createElement('div');
row.className = 'task-item';
row.innerHTML = `
<input type="checkbox" class="pastel-check" ${item.done ? 'checked' : ''}>
<input type="text" class="task-text ${item.done ? 'completed' : ''}" value="${escapeHtml(item.text)}">
<button class="del-item-btn">×</button>
`;
row.querySelector('.pastel-check').addEventListener('change', e => {
state.dashTodos[idx].done = e.target.checked;
saveState();
renderDashTodos();
});
row.querySelector('.task-text').addEventListener('change', e => {
state.dashTodos[idx].text = e.target.value;
saveState();
});
row.querySelector('.del-item-btn').addEventListener('click', () => {
state.dashTodos.splice(idx, 1);
saveState();
renderDashTodos();
});
list.appendChild(row);
});
}
document.getElementById('add-dash-todo-btn').addEventListener('click', () => {
const inp = document.getElementById('new-dash-todo');
if (!inp.value.trim()) return;
state.dashTodos.push({ id: Date.now(), text: inp.value.trim(), done: false });
inp.value = '';
saveState();
renderDashTodos();
});
function renderDailyGoalsWidget() {
const list = document.getElementById('dash-daily-goals-list');
list.innerHTML = '';
state.dailyGoals.forEach((g, idx) => {
const row = document.createElement('div');
row.className = 'task-item';
row.innerHTML = `
<input type="checkbox" class="pastel-check" ${g.done ? 'checked' : ''}>
<input type="text" class="task-text ${g.done ? 'completed' : ''}" value="${escapeHtml(g.text)}">
<button class="del-item-btn">×</button>
`;
row.querySelector('.pastel-check').addEventListener('change', e => {
state.dailyGoals[idx].done = e.target.checked;
saveState();
renderDailyGoalsWidget();
});
row.querySelector('.task-text').addEventListener('change', e => {
state.dailyGoals[idx].text = e.target.value;
saveState();
});
row.querySelector('.del-item-btn').addEventListener('click', () => {
state.dailyGoals.splice(idx, 1);
saveState();
renderDailyGoalsWidget();
});
list.appendChild(row);
});
}
document.getElementById('add-daily-goal-btn').addEventListener('click', () => {
const inp = document.getElementById('new-daily-goal-input');
if (!inp.value.trim()) return;
state.dailyGoals.push({ id: Date.now(), text: inp.value.trim(), done: false });
inp.value = '';
saveState();
renderDailyGoalsWidget();
});
function renderDashGoalBars() {
const wrap = document.getElementById('dash-goals-bars');
wrap.innerHTML = '';
CATEGORIES.forEach(cat => {
const stats = getCategoryStats(cat.id);
const row = document.createElement('div');
row.className = 'prog-row';
row.innerHTML = `
<div class="prog-label">
<span>${cat.name}</span>
<span style="color: var(--text-muted);">${stats.pct}%</span>
</div>
<div class="prog-track">
<div class="prog-fill" style="width: ${stats.pct}%; background: ${cat.color};"></div>
</div>
`;
wrap.appendChild(row);
});
}
const dashNotesEl = document.getElementById('dash-notes-area');
dashNotesEl.value = state.dashNotes || '';
dashNotesEl.addEventListener('input', e => {
state.dashNotes = e.target.value;
saveState();
});
function renderPillarsGrid() {
const grid = document.getElementById('dash-pillars-grid');
grid.innerHTML = '';
CATEGORIES.forEach(cat => {
const stats = getCategoryStats(cat.id);
const card = document.createElement('div');
card.className = `pillar-card ${cat.cssClass}`;
card.innerHTML = `
<div style="display:flex; justify-content:space-between; align-items:center;">
<h3 class="serif" style="font-size:1.12rem;">${cat.name}</h3>
<span class="badge-pill">${stats.pct}%</span>
</div>
<div class="pillar-tags">
${cat.tags.map(t => `<span class="pillar-tag">${t}</span>`).join('')}
</div>
<p style="font-size:0.8rem; color:var(--text-muted); margin-bottom:10px;">${cat.desc}</p>
<div class="prog-track" style="margin-bottom:10px;">
<div class="prog-fill" style="width:${stats.pct}%; background:${cat.color};"></div>
</div>
<button class="btn-outline" style="width:100%;" onclick="switchView('monthly')">Plan ${cat.name} →</button>
`;
grid.appendChild(card);
});
}
/* ==================== YEARLY PLANNER ==================== */
function renderYearlyView() {
const chart = document.getElementById('yearly-chart-bars');
const grid = document.getElementById('yearly-months-grid');
chart.innerHTML = '';
grid.innerHTML = '';
let sumPct = 0;
state.yearly.forEach((mObj, idx) => {
sumPct += Number(mObj.progress || 0);
const col = document.createElement('div');
col.style.cssText = 'display:flex; flex-direction:column; align-items:center; height:100%; justify-content:flex-end; gap:4px;';
col.innerHTML = `
<div style="width:100%; background:linear-gradient(180deg, var(--rose-primary), var(--lavender-muted)); border-radius:6px 6px 2px 2px; height:${Math.max(6, mObj.progress)}%;"></div>
<span style="font-size:0.62rem; font-weight:600;">${mObj.month.slice(0, 1)}</span>
`;
chart.appendChild(col);
const card = document.createElement('div');
card.className = 'card';
card.innerHTML = `
<div class="card-header">
<h3 class="serif" style="font-size:1.08rem;">${mObj.month} 2027</h3>
<span class="badge-pill">${mObj.progress}%</span>
</div>
<div style="display:flex; flex-direction:column; gap:8px;">
<input type="text" class="yr-theme" placeholder="Monthly Theme..." value="${escapeHtml(mObj.theme)}">
<textarea class="yr-goals" style="min-height:50px;" placeholder="Main Goals...">${escapeHtml(mObj.goals)}</textarea>
<input type="text" class="yr-tasks" placeholder="Important Tasks..." value="${escapeHtml(mObj.tasks)}">
<input type="range" min="0" max="100" value="${mObj.progress}" class="yr-range" style="accent-color:var(--rose-primary);">
<input type="text" class="yr-refl" placeholder="Monthly Reflection..." value="${escapeHtml(mObj.reflection)}">
</div>
`;
card.querySelector('.yr-theme').addEventListener('input', e => { state.yearly[idx].theme = e.target.value; saveState(); });
card.querySelector('.yr-goals').addEventListener('input', e => { state.yearly[idx].goals = e.target.value; saveState(); });
card.querySelector('.yr-tasks').addEventListener('input', e => { state.yearly[idx].tasks = e.target.value; saveState(); });
card.querySelector('.yr-refl').addEventListener('input', e => { state.yearly[idx].reflection = e.target.value; saveState(); });
card.querySelector('.yr-range').addEventListener('input', e => {
state.yearly[idx].progress = Number(e.target.value);
saveState();
renderYearlyView();
});
grid.appendChild(card);
});
document.getElementById('yearly-avg-badge').textContent = `Avg: ${Math.round(sumPct / 12)}%`;
}
/* ==================== MONTHLY PLANNER ==================== */
const monthlySelect = document.getElementById('monthly-select');
MONTHS.forEach((m, i) => {
const opt = document.createElement('option');
opt.value = i;
opt.textContent = `${m} 2027`;
monthlySelect.appendChild(opt);
});
monthlySelect.addEventListener('change', e => {
state.selectedMonth = Number(e.target.value);
saveState();
renderMonthlyView();
renderDashGoalBars();
});
function renderMonthlyView() {
monthlySelect.value = state.selectedMonth;
const mIdx = state.selectedMonth;
const grid = document.getElementById('monthly-categories-grid');
grid.innerHTML = '';
CATEGORIES.forEach(cat => {
const data = state.monthly[mIdx][cat.id];
const done = data.tasks.filter(t => t.done).length;
const pct = data.tasks.length ? Math.round((done / data.tasks.length) * 100) : 0;
const card = document.createElement('div');
card.className = `card ${cat.cssClass}`;
card.innerHTML = `
<div class="card-header">
<h3 class="serif" style="font-size:1.08rem;">${cat.name}</h3>
<span class="badge-pill">${pct}%</span>
</div>
<input type="text" class="m-goal-inp" style="margin-bottom:10px;" placeholder="${MONTHS[mIdx]} ${cat.name} goal..." value="${escapeHtml(data.goal)}">
<div class="prog-track" style="margin-bottom:10px;">
<div class="prog-fill" style="width:${pct}%; background:${cat.color};"></div>
</div>
<div class="m-tasks-wrap"></div>
<div class="add-row">
<input type="text" class="m-new-task" placeholder="Add task...">
<button class="btn-soft m-add-btn">+</button>
</div>
`;
card.querySelector('.m-goal-inp').addEventListener('input', e => {
state.monthly[mIdx][cat.id].goal = e.target.value;
saveState();
});
const tasksWrap = card.querySelector('.m-tasks-wrap');
data.tasks.forEach((t, tIdx) => {
const row = document.createElement('div');
row.className = 'task-item';
row.innerHTML = `
<input type="checkbox" class="pastel-check" ${t.done ? 'checked' : ''}>
<input type="text" class="task-text ${t.done ? 'completed' : ''}" value="${escapeHtml(t.text)}">
<button class="del-item-btn">×</button>
`;
row.querySelector('.pastel-check').addEventListener('change', e => {
state.monthly[mIdx][cat.id].tasks[tIdx].done = e.target.checked;
saveState();
renderMonthlyView();
renderDashGoalBars();
});
row.querySelector('.task-text').addEventListener('change', e => {
state.monthly[mIdx][cat.id].tasks[tIdx].text = e.target.value;
saveState();
});
row.querySelector('.del-item-btn').addEventListener('click', () => {
state.monthly[mIdx][cat.id].tasks.splice(tIdx, 1);
saveState();
renderMonthlyView();
renderDashGoalBars();
});
tasksWrap.appendChild(row);
});
card.querySelector('.m-add-btn').addEventListener('click', () => {
const inp = card.querySelector('.m-new-task');
if (!inp.value.trim()) return;
state.monthly[mIdx][cat.id].tasks.push({ id: Date.now(), text: inp.value.trim(), done: false });
saveState();
renderMonthlyView();
renderDashGoalBars();
});
grid.appendChild(card);
});
}
/* ==================== WEEKLY PLANNER ==================== */
const weekSelect = document.getElementById('week-select');
for (let w = 1; w <= 52; w++) {
const opt = document.createElement('option');
opt.value = w;
opt.textContent = `Week ${w} (2027)`;
weekSelect.appendChild(opt);
}
weekSelect.addEventListener('change', e => {
state.selectedWeek = Number(e.target.value);
saveState();
renderWeeklyView();
});
function ensureWeekData(w) {
if (!state.weekly[w]) {
state.weekly[w] = { priorities: [], study: [], automation: [], project: [], business: [], iman: [], review: '' };
}
return state.weekly[w];
}
function renderWeeklyView() {
weekSelect.value = state.selectedWeek;
const wData = ensureWeekData(state.selectedWeek);
const grid = document.getElementById('weekly-sections-grid');
grid.innerHTML = '';
const sections = [
{ key: 'priorities', title: '✦ Weekly Top 3 Priorities', placeholder: 'Add priority...' },
{ key: 'study', title: '✎ College & CA 2 Study', placeholder: 'Add study task...' },
{ key: 'automation', title: '⚙ AI, Python & Cyber Labs', placeholder: 'Add learning task...' },
{ key: 'project', title: '❖ Final-Year & Personal Projects', placeholder: 'Add project task...' },
{ key: 'business', title: '✿ Zero-Investment Business', placeholder: 'Add business task...' },
{ key: 'iman', title: '☾ Iman Goals', placeholder: 'Add Iman goal...' }
];
sections.forEach(sec => {
const card = document.createElement('div');
card.className = 'card';
card.innerHTML = `
<div class="card-header"><div class="card-title" style="font-size:1rem;">${sec.title}</div></div>
<div class="w-list"></div>
<div class="add-row">
<input type="text" class="w-inp" placeholder="${sec.placeholder}">
<button class="btn-soft w-btn">+</button>
</div>
`;
const listEl = card.querySelector('.w-list');
wData[sec.key].forEach((item, idx) => {
const row = document.createElement('div');
row.className = 'task-item';
row.innerHTML = `
<input type="checkbox" class="pastel-check" ${item.done ? 'checked' : ''}>
<input type="text" class="task-text ${item.done ? 'completed' : ''}" value="${escapeHtml(item.text)}">
<button class="del-item-btn">×</button>
`;
row.querySelector('.pastel-check').addEventListener('change', e => {
wData[sec.key][idx].done = e.target.checked;
saveState();
renderWeeklyView();
});
row.querySelector('.task-text').addEventListener('change', e => {
wData[sec.key][idx].text = e.target.value;
saveState();
});
row.querySelector('.del-item-btn').addEventListener('click', () => {
wData[sec.key].splice(idx, 1);
saveState();
renderWeeklyView();
});
listEl.appendChild(row);
});
card.querySelector('.w-btn').addEventListener('click', () => {
const inp = card.querySelector('.w-inp');
if (!inp.value.trim()) return;
wData[sec.key].push({ id: Date.now(), text: inp.value.trim(), done: false });
saveState();
renderWeeklyView();
});
grid.appendChild(card);
});
const revEl = document.getElementById('weekly-review-text');
revEl.value = wData.review || '';
revEl.oninput = e => { wData.review = e.target.value; saveState(); };
}
/* ==================== DAILY PLANNER ==================== */
const dailyPicker = document.getElementById('daily-date-picker');
dailyPicker.addEventListener('change', e => {
state.selectedDate = e.target.value || '2027-01-01';
saveState();
renderDailyView();
});
function ensureDailyData(dateStr) {
if (!state.daily[dateStr]) {
state.daily[dateStr] = {
top3: [{ text: '', done: false }, { text: '', done: false }, { text: '', done: false }],
prayers: [
{ name: 'Fajr (5:00 AM)', done: false },
{ name: 'Dhuhr', done: false },
{ name: 'Asr (5:00 PM)', done: false },
{ name: 'Maghrib (6:30 PM)', done: false },
{ name: 'Isha (9:00 PM)', done: false },
{ name: 'Quran & Dua', done: false }
],
college: [],
career: [],
project: [],
business: [],
gratitude: '',
notes: ''
};
}
return state.daily[dateStr];
}
function renderDailyView() {
dailyPicker.value = state.selectedDate;
const dData = ensureDailyData(state.selectedDate);
const top3Wrap = document.getElementById('daily-top3-list');
top3Wrap.innerHTML = '';
dData.top3.forEach((item, i) => {
const row = document.createElement('div');
row.className = 'task-item';
row.innerHTML = `
<span style="font-weight:700; color:var(--rose-deep); font-size:0.82rem;">0${i + 1}</span>
<input type="checkbox" class="pastel-check" ${item.done ? 'checked' : ''}>
<input type="text" class="task-text ${item.done ? 'completed' : ''}" placeholder="Priority #${i + 1}..." value="${escapeHtml(item.text)}">
`;
row.querySelector('.pastel-check').addEventListener('change', e => {
dData.top3[i].done = e.target.checked;
saveState();
renderDailyView();
});
row.querySelector('.task-text').addEventListener('input', e => {
dData.top3[i].text = e.target.value;
saveState();
});
top3Wrap.appendChild(row);
});
const pWrap = document.getElementById('daily-prayer-list');
pWrap.innerHTML = '';
const pDone = dData.prayers.filter(p => p.done).length;
document.getElementById('daily-prayer-badge').textContent = `${pDone}/${dData.prayers.length}`;
const pGrid = document.createElement('div');
pGrid.style.cssText = 'display:grid; grid-template-columns:repeat(2, 1fr); gap:8px;';
dData.prayers.forEach((p, idx) => {
const box = document.createElement('label');
box.className = 'task-item';
box.style.marginBottom = '0';
box.innerHTML = `
<input type="checkbox" class="pastel-check" ${p.done ? 'checked' : ''}>
<span style="font-size:0.82rem; font-weight:500;">${p.name}</span>
`;
box.querySelector('input').addEventListener('change', e => {
dData.prayers[idx].done = e.target.checked;
saveState();
renderDailyView();
});
pGrid.appendChild(box);
});
pWrap.appendChild(pGrid);
const gratEl = document.getElementById('daily-gratitude');
const noteEl = document.getElementById('daily-notes');
gratEl.value = dData.gratitude || '';
noteEl.value = dData.notes || '';
gratEl.oninput = e => { dData.gratitude = e.target.value; saveState(); };
noteEl.oninput = e => { dData.notes = e.target.value; saveState(); };
const col = document.getElementById('daily-category-tasks-col');
col.innerHTML = '';
const blocks = [
{ key: 'college', title: '✎ College, Revision & CA 2 Prep', placeholder: 'Add class notes or assignment...' },
{ key: 'career', title: '⚙ Python, Cyber Labs & Automation', placeholder: 'Add SOC lab or Make/M8A task...' },
{ key: 'project', title: '❖ Final-Year Project & Internship', placeholder: 'Add project build step...' },
{ key: 'business', title: '✿ Business & English Speaking', placeholder: 'Add speaking practice or service action...' }
];
blocks.forEach(blk => {
const card = document.createElement('div');
card.className = 'card';
card.innerHTML = `
<div class="card-header"><div class="card-title" style="font-size:1rem;">${blk.title}</div></div>
<div class="d-list"></div>
<div class="add-row">
<input type="text" class="d-inp" placeholder="${blk.placeholder}">
<button class="btn-soft d-btn">+</button>
</div>
`;
const list = card.querySelector('.d-list');
dData[blk.key].forEach((t, idx) => {
const row = document.createElement('div');
row.className = 'task-item';
row.innerHTML = `
<input type="checkbox" class="pastel-check" ${t.done ? 'checked' : ''}>
<input type="text" class="task-text ${t.done ? 'completed' : ''}" value="${escapeHtml(t.text)}">
<button class="del-item-btn">×</button>
`;
row.querySelector('.pastel-check').addEventListener('change', e => {
dData[blk.key][idx].done = e.target.checked;
saveState();
renderDailyView();
});
row.querySelector('.task-text').addEventListener('change', e => {
dData[blk.key][idx].text = e.target.value;
saveState();
});
row.querySelector('.del-item-btn').addEventListener('click', () => {
dData[blk.key].splice(idx, 1);
saveState();
renderDailyView();
});
list.appendChild(row);
});
card.querySelector('.d-btn').addEventListener('click', () => {
const inp = card.querySelector('.d-inp');
if (!inp.value.trim()) return;
dData[blk.key].push({ id: Date.now(), text: inp.value.trim(), done: false });
saveState();
renderDailyView();
});
col.appendChild(card);
});
}
/* ==================== HABIT TRACKER ==================== */
const habitMonthSelect = document.getElementById('habit-month-select');
MONTHS.forEach((m, i) => {
const opt = document.createElement('option');
opt.value = i;
opt.textContent = `${m} 2027`;
habitMonthSelect.appendChild(opt);
});
habitMonthSelect.addEventListener('change', e => {
state.habitMonth = Number(e.target.value);
saveState();
renderHabitsView();
});
function renderHabitsView() {
habitMonthSelect.value = state.habitMonth;
const m = state.habitMonth;
const days = DAYS_IN_MONTH_2027[m];
if (!state.habits[m]) state.habits[m] = {};
const table = document.getElementById('habit-matrix-table');
let thead = '<thead><tr><th>Habit</th>';
for (let d = 1; d <= days; d++) thead += `<th>${d}</th>`;
thead += '<th>%</th></tr></thead>';
let tbody = '<tbody>';
HABIT_LIST.forEach(habit => {
const arr = state.habits[m][habit] || [];
const pct = Math.round((arr.length / days) * 100);
tbody += `<tr><td>${habit}</td>`;
for (let d = 1; d <= days; d++) {
const active = arr.includes(d);
tbody += `<td><button class="habit-cell-btn ${active ? 'checked' : ''}" data-habit="${habit}" data-day="${d}">✓</button></td>`;
}
tbody += `<td><span class="badge-pill">${pct}%</span></td></tr>`;
});
tbody += '</tbody>';
table.innerHTML = thead + tbody;
table.querySelectorAll('.habit-cell-btn').forEach(btn => {
btn.addEventListener('click', () => {
const h = btn.dataset.habit;
const d = Number(btn.dataset.day);
if (!state.habits[m][h]) state.habits[m][h] = [];
const idx = state.habits[m][h].indexOf(d);
if (idx > -1) state.habits[m][h].splice(idx, 1);
else state.habits[m][h].push(d);
saveState();
renderHabitsView();
});
});
}
/* ==================== GOALS & PROGRESS ==================== */
function renderGoalsView() {
const grid = document.getElementById('goals-detailed-grid');
grid.innerHTML = '';
CATEGORIES.forEach(cat => {
const stats = getCategoryStats(cat.id);
const goals = state.categoryGoals[cat.id];
const card = document.createElement('div');
card.className = `card ${cat.cssClass}`;
card.innerHTML = `
<div class="card-header">
<h3 class="serif" style="font-size:1.08rem;">${cat.name}</h3>
<span class="badge-pill">${stats.pct}%</span>
</div>
<div style="display:flex; gap:12px; font-size:0.78rem; color:var(--text-muted); margin-bottom:8px;">
<span>✓ Completed: <strong>${stats.completed}</strong></span>
<span>○ Remaining: <strong>${stats.remaining}</strong></span>
</div>
<div class="prog-track" style="margin-bottom:12px;">
<div class="prog-fill" style="width:${stats.pct}%; background:${cat.color};"></div>
</div>
<div class="g-list"></div>
<div class="add-row">
<input type="text" class="g-inp" placeholder="Add ${cat.name} goal...">
<button class="btn-soft g-btn">+</button>
</div>
`;
const gList = card.querySelector('.g-list');
goals.forEach((g, idx) => {
const row = document.createElement('div');
row.className = 'task-item';
row.innerHTML = `
<input type="checkbox" class="pastel-check" ${g.done ? 'checked' : ''}>
<input type="text" class="task-text ${g.done ? 'completed' : ''}" value="${escapeHtml(g.text)}">
<button class="del-item-btn">×</button>
`;
row.querySelector('.pastel-check').addEventListener('change', e => {
goals[idx].done = e.target.checked;
saveState();
renderGoalsView();
renderDashGoalBars();
renderPillarsGrid();
});
row.querySelector('.task-text').addEventListener('change', e => {
goals[idx].text = e.target.value;
saveState();
});
row.querySelector('.del-item-btn').addEventListener('click', () => {
goals.splice(idx, 1);
saveState();
renderGoalsView();
renderDashGoalBars();
renderPillarsGrid();
});
gList.appendChild(row);
});
card.querySelector('.g-btn').addEventListener('click', () => {
const inp = card.querySelector('.g-inp');
if (!inp.value.trim()) return;
goals.push({ id: Date.now(), text: inp.value.trim(), done: false });
saveState();
renderGoalsView();
renderDashGoalBars();
renderPillarsGrid();
});
grid.appendChild(card);
});
}
/* ==================== BUSINESS & PROJECTS ==================== */
function renderBusinessView() {
const pList = document.getElementById('projects-cards-list');
pList.innerHTML = '';
state.projects.forEach((p, idx) => {
const badgeClass = p.status === 'Completed' ? 'st-done' : (p.status === 'In Progress' ? 'st-progress' : 'st-planned');
const box = document.createElement('div');
box.style.cssText = 'background:var(--bg-inner); padding:12px; border-radius:14px; margin-bottom:9px; position:relative;';
box.innerHTML = `
<button class="del-item-btn" style="position:absolute; top:6px; right:8px;">×</button>
<div style="font-weight:700; font-size:0.9rem;">${escapeHtml(p.name)}</div>
<div style="font-size:0.78rem; color:var(--text-muted); margin-top:3px;">Milestone: ${escapeHtml(p.milestone)}</div>
<div style="font-size:0.78rem; color:var(--text-muted);">Task: ${escapeHtml(p.task)} · Due: ${escapeHtml(p.deadline)}</div>
<div style="margin-top:6px;">
<select class="p-status-sel status-pill ${badgeClass}" style="width:auto; padding:4px 8px; font-size:0.75rem;">
<option value="In Progress" ${p.status === 'In Progress' ? 'selected' : ''}>In Progress</option>
<option value="Planned" ${p.status === 'Planned' ? 'selected' : ''}>Planned</option>
<option value="Completed" ${p.status === 'Completed' ? 'selected' : ''}>Completed</option>
</select>
</div>
`;
box.querySelector('.p-status-sel').addEventListener('change', e => {
state.projects[idx].status = e.target.value;
saveState();
renderBusinessView();
});
box.querySelector('.del-item-btn').addEventListener('click', () => {
state.projects.splice(idx, 1);
saveState();
renderBusinessView();
});
pList.appendChild(box);
});
const bizList = document.getElementById('biz-items-list');
bizList.innerHTML = '';
state.businessItems.forEach((b, idx) => {
const box = document.createElement('div');
box.style.cssText = 'background:var(--bg-inner); padding:12px; border-radius:14px; margin-bottom:9px; position:relative;';
box.innerHTML = `
<button class="del-item-btn" style="position:absolute; top:6px; right:8px;">×</button>
<div style="font-weight:700; font-size:0.9rem;">${escapeHtml(b.idea)}</div>
<div style="font-size:0.78rem; color:var(--text-muted);">Service: ${escapeHtml(b.service)}</div>
<div style="font-size:0.78rem; color:var(--text-muted);">Sample: ${escapeHtml(b.sample)}</div>
<div style="font-size:0.78rem; color:var(--rose-deep);">Action: ${escapeHtml(b.action)}</div>
`;
box.querySelector('.del-item-btn').addEventListener('click', () => {
state.businessItems.splice(idx, 1);
saveState();
renderBusinessView();
});
bizList.appendChild(box);
});
const ledList = document.getElementById('fin-ledger-list');
ledList.innerHTML = '';
let net = 0;
state.ledger.forEach((item, idx) => {
const amt = Number(item.amount || 0);
net += item.type === 'income' ? amt : -amt;
const row = document.createElement('div');
row.className = 'task-item';
row.innerHTML = `
<span style="flex:1; font-size:0.84rem;">${escapeHtml(item.desc)}</span>
<span class="status-pill ${item.type === 'income' ? 'st-done' : 'st-progress'}">
${item.type === 'income' ? '+' : '-'}$${amt.toFixed(2)}
</span>
<button class="del-item-btn">×</button>
`;
row.querySelector('.del-item-btn').addEventListener('click', () => {
state.ledger.splice(idx, 1);
saveState();
renderBusinessView();
});
ledList.appendChild(row);
});
document.getElementById('net-profit-badge').textContent = `Net: $${net.toFixed(2)}`;
}
document.getElementById('add-proj-btn').addEventListener('click', () => {
const name = document.getElementById('proj-name').value.trim();
if (!name) return;
state.projects.push({
id: Date.now(),
name,
milestone: document.getElementById('proj-milestone').value.trim() || 'Initial Milestone',
task: document.getElementById('proj-task').value.trim() || 'Start build',
deadline: document.getElementById('proj-deadline').value || '2027-06-01',
status: document.getElementById('proj-status').value
});
document.getElementById('proj-name').value = '';
document.getElementById('proj-milestone').value = '';
document.getElementById('proj-task').value = '';
saveState();
renderBusinessView();
});
document.getElementById('add-biz-btn').addEventListener('click', () => {
const idea = document.getElementById('biz-idea').value.trim();
if (!idea) return;
state.businessItems.push({
id: Date.now(),
idea,
service: document.getElementById('biz-service').value.trim() || 'Digital Service',
sample: document.getElementById('biz-sample').value.trim() || 'Portfolio Demo',
action: document.getElementById('biz-action').value.trim() || 'Outreach'
});
['biz-idea', 'biz-service', 'biz-sample', 'biz-action'].forEach(id => document.getElementById(id).value = '');
saveState();
renderBusinessView();
});
document.getElementById('add-fin-btn').addEventListener('click', () => {
const desc = document.getElementById('fin-desc').value.trim();
const amount = parseFloat(document.getElementById('fin-amount').value);
if (!desc || isNaN(amount)) return;
state.ledger.push({
id: Date.now(),
desc,
type: document.getElementById('fin-type').value,
amount
});
document.getElementById('fin-desc').value = '';
document.getElementById('fin-amount').value = '';
saveState();
renderBusinessView();
});
/* ==================== HELPERS & INIT ==================== */
function escapeHtml(str) {
if (!str) return '';
return String(str)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
}
function renderActiveView(viewName) {
if (viewName === 'dashboard') {
renderCalendar();
renderRoutine();
renderDailyGoalsWidget();
renderDashTodos();
renderDashGoalBars();
renderPillarsGrid();
} else if (viewName === 'routine') renderRoutine();
else if (viewName === 'daily') renderDailyView();
else if (viewName === 'weekly') renderWeeklyView();
else if (viewName === 'monthly') renderMonthlyView();
else if (viewName === 'yearly') renderYearlyView();
else if (viewName === 'habits') renderHabitsView();
else if (viewName === 'goals') renderGoalsView();
else if (viewName === 'business') renderBusinessView();
}
function render() {
renderCalendar();
renderRoutine();
renderDailyGoalsWidget();
renderDashTodos();
renderDashGoalBars();
renderPillarsGrid();
renderYearlyView();
renderMonthlyView();
renderWeeklyView();
renderDailyView();
renderHabitsView();
renderGoalsView();
renderBusinessView();
}
render();
</script>
</body>
</html>