Toggle navigation
☰
HTML
CSS
Scripting
Database
<!doctype html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Tailwind CSS Monthly Yearly Pricing Toggle</title> <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4.2.1"></script> </head> <body class="bg-gray-50 flex justify-center min-h-screen pt-16 p-6 antialiased" x-data="{ billing: 'monthly' }"> <div class="w-full max-w-4xl text-center"> <div class="mb-12 inline-flex flex-col items-center"> <h2 class="text-4xl font-black text-slate-900 tracking-tighter mb-8 italic">Choose Your Sync Speed.</h2> <!-- Toggle --> <div class="bg-white p-1 rounded-full border border-slate-200 shadow-xl flex items-center gap-1"> <button @click="billing = 'monthly'" class="px-8 py-3 rounded-full text-[10px] font-black uppercase tracking-widest transition-all cursor-pointer" :class="billing === 'monthly' ? 'bg-slate-900 text-white shadow-lg' : 'text-slate-400 hover:text-slate-600'" > Monthly </button> <button @click="billing = 'yearly'" class="px-8 py-3 rounded-full text-[10px] font-black uppercase tracking-widest transition-all cursor-pointer relative" :class="billing === 'yearly' ? 'bg-slate-900 text-white shadow-lg' : 'text-slate-400 hover:text-slate-600'" > Yearly <!-- Badge --> <span class="absolute -top-6 left-1/2 -translate-x-1/2 px-2 py-0.5 bg-emerald-100 text-emerald-600 text-[8px] font-black uppercase tracking-tighter rounded-md rounded-bl-none border border-emerald-200 shadow-sm" x-show="billing === 'monthly'">Save 20%</span> </button> </div> </div> <div class="grid grid-cols-1 md:grid-cols-2 gap-8 max-w-2xl mx-auto"> <!-- Node Sync --> <div class="bg-white p-12 rounded-[3rem] shadow-3xl border border-white text-left group hover:border-indigo-100 transition-colors"> <h3 class="text-xl font-black text-slate-800 tracking-tight italic mb-2">Node Sync</h3> <p class="text-[10px] font-black text-indigo-500 uppercase tracking-widest mb-8">Basic Mesh Connectivity</p> <div class="mb-10 min-h-[4rem]"> <div class="flex items-baseline gap-1" x-show="billing === 'monthly'" x-transition:enter="transition ease-out duration-300" x-transition:enter-start="opacity-0 translate-y-2"> <span class="text-4xl font-black text-slate-900 tracking-tighter">$24</span> <span class="text-[9px] font-bold text-slate-400 uppercase tracking-widest italic">/ Month</span> </div> <div class="flex items-baseline gap-1" x-show="billing === 'yearly'" x-transition:enter="transition ease-out duration-300" x-transition:enter-start="opacity-0 translate-y-2"> <span class="text-4xl font-black text-slate-900 tracking-tighter">$19</span> <span class="text-[9px] font-bold text-slate-400 uppercase tracking-widest italic">/ Month Bil. Annually</span> </div> </div> <button class="w-full py-4 bg-slate-50 text-slate-900 border border-slate-100 rounded-2xl text-[9px] font-black uppercase tracking-widest group-hover:bg-indigo-600 group-hover:text-white group-hover:shadow-xl group-hover:shadow-indigo-100 transition-all cursor-pointer italic">Commit Sync</button> </div> <!-- Global Sync --> <div class="bg-indigo-600 p-12 rounded-[3rem] shadow-[0_40px_100px_-15px_rgba(99,102,241,0.4)] text-left relative overflow-hidden group"> <div class="absolute inset-0 bg-linear-to-br from-indigo-500 to-indigo-700 opacity-0 group-hover:opacity-100 transition-opacity"></div> <div class="relative z-10"> <h3 class="text-xl font-black text-white tracking-tight italic mb-2">Global Sync</h3> <p class="text-[10px] font-black text-indigo-200 uppercase tracking-widest mb-8">Full Sector Sovereignty</p> <div class="mb-10 min-h-[4rem]"> <div class="flex items-baseline gap-1 text-white" x-show="billing === 'monthly'" x-transition:enter="transition ease-out duration-300" x-transition:enter-start="opacity-0 translate-y-2"> <span class="text-4xl font-black tracking-tighter">$84</span> <span class="text-[9px] font-bold opacity-60 uppercase tracking-widest italic">/ Month</span> </div> <div class="flex items-baseline gap-1 text-white" x-show="billing === 'yearly'" x-transition:enter="transition ease-out duration-300" x-transition:enter-start="opacity-0 translate-y-2"> <span class="text-4xl font-black tracking-tighter">$69</span> <span class="text-[9px] font-bold opacity-60 uppercase tracking-widest italic">/ Month Bil. Annually</span> </div> </div> <button class="w-full py-4 bg-white text-indigo-600 rounded-2xl text-[9px] font-black uppercase tracking-widest hover:scale-105 transition-all cursor-pointer italic shadow-lg">Commit Global Sync</button> </div> </div> </div> </div> <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script> </body> </html>