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 Side Panel Modal</title> <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4.2.1"></script> </head> <body class="bg-gray-100 flex items-center justify-center min-h-screen p-6 antialiased" x-data="{ open: true }"> <button @click="open = true" class="px-8 py-3 bg-amber-500 text-white rounded-2xl font-bold shadow-xl hover:bg-slate-900 transition cursor-pointer">Launch Utility Hub</button> <!-- Side Panel Overlay --> <div x-show="open" class="fixed inset-0 z-50 flex justify-end" style="display: none;" > <!-- Simple backdrop --> <div x-show="open" x-transition:enter="ease-out duration-500" x-transition:enter-start="opacity-0" x-transition:enter-end="opacity-100" class="fixed inset-0 bg-slate-900/40 backdrop-blur-sm" @click="open = false"></div> <!-- Panel (Sliding from right with margin) --> <div x-show="open" x-transition:enter="transform transition ease-out duration-500" x-transition:enter-start="translate-x-full opacity-0" x-transition:enter-end="translate-x-0 opacity-100" x-transition:leave="transform transition ease-in duration-400" x-transition:leave-start="translate-x-0 opacity-100" x-transition:leave-end="translate-x-full opacity-0" class="relative w-full max-w-sm m-4 lg:m-8 bg-white rounded-[2.5rem] shadow-4xl border border-white flex flex-col overflow-hidden" > <div class="px-8 py-10 flex-1 overflow-y-auto"> <div class="flex justify-between items-center mb-10"> <h3 class="text-xl font-black text-slate-900 tracking-tighter italic">Utility Hub.</h3> <button @click="open = false" class="text-slate-300 hover:text-rose-600 transition cursor-pointer"><svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M6 18L18 6M6 6l12 12"/></svg></button> </div> <div class="space-y-10"> <div class="space-y-4"> <h4 class="text-[9px] font-black text-slate-400 uppercase tracking-widest italic ml-1">Network Switch</h4> <div class="flex items-center justify-between p-4 bg-slate-50 rounded-2xl border border-slate-100"> <span class="text-xs font-bold text-slate-600">Global Manifest Sync</span> <div class="h-6 w-12 bg-indigo-600 rounded-full flex items-center p-1 cursor-pointer"><div class="h-4 w-4 bg-white rounded-full translate-x-6"></div></div> </div> </div> <div class="space-y-4"> <h4 class="text-[9px] font-black text-slate-400 uppercase tracking-widest italic ml-1">Connected Clusters</h4> <div class="grid grid-cols-2 gap-3"> <div class="h-20 bg-indigo-50 rounded-2xl flex flex-col items-center justify-center border border-indigo-100"> <span class="text-lg font-black text-indigo-600">08</span> <span class="text-[8px] font-black text-indigo-400 uppercase tracking-widest">Active</span> </div> <div class="h-20 bg-slate-50 rounded-2xl flex flex-col items-center justify-center border border-slate-100"> <span class="text-lg font-black text-slate-400">14</span> <span class="text-[8px] font-black text-slate-400 uppercase tracking-widest">Available</span> </div> </div> </div> <div class="space-y-4"> <h4 class="text-[9px] font-black text-slate-400 uppercase tracking-widest italic ml-1">Action Log</h4> <div class="space-y-3"> <div class="flex items-center gap-3 text-xs font-medium text-slate-500 italic"> <div class="h-2 w-2 rounded-full bg-emerald-500"></div> <span>Auth granted for node X-9</span> </div> <div class="flex items-center gap-3 text-xs font-medium text-slate-500 italic"> <div class="h-2 w-2 rounded-full bg-rose-500 pulse"></div> <span>Latent signal in sector 4</span> </div> </div> </div> </div> </div> <div class="px-8 py-8 bg-slate-50 border-t border-slate-100"> <button @click="open = false" class="w-full h-14 bg-slate-900 text-white rounded-2xl font-black text-xs uppercase tracking-widest hover:bg-slate-800 shadow-xl transition active:scale-95 cursor-pointer">Commit Changes</button> </div> </div> </div> <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script> </body> </html>