Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Kinematics Master: Motion in One Dimension</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet"> | |
| <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet"> | |
| <script> | |
| tailwind.config = { | |
| theme: { | |
| extend: { | |
| fontFamily: { | |
| sans: ['Inter', 'sans-serif'], | |
| mono: ['JetBrains Mono', 'monospace'], | |
| }, | |
| colors: { | |
| brand: { | |
| 50: '#f0f9ff', | |
| 100: '#e0f2fe', | |
| 200: '#bae6fd', | |
| 300: '#7dd3fc', | |
| 400: '#38bdf8', | |
| 500: '#0ea5e9', | |
| 600: '#0284c7', | |
| 700: '#0369a1', | |
| 800: '#075985', | |
| 900: '#0c4a6e', | |
| }, | |
| dark: { | |
| 800: '#1e293b', | |
| 850: '#162032', | |
| 900: '#0f172a', | |
| 950: '#020617', | |
| } | |
| }, | |
| animation: { | |
| 'float': 'float 6s ease-in-out infinite', | |
| 'pulse-glow': 'pulse-glow 2s ease-in-out infinite', | |
| 'slide-up': 'slide-up 0.5s ease-out', | |
| }, | |
| keyframes: { | |
| float: { | |
| '0%, 100%': { transform: 'translateY(0)' }, | |
| '50%': { transform: 'translateY(-10px)' }, | |
| }, | |
| 'pulse-glow': { | |
| '0%, 100%': { boxShadow: '0 0 20px rgba(14, 165, 233, 0.3)' }, | |
| '50%': { boxShadow: '0 0 40px rgba(14, 165, 233, 0.6)' }, | |
| }, | |
| 'slide-up': { | |
| '0%': { opacity: '0', transform: 'translateY(20px)' }, | |
| '100%': { opacity: '1', transform: 'translateY(0)' }, | |
| } | |
| } | |
| } | |
| } | |
| } | |
| </script> | |
| <style> | |
| /* Custom Scrollbar */ | |
| ::-webkit-scrollbar { | |
| width: 8px; | |
| height: 8px; | |
| } | |
| ::-webkit-scrollbar-track { | |
| background: #0f172a; | |
| } | |
| ::-webkit-scrollbar-thumb { | |
| background: #334155; | |
| border-radius: 4px; | |
| } | |
| ::-webkit-scrollbar-thumb:hover { | |
| background: #475569; | |
| } | |
| /* Glassmorphism */ | |
| .glass { | |
| background: rgba(30, 41, 59, 0.6); | |
| backdrop-filter: blur(16px); | |
| -webkit-backdrop-filter: blur(16px); | |
| border: 1px solid rgba(255, 255, 255, 0.08); | |
| } | |
| .glass-card { | |
| background: linear-gradient(145deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.8) 100%); | |
| backdrop-filter: blur(12px); | |
| border: 1px solid rgba(148, 163, 184, 0.1); | |
| } | |
| .glass-panel { | |
| background: rgba(15, 23, 42, 0.5); | |
| backdrop-filter: blur(8px); | |
| border: 1px solid rgba(148, 163, 184, 0.08); | |
| } | |
| /* Input Styling */ | |
| .input-group { | |
| position: relative; | |
| transition: all 0.3s ease; | |
| } | |
| .input-group:focus-within { | |
| transform: translateX(4px); | |
| } | |
| .input-field { | |
| background: rgba(15, 23, 42, 0.6); | |
| border: 1px solid rgba(71, 85, 105, 0.5); | |
| transition: all 0.3s ease; | |
| } | |
| .input-field:focus { | |
| border-color: #0ea5e9; | |
| box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15); | |
| } | |
| .input-field:disabled { | |
| background: rgba(30, 41, 59, 0.3); | |
| color: #64748b; | |
| } | |
| /* Custom Checkbox */ | |
| .custom-checkbox { | |
| appearance: none; | |
| width: 20px; | |
| height: 20px; | |
| border: 2px solid #475569; | |
| border-radius: 6px; | |
| background: rgba(15, 23, 42, 0.5); | |
| cursor: pointer; | |
| position: relative; | |
| transition: all 0.2s ease; | |
| } | |
| .custom-checkbox:checked { | |
| background: #0ea5e9; | |
| border-color: #0ea5e9; | |
| } | |
| .custom-checkbox:checked::after { | |
| content: '\f00c'; | |
| font-family: 'Font Awesome 6 Free'; | |
| font-weight: 900; | |
| position: absolute; | |
| top: 50%; | |
| left: 50%; | |
| transform: translate(-50%, -50%); | |
| color: white; | |
| font-size: 10px; | |
| } | |
| /* Range Slider */ | |
| input[type=range] { | |
| -webkit-appearance: none; | |
| background: transparent; | |
| } | |
| input[type=range]::-webkit-slider-thumb { | |
| -webkit-appearance: none; | |
| height: 18px; | |
| width: 18px; | |
| border-radius: 50%; | |
| background: #0ea5e9; | |
| cursor: pointer; | |
| margin-top: -7px; | |
| box-shadow: 0 0 15px rgba(14, 165, 233, 0.5); | |
| transition: all 0.2s ease; | |
| } | |
| input[type=range]::-webkit-slider-thumb:hover { | |
| transform: scale(1.2); | |
| box-shadow: 0 0 20px rgba(14, 165, 233, 0.8); | |
| } | |
| input[type=range]::-webkit-slider-runnable-track { | |
| width: 100%; | |
| height: 4px; | |
| cursor: pointer; | |
| background: linear-gradient(90deg, #334155 0%, #475569 100%); | |
| border-radius: 2px; | |
| } | |
| /* Canvas Container */ | |
| .canvas-container { | |
| position: relative; | |
| width: 100%; | |
| height: 360px; | |
| background: radial-gradient(ellipse at center, #1e293b 0%, #0f172a 70%); | |
| border-radius: 16px; | |
| overflow: hidden; | |
| } | |
| .canvas-container::before { | |
| content: ''; | |
| position: absolute; | |
| inset: 0; | |
| background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23334155' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); | |
| opacity: 0.5; | |
| } | |
| /* Formula Card */ | |
| .formula-card { | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .formula-card::before { | |
| content: ''; | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| right: 0; | |
| height: 2px; | |
| background: linear-gradient(90deg, #0ea5e9, #8b5cf6, #0ea5e9); | |
| background-size: 200% 100%; | |
| animation: gradient-shift 3s ease infinite; | |
| } | |
| @keyframes gradient-shift { | |
| 0%, 100% { background-position: 0% 50%; } | |
| 50% { background-position: 100% 50%; } | |
| } | |
| /* Button Effects */ | |
| .btn-primary { | |
| background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%); | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .btn-primary::before { | |
| content: ''; | |
| position: absolute; | |
| top: 0; | |
| left: -100%; | |
| width: 100%; | |
| height: 100%; | |
| background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); | |
| transition: left 0.5s ease; | |
| } | |
| .btn-primary:hover::before { | |
| left: 100%; | |
| } | |
| /* Step Animation */ | |
| .solution-step { | |
| animation: slide-up 0.4s ease-out forwards; | |
| opacity: 0; | |
| } | |
| .solution-step:nth-child(1) { animation-delay: 0.1s; } | |
| .solution-step:nth-child(2) { animation-delay: 0.2s; } | |
| .solution-step:nth-child(3) { animation-delay: 0.3s; } | |
| .solution-step:nth-child(4) { animation-delay: 0.4s; } | |
| .solution-step:nth-child(5) { animation-delay: 0.5s; } | |
| /* Particle Trail */ | |
| .particle-glow { | |
| filter: drop-shadow(0 0 10px #38bdf8) drop-shadow(0 0 20px #0ea5e9); | |
| } | |
| /* Preset Button */ | |
| .preset-btn { | |
| position: relative; | |
| overflow: hidden; | |
| transition: all 0.3s ease; | |
| } | |
| .preset-btn::after { | |
| content: ''; | |
| position: absolute; | |
| inset: 0; | |
| background: linear-gradient(135deg, transparent 0%, rgba(14, 165, 233, 0.1) 100%); | |
| opacity: 0; | |
| transition: opacity 0.3s ease; | |
| } | |
| .preset-btn:hover::after { | |
| opacity: 1; | |
| } | |
| /* Nav Link */ | |
| .nav-link { | |
| position: relative; | |
| } | |
| .nav-link::after { | |
| content: ''; | |
| position: absolute; | |
| bottom: -4px; | |
| left: 0; | |
| width: 0; | |
| height: 2px; | |
| background: #0ea5e9; | |
| transition: width 0.3s ease; | |
| } | |
| .nav-link:hover::after { | |
| width: 100%; | |
| } | |
| /* Stat Card */ | |
| .stat-card { | |
| background: linear-gradient(145deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%); | |
| border: 1px solid rgba(71, 85, 105, 0.3); | |
| } | |
| /* Live Badge */ | |
| .live-badge { | |
| animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; | |
| } | |
| @keyframes pulse { | |
| 0%, 100% { opacity: 1; } | |
| 50% { opacity: 0.5; } | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-dark-950 text-slate-200 font-sans min-h-screen flex flex-col overflow-x-hidden selection:bg-brand-500 selection:text-white"> | |
| <!-- Header --> | |
| <header class="fixed top-0 w-full z-50 glass border-b border-slate-700/30"> | |
| <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-16 flex items-center justify-between"> | |
| <div class="flex items-center gap-3"> | |
| <div class="w-10 h-10 rounded-xl bg-gradient-to-br from-brand-500 to-violet-600 flex items-center justify-center shadow-lg shadow-brand-500/25 animate-pulse-glow"> | |
| <i class="fa-solid fa-atom text-white text-lg"></i> | |
| </div> | |
| <div> | |
| <h1 class="text-lg font-bold text-white tracking-tight"> | |
| Kinematics<span class="text-brand-400">Master</span> | |
| </h1> | |
| <p class="text-xs text-slate-400">Class 11 Physics | NEET & JEE Prep</p> | |
| </div> | |
| </div> | |
| <nav class="hidden md:flex gap-8 text-sm font-medium text-slate-300"> | |
| <a href="#theory" class="nav-link hover:text-brand-400 transition-colors">Theory</a> | |
| <a href="#calculator" class="nav-link hover:text-brand-400 transition-colors">Solver</a> | |
| <a href="#simulator" class="nav-link hover:text-brand-400 transition-colors">Simulator</a> | |
| <a href="#formulas" class="nav-link hover:text-brand-400 transition-colors">Formulas</a> | |
| </nav> | |
| <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" | |
| class="text-xs font-mono text-slate-500 hover:text-brand-400 transition-colors hidden sm:block px-3 py-1.5 rounded-lg bg-slate-800/50 border border-slate-700/50"> | |
| Built with anycoder | |
| </a> | |
| </div> | |
| </header> | |
| <!-- Main Content --> | |
| <main class="flex-grow pt-20 pb-12 px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto w-full space-y-20"> | |
| <!-- Hero Section --> | |
| <section class="text-center space-y-6 py-12 relative"> | |
| <div class="absolute inset-0 -z-10 overflow-hidden"> | |
| <div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[600px] bg-brand-500/10 rounded-full blur-3xl"></div> | |
| </div> | |
| <div class="inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-brand-900/40 border border-brand-500/30 text-brand-300 text-xs font-medium mb-4 backdrop-blur-sm"> | |
| <span class="w-2 h-2 rounded-full bg-brand-400 live-badge"></span> | |
| Interactive Learning Module | |
| </div> | |
| <h2 class="text-4xl md:text-6xl font-bold text-white tracking-tight leading-tight"> | |
| Master | |
| <span class="text-transparent bg-clip-text bg-gradient-to-r from-brand-400 via-cyan-400 to-violet-400 animate-float inline-block">Motion in One Dimension</span> | |
| </h2> | |
| <p class="max-w-2xl mx-auto text-lg text-slate-400 leading-relaxed"> | |
| Solve complex kinematics problems instantly. Visualize velocity, acceleration, and displacement with our interactive simulator. Designed for competitive exam aspirants. | |
| </p> | |
| <div class="flex flex-wrap justify-center gap-4 pt-4"> | |
| <a href="#calculator" class="btn-primary px-6 py-3 rounded-xl text-white font-semibold shadow-lg shadow-brand-500/25 hover:shadow-brand-500/40 transition-all transform hover:-translate-y-0.5"> | |
| <i class="fa-solid fa-calculator mr-2"></i> Start Solving | |
| </a> | |
| <a href="#simulator" class="px-6 py-3 rounded-xl bg-slate-800/80 border border-slate-700 text-slate-300 font-semibold hover:bg-slate-700/80 hover:text-white transition-all"> | |
| <i class="fa-solid fa-play mr-2"></i> Try Simulator | |
| </a> | |
| </div> | |
| </section> | |
| <!-- Theory Section --> | |
| <section id="theory" class="grid md:grid-cols-2 gap-6"> | |
| <div class="glass-card p-8 rounded-2xl space-y-6 hover:border-brand-500/30 transition-all duration-500"> | |
| <div class="flex items-center gap-3 mb-2"> | |
| <div class="w-12 h-12 rounded-xl bg-gradient-to-br from-emerald-500/20 to-emerald-600/10 border border-emerald-500/30 flex items-center justify-center"> | |
| <i class="fa-solid fa-book-open text-emerald-400 text-xl"></i> | |
| </div> | |
| <h3 class="text-xl font-bold text-white">Core Concepts</h3> | |
| </div> | |
| <ul class="space-y-4"> | |
| <li class="flex items-start gap-4 p-4 rounded-xl bg-slate-800/30 border border-slate-700/30 hover:bg-slate-800/50 transition-colors"> | |
| <div class="w-8 h-8 rounded-lg bg-emerald-500/20 flex items-center justify-center flex-shrink-0 mt-0.5"> | |
| <i class="fa-solid fa-arrow-right-arrow-left text-emerald-400 text-sm"></i> | |
| </div> | |
| <div> | |
| <h4 class="text-white font-semibold mb-1">Distance vs Displacement</h4> | |
| <p class="text-sm text-slate-400">Distance is scalar (path length), Displacement is vector (change in position).</p> | |
| </div> | |
| </li> | |
| <li class="flex items-start gap-4 p-4 rounded-xl bg-slate-800/30 border border-slate-700/30 hover:bg-slate-800/50 transition-colors"> | |
| <div class="w-8 h-8 rounded-lg bg-blue-500/20 flex items-center justify-center flex-shrink-0 mt-0.5"> | |
| <i class="fa-solid fa-gauge-high text-blue-400 text-sm"></i> | |
| </div> | |
| <div> | |
| <h4 class="text-white font-semibold mb-1">Speed vs Velocity</h4> | |
| <p class="text-sm text-slate-400">Speed is scalar (distance/time), Velocity is vector (displacement/time).</p> | |
| </div> | |
| </li> | |
| <li class="flex items-start gap-4 p-4 rounded-xl bg-slate-800/30 border border-slate-700/30 hover:bg-slate-800/50 transition-colors"> | |
| <div class="w-8 h-8 rounded-lg bg-violet-500/20 flex items-center justify-center flex-shrink-0 mt-0.5"> | |
| <i class="fa-solid fa-forward text-violet-400 text-sm"></i> | |
| </div> | |
| <div> | |
| <h4 class="text-white font-semibold mb-1">Acceleration</h4> | |
| <p class="text-sm text-slate-400">Rate of change of velocity. Uniform acceleration implies constant change in velocity.</p> | |
| </div> | |
| </li> | |
| </ul> | |
| </div> | |
| <div class="glass-card p-8 rounded-2xl space-y-6 hover:border-amber-500/30 transition-all duration-500"> | |
| <div class="flex items-center gap-3 mb-2"> | |
| <div class="w-12 h-12 rounded-xl bg-gradient-to-br from-amber-500/20 to-orange-600/10 border border-amber-500/30 flex items-center justify-center"> | |
| <i class="fa-solid fa-triangle-exclamation text-amber-400 text-xl"></i> | |
| </div> | |
| <h3 class="text-xl font-bold text-white">Common Mistakes (JEE/NEET)</h3> | |
| </div> | |
| <ul class="space-y-4"> | |
| <li class="flex items-start gap-4 p-4 rounded-xl bg-slate-800/30 border border-slate-700/30 hover:bg-slate-800/50 transition-colors"> | |
| <div class="w-8 h-8 rounded-lg bg-red-500/20 flex items-center justify-center flex-shrink-0 mt-0.5"> | |
| <i class="fa-solid fa-plus-minus text-red-400 text-sm"></i> | |
| </div> | |
| <div> | |
| <h4 class="text-white font-semibold mb-1">Sign Convention</h4> | |
| <p class="text-sm text-slate-400">Always define positive direction. If 'up' is positive, acceleration due to gravity (g) is negative (-9.8 m/s²).</p> | |
| </div> | |
| </li> | |
| <li class="flex items-start gap-4 p-4 rounded-xl bg-slate-800/30 border border-slate-700/30 hover:bg-slate-800/50 transition-colors"> | |
| <div class="w-8 h-8 rounded-lg bg-orange-500/20 flex items-center justify-center flex-shrink-0 mt-0.5"> | |
| <i class="fa-solid fa-car-burst text-orange-400 text-sm"></i> | |
| </div> | |
| <div> | |
| <h4 class="text-white font-semibold mb-1">Stopping Distance</h4> | |
| <p class="text-sm text-slate-400">When a vehicle stops, final velocity v = 0. Do not assume time is given.</p> | |
| </div> | |
| </li> | |
| <li class="flex items-start gap-4 p-4 rounded-xl bg-slate-800/30 border border-slate-700/30 hover:bg-slate-800/50 transition-colors"> | |
| <div class="w-8 h-8 rounded-lg bg-pink-500/20 flex items-center justify-center flex-shrink-0 mt-0.5"> | |
| <i class="fa-solid fa-vector-square text-pink-400 text-sm"></i> | |
| </div> | |
| <div> | |
| <h4 class="text-white font-semibold mb-1">Vector Direction</h4> | |
| <p class="text-sm text-slate-400">Velocity and acceleration can have opposite signs — object slows down but still moves forward.</p> | |
| </div> | |
| </li> | |
| </ul> | |
| </div> | |
| </section> | |
| <!-- Interactive Solver Section --> | |
| <section id="calculator" class="space-y-8"> | |
| <div class="flex flex-col md:flex-row md:items-end justify-between gap-4"> | |
| <div> | |
| <div class="text-brand-400 text-sm font-mono mb-2">PROBLEM SOLVER</div> | |
| <h2 class="text-3xl font-bold text-white">Smart Problem Solver</h2> | |
| <p class="text-slate-400 mt-1">Select variables you know, we'll solve for the rest</p> | |
| </div> | |
| <div class="flex items-center gap-2 text-sm text-slate-400 bg-slate-800/50 px-4 py-2 rounded-lg border border-slate-700/50"> | |
| <i class="fa-solid fa-circle-info text-brand-400"></i> | |
| Need at least 3 variables | |
| </div> | |
| </div> | |
| <div class="grid lg:grid-cols-5 gap-6"> | |
| <!-- Inputs --> | |
| <div class="lg:col-span-2 glass-card p-6 rounded-2xl space-y-5"> | |
| <div class="space-y-4"> | |
| <!-- Input Group: u --> | |
| <div class="input-group"> | |
| <label class="block text-xs font-mono text-brand-400 mb-2 uppercase tracking-wider">Initial Velocity (u)</label> | |
| <div class="flex items-center gap-3"> | |
| <input type="checkbox" id="chk_u" class="custom-checkbox" onchange="toggleInput('u')"> | |
| <input type="number" id="val_u" disabled placeholder="Enter value" class="input-field flex-1 rounded-lg px-4 py-3 text-white placeholder-slate-500 focus:outline-none disabled:cursor-not-allowed font-mono"> | |
| <span class="text-slate-500 text-sm font-mono w-12">m/s</span> | |
| </div> | |
| </div> | |
| <!-- Input Group: v --> | |
| <div class="input-group"> | |
| <label class="block text-xs font-mono text-brand-400 mb-2 uppercase tracking-wider">Final Velocity (v)</label> | |
| <div class="flex items-center gap-3"> | |
| <input type="checkbox" id="chk_v" class="custom-checkbox" onchange="toggleInput('v')"> | |
| <input type="number" id="val_v" disabled placeholder="Enter value" class="input-field flex-1 rounded-lg px-4 py-3 text-white placeholder-slate-500 focus:outline-none disabled:cursor-not-allowed font-mono"> | |
| <span class="text-slate-500 text-sm font-mono w-12">m/s</span> | |
| </div> | |
| </div> | |
| <!-- Input Group: a --> | |
| <div class="input-group"> | |
| <label class="block text-xs font-mono text-brand-400 mb-2 uppercase tracking-wider">Acceleration (a)</label> | |
| <div class="flex items-center gap-3"> | |
| <input type="checkbox" id="chk_a" class="custom-checkbox" onchange="toggleInput('a')"> | |
| <input type="number" id="val_a" disabled placeholder="Enter value" class="input-field flex-1 rounded-lg px-4 py-3 text-white placeholder-slate-500 focus:outline-none disabled:cursor-not-allowed font-mono"> | |
| <span class="text-slate-500 text-sm font-mono w-12">m/s²</span> | |
| </div> | |
| </div> | |
| <!-- Input Group: t --> | |
| <div class="input-group"> | |
| <label class="block text-xs font-mono text-brand-400 mb-2 uppercase tracking-wider">Time (t)</label> | |
| <div class="flex items-center gap-3"> | |
| <input type="checkbox" id="chk_t" class="custom-checkbox" onchange="toggleInput('t')"> | |
| <input type="number" id="val_t" disabled placeholder="Enter value" class="input-field flex-1 rounded-lg px-4 py-3 text-white placeholder-slate-500 focus:outline-none disabled:cursor-not-allowed font-mono"> | |
| <span class="text-slate-500 text-sm font-mono w-12">s</span> | |
| </div> | |
| </div> | |
| <!-- Input Group: s --> | |
| <div class="input-group"> | |
| <label class="block text-xs font-mono text-brand-400 mb-2 uppercase tracking-wider">Displacement (s)</label> | |
| <div class="flex items-center gap-3"> | |
| <input type="checkbox" id="chk_s" class="custom-checkbox" onchange="toggleInput('s')"> | |
| <input type="number" id="val_s" disabled placeholder="Enter value" class="input-field flex-1 rounded-lg px-4 py-3 text-white placeholder-slate-500 focus:outline-none disabled:cursor-not-allowed font-mono"> | |
| <span class="text-slate-500 text-sm font-mono w-12">m</span> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="pt-4 space-y-3"> | |
| <button onclick="solveKinematics()" class="btn-primary w-full py-3.5 rounded-xl text-white font-semibold shadow-lg shadow-brand-500/25 transition-all transform hover:scale-[1.02] active:scale-95 flex items-center justify-center gap-2"> | |
| <i class="fa-solid fa-wand-magic-sparkles"></i> | |
| Solve Problem | |
| </button> | |
| <button onclick="resetSolver()" class="w-full py-3 rounded-xl border border-slate-600 text-slate-400 hover:text-white hover:border-slate-400 hover:bg-slate-800/50 transition-all flex items-center justify-center gap-2"> | |
| <i class="fa-solid fa-rotate-left"></i> | |
| Reset | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Results & Visualization --> | |
| <div class="lg:col-span-3 space-y-6"> | |
| <!-- Result Card --> | |
| <div id="result-card" class="hidden glass-card p-6 rounded-2xl border-l-4 border-brand-500"> | |
| <div class="flex items-center gap-3 mb-6"> | |
| <div class="w-10 h-10 rounded-lg bg-brand-500/20 flex items-center justify-center"> | |
| <i class="fa-solid fa-lightbulb text-brand-400"></i> | |
| </div> | |
| <div> | |
| <h3 class="text-lg font-bold text-white">Solution Steps</h3> | |
| <p class="text-xs text-slate-400">Step-by-step derivation</p> | |
| </div> | |
| </div> | |
| <div id="solution-steps" class="space-y-3"> | |
| <!-- Steps injected via JS --> | |
| </div> | |
| </div> | |
| <!-- Placeholder State --> | |
| <div id="empty-state" class="h-full min-h-[400px] flex flex-col items-center justify-center glass-card rounded-2xl border border-dashed border-slate-700 text-slate-500"> | |
| <div class="w-20 h-20 rounded-2xl bg-slate-800/50 flex items-center justify-center mb-6"> | |
| <i class="fa-solid fa-wave-square text-4xl opacity-50"></i> | |
| </div> | |
| <p class="text-lg font-medium">Select at least 3 variables to solve</p> | |
| <p class="text-sm mt-2">Check the boxes next to known values</p> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Simulator Section --> | |
| <section id="simulator" class="space-y-8"> | |
| <div class="flex flex-col md:flex-row md:items-end justify-between gap-4"> | |
| <div> | |
| <div class="text-violet-400 text-sm font-mono mb-2">VISUALIZATION</div> | |
| <h2 class="text-3xl font-bold text-white">Motion Simulator</h2> | |
| <p class="text-slate-400 mt-1">Visualize velocity-time graphs and particle motion</p> | |
| </div> | |
| <div class="flex flex-wrap gap-2"> | |
| <button onclick="setPreset('freefall')" class="preset-btn px-4 py-2 text-sm bg-slate-800/80 border border-slate-700 rounded-lg hover:border-violet-500/50 text-violet-300 transition-all"> | |
| <i class="fa-solid fa-apple-whole mr-2"></i>Free Fall | |
| </button> | |
| <button onclick="setPreset('acceleration')" class="preset-btn px-4 py-2 text-sm bg-slate-800/80 border border-slate-700 rounded-lg hover:border-emerald-500/50 text-emerald-300 transition-all"> | |
| <i class="fa-solid fa-car mr-2"></i>Car Acceleration | |
| </button> | |
| <button onclick="setPreset('deceleration')" class="preset-btn px-4 py-2 text-sm bg-slate-800/80 border border-slate-700 rounded-lg hover:border-amber-500/50 text-amber-300 transition-all"> | |
| <i class="fa-solid fa-car-burst mr-2"></i>Braking | |
| </button> | |
| </div> | |
| </div> | |
| <div class="grid lg:grid-cols-3 gap-6"> | |
| <!-- Controls --> | |
| <div class="glass-card p-6 rounded-2xl space-y-6"> | |
| <div class="space-y-6"> | |
| <div> | |
| <div class="flex justify-between items-center mb-3"> | |
| <label class="text-sm text-slate-300 font-medium">Initial Velocity (u)</label> | |
| <span id="sim_u_val" class="text-sm font-mono text-brand-400 bg-brand-900/30 px-3 py-1 rounded-lg">0 m/s</span> | |
| </div> | |
| <input type="range" id="sim_u" min="-50" max="50" value="0" step="1" oninput="updateSimParams()" class="w-full"> | |
| <div class="flex justify-between text-xs text-slate-500 mt-1"> | |
| <span>-50</span> | |
| <span>+50</span> | |
| </div> | |
| </div> | |
| <div> | |
| <div class="flex justify-between items-center mb-3"> | |
| <label class="text-sm text-slate-300 font-medium">Acceleration (a)</label> | |
| <span id="sim_a_val" class="text-sm font-mono text-violet-400 bg-violet-900/30 px-3 py-1 rounded-lg">2 m/s²</span> | |
| </div> | |
| <input type="range" id="sim_a" min="-20" max="20" value="2" step="0.5" oninput="updateSimParams()" class="w-full"> | |
| <div class="flex justify-between text-xs text-slate-500 mt-1"> | |
| <span>-20</span> | |
| <span>+20</span> | |
| </div> | |
| </div> | |
| <div> | |
| <div class="flex justify-between items-center mb-3"> | |
| <label class="text-sm text-slate-300 font-medium">Simulation Time</label> | |
| <span id="sim_t_val" class="text-sm font-mono text-emerald-400 bg-emerald-900/30 px-3 py-1 rounded-lg">10 s</span> | |
| </div> | |
| <input type="range" id="sim_t" min="1" max="20" value="10" step="1" oninput="updateSimParams()" class="w-full"> | |
| <div class="flex justify-between text-xs text-slate-500 mt-1"> | |
| <span>1s</span> | |
| <span>20s</span> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="pt-6 border-t border-slate-700/50 grid grid-cols-2 gap-4"> | |
| <div class="stat-card p-4 rounded-xl text-center"> | |
| <div class="text-xs text-slate-500 mb-1">Max Velocity</div> | |
| <div id="stat_vmax" class="text-xl font-bold text-white font-mono">20.0</div> | |
| <div class="text-xs text-slate-500">m/s</div> | |
| </div> | |
| <div class="stat-card p-4 rounded-xl text-center"> | |
| <div class="text-xs text-slate-500 mb-1">Total Distance</div> | |
| <div id="stat_dist" class="text-xl font-bold text-white font-mono">100.0</div> | |
| <div class="text-xs text-slate-500">m</div> | |
| </div> | |
| </div> | |
| <div class="flex gap-3 pt-2"> | |
| <button id="btn-play" onclick="toggleSimulation()" class="flex-1 py-3.5 bg-emerald-600 hover:bg-emerald-500 text-white rounded-xl font-semibold transition-all transform hover:scale-[1.02] active:scale-95 flex items-center justify-center gap-2 shadow-lg shadow-emerald-500/20"> | |
| <i class="fa-solid fa-play"></i> | |
| <span>Start</span> | |
| </button> | |
| <button onclick="resetSimulation()" class="px-5 py-3.5 bg-slate-700 hover:bg-slate-600 text-white rounded-xl transition-all flex items-center justify-center"> | |
| <i class="fa-solid fa-rotate-right"></i> | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Canvas --> | |
| <div class="lg:col-span-2 space-y-4"> | |
| <div class="canvas-container border border-slate-700/50 shadow-2xl shadow-black/50"> | |
| <canvas id="simCanvas"></canvas> | |
| <!-- Overlay Info --> | |
| <div class="absolute top-4 left-4 pointer-events-none"> | |
| <div class="glass px-4 py-2.5 rounded-xl border border-brand-500/30"> | |
| <div class="flex items-center gap-4 text-xs font-mono"> | |
| <div class="flex items-center gap-2"> | |
| <span class="w-2 h-2 rounded-full bg-brand-400"></span> | |
| <span class="text-slate-400">t:</span> | |
| <span id="live_t" class="text-brand-300 font-bold">0.0</span> | |
| <span class="text-slate-500">s</span> | |
| </div> | |
| <div class="w-px h-4 bg-slate-600"></div> | |
| <div class="flex items-center gap-2"> | |
| <span class="w-2 h-2 rounded-full bg-violet-400"></span> | |
| <span class="text-slate-400">v:</span> | |
| <span id="live_v" class="text-violet-300 font-bold">0.0</span> | |
| <span class="text-slate-500">m/s</span> | |
| </div> | |
| <div class="w-px h-4 bg-slate-600"></div> | |
| <div class="flex items-center gap-2"> | |
| <span class="w-2 h-2 rounded-full bg-emerald-400"></span> | |
| <span class="text-slate-400">s:</span> | |
| <span id="live_s" class="text-emerald-300 font-bold">0.0</span> | |
| <span class="text-slate-500">m</span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Legend --> | |
| <div class="absolute bottom-4 right-4 pointer-events-none"> | |
| <div class="glass px-4 py-2 rounded-lg border border-slate-700/50"> | |
| <div class="flex items-center gap-4 text-xs"> | |
| <div class="flex items-center gap-2"> | |
| <span class="w-3 h-3 rounded-full bg-brand-500"></span> | |
| <span class="text-slate-300">Position</span> | |
| </div> | |
| <div class="flex items-center gap-2"> | |
| <span class="w-3 h-3 rounded-full bg-violet-500"></span> | |
| <span class="text-slate-300">Velocity</span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Formula Sheet --> | |
| <section id="formulas" class="glass-card p-8 rounded-2xl"> | |
| <div class="flex items-center gap-3 mb-8"> | |
| <div class="w-12 h-12 rounded-xl bg-gradient-to-br from-pink-500/20 to-rose-600/10 border border-pink-500/30 flex items-center justify-center"> | |
| <i class="fa-solid fa-file-invoice text-pink-400 text-xl"></i> | |
| </div> | |
| <div> | |
| <h2 class="text-2xl font-bold text-white">Essential Formula Sheet</h2> | |
| <p class="text-sm text-slate-400">Fundamental equations of motion</p> | |
| </div> | |
| </div> | |
| <div class="grid md:grid-cols-2 gap-5"> | |
| <div class="formula-card bg-slate-800/40 p-6 rounded-xl border border-slate-700/50 hover:bg-slate-800/60 transition-all"> | |
| <div class="text-slate-500 text-xs font-mono mb-3 uppercase tracking-wider">Velocity & Acceleration</div> | |
| <div class="text-2xl text-white font-mono font-bold mb-3">v = u + at</div> | |
| <div class="text-sm text-slate-400 leading-relaxed">Final velocity equals initial velocity plus acceleration times time.</div> | |
| <div class="mt-4 flex gap-2"> | |
| <span class="px-2 py-1 bg-brand-500/10 text-brand-400 text-xs rounded">v = final velocity</span> | |
| <span class="px-2 py-1 bg-brand-500/10 text-brand-400 text-xs rounded">u = initial velocity</span> | |
| </div> | |
| </div> | |
| <div class="formula-card bg-slate-800/40 p-6 rounded-xl border border-slate-700/50 hover:bg-slate-800/60 transition-all"> | |
| <div class="text-slate-500 text-xs font-mono mb-3 uppercase tracking-wider">Displacement (Time known)</div> | |
| <div class="text-2xl text-white font-mono font-bold mb-3">s = ut + ½at²</div> | |
| <div class="text-sm text-slate-400 leading-relaxed">Distance covered under constant acceleration with time known.</div> | |
| <div class="mt-4 flex gap-2"> | |
| <span class="px-2 py-1 bg-violet-500/10 text-violet-400 text-xs rounded">s = displacement</span> | |
| <span class="px-2 py-1 bg-violet-500/10 text-violet-400 text-xs rounded">t = time</span> | |
| </div> | |
| </div> | |
| <div class="formula-card bg-slate-800/40 p-6 rounded-xl border border-slate-700/50 hover:bg-slate-800/60 transition-all"> | |
| <div class="text-slate-500 text-xs font-mono mb-3 uppercase tracking-wider">Displacement (Time unknown)</div> | |
| <div class="text-2xl text-white font-mono font-bold mb-3">v² = u² + 2as</div> | |
| <div class="text-sm text-slate-400 leading-relaxed">Useful when time is not given or required in the problem.</div> | |
| <div class="mt-4 flex gap-2"> | |
| <span class="px-2 py-1 bg-emerald-500/10 text-emerald-400 text-xs rounded">No time needed</span> | |
| <span class="px-2 py-1 bg-emerald-500/10 text-emerald-400 text-xs rounded">Energy relation</span> | |
| </div> | |
| </div> | |
| <div class="formula-card bg-slate-800/40 p-6 rounded-xl border border-slate-700/50 hover:bg-slate-800/60 transition-all"> | |
| <div class="text-slate-500 text-xs font-mono mb-3 uppercase tracking-wider">Average Velocity</div> | |
| <div class="text-2xl text-white font-mono font-bold mb-3">s = ½(u + v)t</div> | |
| <div class="text-sm text-slate-400 leading-relaxed">Displacement equals average velocity multiplied by time interval.</div> | |
| <div class="mt-4 flex gap-2"> | |
| <span class="px-2 py-1 bg-amber-500/10 text-amber-400 text-xs rounded">Average velocity</span> | |
| <span class="px-2 py-1 bg-amber-500/10 text-amber-400 text-xs rounded">(u+v)/2</span> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| </main> | |
| <!-- Footer --> | |
| <footer class="border-t border-slate-800/50 bg-dark-950 py-12"> | |
| <div class="max-w-7xl mx-auto px-4"> | |
| <div class="flex flex-col md:flex-row items-center justify-between gap-6"> | |
| <div class="flex items-center gap-3"> | |
| <div class="w-10 h-10 rounded-lg bg-gradient-to-br from-brand-500 to-violet-600 flex items-center justify-center"> | |
| <i class="fa-solid fa-atom text-white"></i> | |
| </div> | |
| <div> | |
| <h3 class="text-white font-bold">KinematicsMaster</h3> | |
| <p class="text-xs text-slate-500">Master physics, one dimension at a time</p> | |
| </div> | |
| </div> | |
| <div class="flex items-center gap-6"> | |
| <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="text-sm text-slate-500 hover:text-brand-400 transition-colors flex items-center gap-2"> | |
| <i class="fa-solid fa-code"></i> | |
| Built with anycoder | |
| </a> | |
| </div> | |
| </div> | |
| <div class="mt-8 pt-8 border-t border-slate-800/50 text |