fix: rename setInterval to setBilling, add deploy.sh
- pricing.php: rename setInterval() to setBilling() to stop shadowing the native window.setInterval — the billing toggle was silently broken - deploy.sh: full automated deploy script for nixpanel.io - DocumentRoot set to public/ (fixes /pricing, /login 404s) - AllowOverride All so public/.htaccess handles all routing - PHP 8.3-FPM via Apache mod_proxy_fcgi - composer install, DB migrations, .env setup, SSL via certbot
This commit is contained in:
+4
-4
@@ -25,11 +25,11 @@ $plans = [
|
||||
<p class="text-gray-400">Tied to your server IP. No per-user fees. Cancel anytime.</p>
|
||||
|
||||
<div class="inline-flex items-center gap-1 bg-gray-900 border border-gray-800 rounded-lg p-1 mt-8">
|
||||
<button id="btn-monthly" onclick="setInterval('monthly')"
|
||||
<button id="btn-monthly" onclick="setBilling('monthly')"
|
||||
class="px-4 py-2 rounded-md text-sm font-medium transition-colors bg-brand-600 text-white">
|
||||
Monthly
|
||||
</button>
|
||||
<button id="btn-annual" onclick="setInterval('annual')"
|
||||
<button id="btn-annual" onclick="setBilling('annual')"
|
||||
class="px-4 py-2 rounded-md text-sm font-medium transition-colors text-gray-400 hover:text-white">
|
||||
Annual
|
||||
<span class="ml-2 text-xs bg-green-500/20 text-green-400 px-1.5 py-0.5 rounded">2 months free</span>
|
||||
@@ -111,13 +111,13 @@ $plans = [
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function setInterval(val) {
|
||||
function setBilling(val) {
|
||||
document.querySelectorAll('.price-monthly').forEach(el => el.classList.toggle('hidden', val !== 'monthly'));
|
||||
document.querySelectorAll('.price-annual').forEach(el => el.classList.toggle('hidden', val !== 'annual'));
|
||||
document.querySelectorAll('[id^="interval-"]').forEach(el => el.value = val);
|
||||
document.getElementById('btn-monthly').className = 'px-4 py-2 rounded-md text-sm font-medium transition-colors ' + (val === 'monthly' ? 'bg-brand-600 text-white' : 'text-gray-400 hover:text-white');
|
||||
document.getElementById('btn-annual').className = 'px-4 py-2 rounded-md text-sm font-medium transition-colors ' + (val === 'annual' ? 'bg-brand-600 text-white' : 'text-gray-400 hover:text-white');
|
||||
}
|
||||
// Fix: hide the extra free $0 span since we output it twice to avoid if/else issues
|
||||
// Hide the duplicate free $0 span
|
||||
document.querySelectorAll('.price-monthly[data-plan="free"]').forEach((el, i) => { if (i > 0) el.remove(); });
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user