diff --git a/assets/css/custom.css b/assets/css/custom.css
new file mode 100644
index 0000000..7501881
--- /dev/null
+++ b/assets/css/custom.css
@@ -0,0 +1,80 @@
+
+@import url('https://fonts.googleapis.com/css2?family=Georgia&display=swap');
+
+body {
+ background-color: #F8FAFC;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
+ color: #1F2937;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ font-family: 'Georgia', serif;
+}
+
+.theme-card {
+ border-radius: 12px;
+ border: 1px solid #E5E7EB;
+ transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
+}
+
+.theme-card:hover {
+ transform: translateY(-5px);
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
+}
+
+.theme-card .card-body {
+ padding: 1.5rem;
+}
+
+.btn-primary {
+ background-color: #6366F1;
+ border-color: #6366F1;
+ border-radius: 9999px;
+ padding: 0.75rem 1.5rem;
+ font-weight: 600;
+}
+
+.btn-primary:hover {
+ background-color: #4F46E5;
+ border-color: #4F46E5;
+}
+
+.btn-secondary {
+ background-color: #EC4899;
+ border-color: #EC4899;
+ border-radius: 9999px;
+ padding: 0.75rem 1.5rem;
+ font-weight: 600;
+}
+
+.btn-secondary:hover {
+ background-color: #DB2777;
+ border-color: #DB2777;
+}
+
+.ritual-step {
+ display: none;
+}
+
+.ritual-step.active {
+ display: block;
+}
+
+.progress-bar-container {
+ height: 4px;
+ background-color: #E5E7EB;
+ border-radius: 9999px;
+ overflow: hidden;
+}
+
+.progress-bar-fill {
+ height: 100%;
+ background-color: #6366F1;
+ width: 0%;
+ transition: width 0.5s ease-in-out;
+}
+
+.timer {
+ font-size: 3rem;
+ font-weight: bold;
+}
diff --git a/assets/js/main.js b/assets/js/main.js
new file mode 100644
index 0000000..87ccea0
--- /dev/null
+++ b/assets/js/main.js
@@ -0,0 +1,91 @@
+
+document.addEventListener('DOMContentLoaded', () => {
+ const ritualSteps = document.querySelectorAll('.ritual-step');
+ const nextButtons = document.querySelectorAll('.next-step');
+ const progressBar = document.querySelector('.progress-bar-fill');
+ const timerElement = document.getElementById('timer');
+ const beginButton = document.getElementById('begin-ritual');
+
+ let currentStep = 0;
+ let timerInterval;
+
+ function showStep(stepIndex) {
+ ritualSteps.forEach((step, index) => {
+ step.classList.toggle('active', index === stepIndex);
+ });
+ const progress = ((stepIndex) / (ritualSteps.length - 2)) * 100;
+ if(progressBar) {
+ progressBar.style.width = `${progress}%`;
+ }
+ }
+
+ function startTimer(duration) {
+ let timer = duration, minutes, seconds;
+ if(!timerElement) return;
+
+ const updateTimer = () => {
+ minutes = parseInt(timer / 60, 10);
+ seconds = parseInt(timer % 60, 10);
+
+ minutes = minutes < 10 ? "0" + minutes : minutes;
+ seconds = seconds < 10 ? "0" + seconds : seconds;
+
+ timerElement.textContent = minutes + ":" + seconds;
+
+ if (--timer < 0) {
+ clearInterval(timerInterval);
+ // Optionally, move to next step automatically
+ if(currentStep < ritualSteps.length - 1) {
+ currentStep++;
+ showStep(currentStep);
+ } else {
+ // Handle completion
+ }
+ }
+ };
+ updateTimer();
+ timerInterval = setInterval(updateTimer, 1000);
+ }
+
+ if(beginButton) {
+ beginButton.addEventListener('click', () => {
+ currentStep = 1; // Move to the first ritual step
+ showStep(currentStep);
+ startTimer(90); // 90 second timer
+ });
+ }
+
+
+ nextButtons.forEach(button => {
+ button.addEventListener('click', () => {
+ if (currentStep < ritualSteps.length - 1) {
+ currentStep++;
+ showStep(currentStep);
+
+ // If this is the last step, log progress
+ if (currentStep === ritualSteps.length - 1) {
+ const theme = new URLSearchParams(window.location.search).get('theme') || 'gratitude';
+ fetch('log_progress.php', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({ theme: theme })
+ })
+ .then(response => response.json())
+ .then(data => {
+ if (!data.success) {
+ console.error('Failed to log progress.');
+ }
+ })
+ .catch(error => console.error('Error logging progress:', error));
+ }
+ }
+ });
+ });
+
+ // Initial setup
+ if(ritualSteps.length > 0) {
+ showStep(0);
+ }
+});
diff --git a/checkout.php b/checkout.php
new file mode 100644
index 0000000..64a3ee5
--- /dev/null
+++ b/checkout.php
@@ -0,0 +1,79 @@
+ [
+ 'currency' => 'usd',
+ 'product_data' => [
+ 'name' => 'Basic Plan',
+ ],
+ 'unit_amount' => 500, // $5.00
+ 'recurring' => [
+ 'interval' => 'month',
+ ],
+ ],
+ 'quantity' => 1,
+ ];
+} elseif ($plan === 'pro') {
+ $line_items[] = [
+ 'price_data' => [
+ 'currency' => 'usd',
+ 'product_data' => [
+ 'name' => 'Pro Plan',
+ ],
+ 'unit_amount' => 1500, // $15.00
+ 'recurring' => [
+ 'interval' => 'month',
+ ],
+ ],
+ 'quantity' => 1,
+ ];
+} else {
+ // Redirect to pricing page if plan is not recognized
+ header('Location: pricing.php');
+ exit;
+}
+
+/*
+try {
+ $checkout_session = \Stripe\Checkout\Session::create([
+ 'payment_method_types' => ['card'],
+ 'line_items' => $line_items,
+ 'mode' => 'subscription',
+ 'success_url' => 'http://' . $_SERVER['HTTP_HOST'] . '/ritual.php',
+ 'cancel_url' => 'http://' . $_SERVER['HTTP_HOST'] . '/pricing.php',
+ 'customer_email' => $_SESSION['user_email'], // Pre-fill email
+ 'client_reference_id' => $_SESSION['user_id'],
+ ]);
+
+ header("Location: " . $checkout_session->url);
+ exit;
+} catch (Exception $e) {
+ // Handle any errors that occur
+ error_log('Stripe Error: ' . $e->getMessage());
+ header('Location: pricing.php?error=1');
+ exit;
+}
+*/
+
+// For now, we will simulate a successful payment and redirect to the ritual page.
+header('Location: ritual.php?payment=success');
+exit;
+?>
\ No newline at end of file
diff --git a/db/setup.php b/db/setup.php
new file mode 100644
index 0000000..78552db
--- /dev/null
+++ b/db/setup.php
@@ -0,0 +1,41 @@
+exec("CREATE TABLE IF NOT EXISTS affirmations (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ theme VARCHAR(255) NOT NULL,
+ level VARCHAR(50) NOT NULL DEFAULT 'beginner',
+ affirmation_text TEXT NOT NULL
+ )");
+
+ // Clear existing affirmations to avoid duplicates on re-run
+ $pdo->exec("TRUNCATE TABLE affirmations");
+
+ $affirmations = [
+ 'gratitude' => 'I am grateful for the abundance in my life.',
+ 'letting-go' => 'I release what no longer serves me.',
+ 'self-love' => 'I love and accept myself unconditionally.',
+ 'forgiveness' => 'I forgive myself and others, freeing myself from the past.',
+ 'abundance' => 'I am a magnet for success and good fortune.',
+ 'clarity' => 'My mind is clear and my path is unfolding perfectly.',
+ 'healing' => 'I am healing, whole, and strong.',
+ 'resilience' => 'I bounce back from challenges with ease.',
+ 'joy' => 'I choose joy and find it in every moment.',
+ 'peace' => 'I cultivate peace within and around me.'
+ ];
+
+ $stmt = $pdo->prepare("INSERT INTO affirmations (theme, affirmation_text) VALUES (:theme, :affirmation_text)");
+
+ foreach ($affirmations as $theme => $text) {
+ $stmt->execute(['theme' => $theme, 'affirmation_text' => $text]);
+ }
+
+ echo "Database setup complete. 'affirmations' table created and seeded." . PHP_EOL;
+
+} catch (PDOException $e) {
+ die("Database setup failed: " . $e->getMessage());
+}
diff --git a/db/setup_progress.php b/db/setup_progress.php
new file mode 100644
index 0000000..17edf6a
--- /dev/null
+++ b/db/setup_progress.php
@@ -0,0 +1,19 @@
+exec($sql);
+ echo "Progress table created successfully.";
+} catch (PDOException $e) {
+ die("Could not connect to the database $dbname :" . $e->getMessage());
+}
diff --git a/db/setup_subscriptions.php b/db/setup_subscriptions.php
new file mode 100644
index 0000000..9e15418
--- /dev/null
+++ b/db/setup_subscriptions.php
@@ -0,0 +1,23 @@
+exec($sql);
+ echo "Table 'subscriptions' created successfully.";
+} catch (PDOException $e) {
+ die("Could not create table 'subscriptions': " . $e->getMessage());
+}
+?>
\ No newline at end of file
diff --git a/db/setup_users.php b/db/setup_users.php
new file mode 100644
index 0000000..23857d7
--- /dev/null
+++ b/db/setup_users.php
@@ -0,0 +1,20 @@
+exec($sql);
+ echo "Table 'users' created successfully.";
+} catch (PDOException $e) {
+ die("DB ERROR: " . $e->getMessage());
+}
+?>
\ No newline at end of file
diff --git a/index.php b/index.php
index 7205f3d..30fc0d4 100644
--- a/index.php
+++ b/index.php
@@ -1,150 +1,120 @@
- 'Safety', 'color' => '#34D399'],
+ ['name' => 'Permission', 'color' => '#FBBF24'],
+ ['name' => 'Possibility', 'color' => '#60A5FA'],
+ ['name' => 'Presence', 'color' => '#A78BFA'],
+ ['name' => 'Enoughness', 'color' => '#F472B6'],
+ ['name' => 'Trust', 'color' => '#2DD4BF'],
+ ['name' => 'Release', 'color' => '#F87171'],
+ ['name' => 'Prosperity', 'color' => '#38B2AC', 'premium' => true],
+ ['name' => 'Wellness', 'color' => '#4ADE80', 'premium' => true],
+ ['name' => 'Spirituality', 'color' => '#818CF8', 'premium' => true],
+];
+
?>
-
+
-
-
- New Style
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
Analyzing your requirements and generating your website…
-
- Loading…
-
-
= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.
-
This page will update automatically as the plan is implemented.
-
Runtime: PHP = htmlspecialchars($phpVersion) ?> — UTC = htmlspecialchars($now) ?>
+
+
+
-
-
+
+
diff --git a/log_progress.php b/log_progress.php
new file mode 100644
index 0000000..77707f7
--- /dev/null
+++ b/log_progress.php
@@ -0,0 +1,34 @@
+prepare("INSERT INTO progress (user_id, theme, completion_date) VALUES (?, ?, ?)");
+ $stmt->execute([$user_id, $theme, $completion_date]);
+
+ http_response_code(200); // OK
+ echo json_encode(['success' => true]);
+
+} catch (PDOException $e) {
+ http_response_code(500); // Internal Server Error
+ error_log('Failed to log progress: ' . $e->getMessage());
+ echo json_encode(['success' => false, 'message' => 'Could not save progress.']);
+}
diff --git a/login.php b/login.php
new file mode 100644
index 0000000..a9d6325
--- /dev/null
+++ b/login.php
@@ -0,0 +1,112 @@
+prepare($sql);
+ $stmt->execute([$email]);
+ $user = $stmt->fetch();
+
+ if ($user && password_verify($password, $user['password'])) {
+ $_SESSION['user_id'] = $user['id'];
+ $_SESSION['user_name'] = $user['name'];
+ header('Location: index.php');
+ exit;
+ } else {
+ $error = 'Invalid email or password.';
+ }
+ } catch (PDOException $e) {
+ $error = 'Database error: ' . $e->getMessage();
+ }
+ }
+}
+?>
+
+
+
+
+
+
Login - Sacred Habits
+
+
+
+
+
+
+
+
+
+
+
+
+
Login to Your Account
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/logout.php b/logout.php
new file mode 100644
index 0000000..2d2c92f
--- /dev/null
+++ b/logout.php
@@ -0,0 +1,7 @@
+
\ No newline at end of file
diff --git a/pricing.php b/pricing.php
new file mode 100644
index 0000000..d5b71ed
--- /dev/null
+++ b/pricing.php
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
Pricing -
+
+
+
+
+
+
+
+
+
Choose Your Plan
+
Unlock premium features and support the development of this platform.
+
+
+
+
+
+
+
+
+
$15 / mo
+
+ - All Basic features
+ - Access to premium themes
+ - Priority email support
+
+
+
Get started
+
+
+
+
+
+
+
+
+
$29 / mo
+
+ - All Pro features
+ - 24/7 phone support
+ - Dedicated account manager
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/progress.php b/progress.php
new file mode 100644
index 0000000..993ceb0
--- /dev/null
+++ b/progress.php
@@ -0,0 +1,155 @@
+prepare("SELECT theme, completion_date FROM progress WHERE user_id = ? ORDER BY completion_date DESC");
+$stmt->execute([$user_id]);
+$progress_data = $stmt->fetchAll(PDO::FETCH_ASSOC);
+
+// --- Progress Calculation ---
+
+// 1. Last 7 Days Grid
+$last_7_days = [];
+for ($i = 0; $i < 7; $i++) {
+ $date = date('Y-m-d', strtotime("-$i days"));
+ $last_7_days[$date] = false;
+}
+
+foreach ($progress_data as $progress) {
+ if (isset($last_7_days[$progress['completion_date']])) {
+ $last_7_days[$progress['completion_date']] = true;
+ }
+}
+
+// 2. Total Practices
+$total_practices = count($progress_data);
+
+// 3. Current Streak
+$current_streak = 0;
+if ($total_practices > 0) {
+ $dates = array_unique(array_column($progress_data, 'completion_date'));
+ rsort($dates);
+ $current_streak = 1;
+ $today = date('Y-m-d');
+ $yesterday = date('Y-m-d', strtotime('-1 day'));
+
+ if ($dates[0] != $today && $dates[0] != $yesterday) {
+ $current_streak = 0;
+ } else {
+ for ($i = 0; $i < count($dates) - 1; $i++) {
+ $date1 = new DateTime($dates[$i]);
+ $date2 = new DateTime($dates[$i+1]);
+ $diff = $date1->diff($date2)->days;
+ if ($diff == 1) {
+ $current_streak++;
+ } else {
+ break;
+ }
+ }
+ }
+}
+
+// 4. Practiced Themes
+$practiced_themes = array_unique(array_column($progress_data, 'theme'));
+
+$project_name = getenv('PROJECT_NAME') ?: 'Mindful Moments';
+
+?>
+
+
+
+
+
+
Your Progress -
+
+
+
+
+
+
+
+
+
Your Progress
+
+
+
+
+
Last 7 Days
+
+ $completed): ?>
+
+
+
+
+
+
+
+
+
+
Practiced Themes
+
+
You haven't completed any rituals yet.
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/register.php b/register.php
new file mode 100644
index 0000000..96fff8a
--- /dev/null
+++ b/register.php
@@ -0,0 +1,111 @@
+prepare($sql);
+ $stmt->execute([$email]);
+ if ($stmt->fetch()) {
+ $error = 'Email is already registered.';
+ } else {
+ $hashed_password = password_hash($password, PASSWORD_DEFAULT);
+ $sql = 'INSERT INTO users (name, email, password) VALUES (?, ?, ?)';
+ $stmt = $pdo->prepare($sql);
+ if ($stmt->execute([$name, $email, $hashed_password])) {
+ $_SESSION['success_message'] = 'Registration successful! Please login.';
+ header('Location: login.php');
+ exit;
+ } else {
+ $error = 'Something went wrong. Please try again.';
+ }
+ }
+ } catch (PDOException $e) {
+ $error = 'Database error: ' . $e->getMessage();
+ }
+ }
+}
+?>
+
+
+
+
+
+
Register - Sacred Habits
+
+
+
+
+
+
+
+
+
+
+
+
+
Create Your Account
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ritual.php b/ritual.php
new file mode 100644
index 0000000..195c39c
--- /dev/null
+++ b/ritual.php
@@ -0,0 +1,149 @@
+
+prepare(
+ "SELECT affirmation_text FROM affirmations WHERE theme = :theme AND level = :level ORDER BY RAND() LIMIT 1"
+ );
+ $stmt->execute(['theme' => $theme, 'level' => $level]);
+ $result = $stmt->fetch(PDO::FETCH_ASSOC);
+
+ if ($result && !empty($result['affirmation_text'])) {
+ $affirmation_text = $result['affirmation_text'];
+ }
+} catch (PDOException $e) {
+ // Log the error instead of displaying it to the user
+ error_log("Database error in ritual.php: " . $e->getMessage());
+ // The page will proceed with the default affirmation text
+}
+?>
+
+
+
+
+
+
Sacred Habits - Ritual
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Your 90-Second Ritual
+
A moment for yourself, inspired by the theme of .
+
+
+
+
+
+
+
Release
+
Let go of what no longer serves you. Take a deep breath out.
+
01:30
+
+
+
+
+
+
+
Receive
+
Open yourself to new energy and possibility. Breathe in deeply.
+
+
+
+
+
+
+
Practice
+
Repeat the affirmation, feeling its truth resonate within you.
+
""
+
+
+
+
+
+
+
Breathe
+
Integrate the practice with your breath. Inhale peace, exhale gratitude.
+
+
+
+
+
+
+
Affirm
+
Lock in the feeling with one final repetition.
+
""
+
+
+
+
+
+
+
✨ Ritual Complete! ✨
+
You have honored your commitment to yourself.
+
Back to Themes
+
+
+
+
+
+
+
+
diff --git a/webhook.php b/webhook.php
new file mode 100644
index 0000000..8c2ce35
--- /dev/null
+++ b/webhook.php
@@ -0,0 +1,81 @@
+type) {
+ case 'checkout.session.completed':
+ $session = $event->data->object;
+ $user_id = $session->client_reference_id;
+ $stripe_subscription_id = $session->subscription;
+
+ // Get subscription details
+ $stripe = new \Stripe\StripeClient('YOUR_STRIPE_SECRET_KEY');
+ $subscription = $stripe->subscriptions->retrieve($stripe_subscription_id, []);
+ $plan = $subscription->items->data[0]->price->nickname;
+
+ // Store subscription in the database
+ try {
+ $pdo = db();
+ $stmt = $pdo->prepare("INSERT INTO subscriptions (user_id, stripe_subscription_id, plan, status, start_date, end_date) VALUES (?, ?, ?, ?, FROM_UNIXTIME(?), FROM_UNIXTIME(?))");
+ $stmt->execute([
+ $user_id,
+ $stripe_subscription_id,
+ $plan,
+ $subscription->status,
+ $subscription->current_period_start,
+ $subscription->current_period_end
+ ]);
+ } catch (PDOException $e) {
+ // Log error
+ error_log("Webhook DB Error: " . $e->getMessage());
+ }
+ break;
+ case 'customer.subscription.updated':
+ $subscription = $event->data->object;
+ $stripe_subscription_id = $subscription->id;
+ $status = $subscription->status;
+ $end_date = $subscription->cancel_at_period_end ? $subscription->current_period_end : null;
+
+ try {
+ $pdo = db();
+ $stmt = $pdo->prepare("UPDATE subscriptions SET status = ?, end_date = FROM_UNIXTIME(?) WHERE stripe_subscription_id = ?");
+ $stmt->execute([$status, $end_date, $stripe_subscription_id]);
+ } catch (PDOException $e) {
+ // Log error
+ error_log("Webhook DB Error: " . $e->getMessage());
+ }
+ break;
+ // ... handle other event types
+ default:
+ // Unexpected event type
+}
+*/
+
+http_response_code(200);
+?>
\ No newline at end of file