121 lines
6.2 KiB
PHP
121 lines
6.2 KiB
PHP
|
|
<?php
|
|
$projectName = $_SERVER['PROJECT_NAME'] ?? 'Sacred Habits';
|
|
$projectDesc = $_SERVER['PROJECT_DESCRIPTION'] ?? 'A 90-second daily ritual to reprogram your inner voice.';
|
|
$projectImage = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
|
|
|
$themes = [
|
|
['name' => '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],
|
|
];
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title><?php echo htmlspecialchars($projectName); ?></title>
|
|
<meta name="description" content="<?php echo htmlspecialchars($projectDesc); ?>">
|
|
|
|
<!-- Open Graph / Facebook -->
|
|
<meta property="og:type" content="website">
|
|
<meta property="og:url" content="<?php echo (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; ?>">
|
|
<meta property="og:title" content="<?php echo htmlspecialchars($projectName); ?>">
|
|
<meta property="og:description" content="<?php echo htmlspecialchars($projectDesc); ?>">
|
|
<meta property="og:image" content="<?php echo htmlspecialchars($projectImage); ?>">
|
|
|
|
<!-- Twitter -->
|
|
<meta property="twitter:card" content="summary_large_image">
|
|
<meta property="twitter:url" content="<?php echo (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; ?>">
|
|
<meta property="twitter:title" content="<?php echo htmlspecialchars($projectName); ?>">
|
|
<meta property="twitter:description" content="<?php echo htmlspecialchars($projectDesc); ?>">
|
|
<meta property="twitter:image" content="<?php echo htmlspecialchars($projectImage); ?>">
|
|
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
|
|
|
</head>
|
|
<?php session_start(); ?>
|
|
<body class="d-flex flex-column min-vh-100">
|
|
<div class="container my-5">
|
|
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
|
<div class="container-fluid">
|
|
<a class="navbar-brand" href="index.php"><?php echo htmlspecialchars($projectName); ?></a>
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarNav">
|
|
<ul class="navbar-nav ms-auto">
|
|
<?php if (isset($_SESSION['user_id'])): ?>
|
|
<li class="nav-item">
|
|
<span class="navbar-text me-3">Welcome, <?php echo htmlspecialchars($_SESSION['user_name']); ?>!</span>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="progress.php">Progress</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="pricing.php">Subscribe</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="logout.php">Logout</a>
|
|
</li>
|
|
<?php else: ?>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="login.php">Login</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="register.php">Register</a>
|
|
</li>
|
|
<?php endif; ?>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<?php
|
|
// Simulate checking subscription status
|
|
$has_subscription = isset($_SESSION['has_subscription']) && $_SESSION['has_subscription'];
|
|
?>
|
|
<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 row-cols-lg-4 g-4">
|
|
<?php foreach ($themes as $theme): ?>
|
|
<?php
|
|
$is_premium = isset($theme['premium']) && $theme['premium'];
|
|
$can_access = !$is_premium || ($is_premium && $has_subscription);
|
|
$link = $can_access ? 'ritual.php?theme=' . urlencode($theme['name']) : 'pricing.php';
|
|
$card_class = $can_access ? '' : 'disabled-theme';
|
|
?>
|
|
<div class="col">
|
|
<a href="<?php echo $link; ?>" class="text-decoration-none">
|
|
<div class="card h-100 theme-card <?php echo $card_class; ?>" style="border-top: 5px solid <?php echo $theme['color']; ?>;">
|
|
<div class="card-body text-center">
|
|
<h5 class="card-title mb-0">
|
|
<?php echo htmlspecialchars($theme['name']); ?>
|
|
<?php if ($is_premium): ?>
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-lock-fill" viewBox="0 0 16 16">
|
|
<path d="M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2zm3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z"/>
|
|
</svg>
|
|
<?php endif; ?>
|
|
</h5>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
|
|
<footer class="text-center mt-5 py-4 text-muted">
|
|
<p>© <?php echo date('Y'); ?> <?php echo htmlspecialchars($projectName); ?>. All rights reserved.</p>
|
|
</footer>
|
|
</body>
|
|
</html>
|