@@ -10,6 +10,7 @@ import CommonHead from '../../components/CommonHead.astro';
1010import Code from ' ../../icons/Code.astro' ;
1111import Zap from ' ../../icons/Zap.astro' ;
1212import Terminal from ' ../../icons/Terminal.astro' ;
13+ import Menu from ' ../../icons/Menu.astro' ;
1314import ' ../../styles/base.css' ;
1415
1516const isSearchFocused = false ;
@@ -94,9 +95,12 @@ const machine = createMachine({
9495
9596 <header class =" border-b border-cyan-500/20 bg-gray-900/50 backdrop-blur-sm sticky top-0 z-50" >
9697 <div class =" container mx-auto px-4 h-16 flex items-center justify-between" >
97- <div class =" flex items-center gap-8" >
98- <div class =" font-mono text-xl font-bold text-cyan-400" >ROBOT_DOCS</div >
99- <div class ={ ` relative w-64 transition-all duration-300 ${isSearchFocused ? ' w-96' : ' ' } ` } >
98+ <div class =" flex items-center gap-4 lg:gap-8" >
99+ <button id =" mobile-sidebar-toggle" class =" lg:hidden text-cyan-400 p-2" aria-label =" Toggle sidebar" >
100+ <Menu size ={ 24 } />
101+ </button >
102+ <a href =" /" class =" font-mono text-lg lg:text-xl font-bold text-cyan-400" >ROBOT_DOCS</a >
103+ <div class ={ ` hidden lg:block relative w-64 transition-all duration-300 ${isSearchFocused ? ' w-96' : ' ' } ` } >
100104 <Search class =" absolute left-3 top-1/2 -translate-y-1/2 text-gray-500" size ={ 16 } />
101105 <input
102106 type =" text"
@@ -107,16 +111,42 @@ const machine = createMachine({
107111 />
108112 </div >
109113 </div >
110- <nav class =" flex gap-6 text-sm font-mono" >
114+ <nav class =" hidden lg: flex gap-6 text-sm font-mono" >
111115 <a href =" /docs/" class =" text-cyan-400 hover:text-cyan-300" >DOCS</a >
112116 <a href =" /docs/createMachine/" class =" text-gray-400 hover:text-gray-300" >API</a >
113117 <a href =" https://github.com/matthewp/robot" class =" text-gray-400 hover:text-gray-300" >GITHUB</a >
114118 </nav >
119+ <button id =" mobile-menu-toggle" class =" lg:hidden text-cyan-400 p-2" aria-label =" Toggle menu" >
120+ <Menu size ={ 24 } />
121+ </button >
122+ </div >
123+ <!-- Mobile menu -->
124+ <div id =" mobile-menu" class =" hidden lg:hidden border-t border-cyan-500/30" >
125+ <div class =" px-4 py-4 space-y-3" >
126+ <a href =" /docs/" class =" block font-mono text-cyan-300 hover:text-cyan-400 transition-colors" >DOCS</a >
127+ <a href =" /docs/createMachine/" class =" block font-mono text-cyan-300 hover:text-cyan-400 transition-colors" >API</a >
128+ <a href =" https://github.com/matthewp/robot" class =" block font-mono text-cyan-300 hover:text-cyan-400 transition-colors" >GITHUB</a >
129+ <div class =" relative" >
130+ <Search class =" absolute left-3 top-1/2 -translate-y-1/2 text-gray-500" size ={ 16 } />
131+ <input
132+ type =" text"
133+ placeholder =" Search..."
134+ class =" w-full bg-gray-800 rounded-lg pl-10 pr-4 py-2 text-sm border-2 border-transparent focus:border-cyan-500 outline-none"
135+ />
136+ </div >
137+ </div >
115138 </div >
116139 </header >
117140
141+ <script >
142+ import { initMobileNav } from '../../scripts/mobile-nav.js';
143+ initMobileNav();
144+ </script >
145+
118146 <div class =" container mx-auto px-4 flex gap-6" >
119- <Sidebar />
147+ <div id =" docs-sidebar" class =" fixed lg:static lg:translate-x-0 -translate-x-full top-16 left-0 h-[calc(100vh-4rem)] lg:h-auto w-64 bg-gray-900/95 lg:bg-transparent backdrop-blur-sm lg:backdrop-blur-none z-50 lg:z-auto transition-transform duration-300 overflow-y-auto" >
148+ <Sidebar />
149+ </div >
120150 <main class =" flex-1 py-8 min-w-0" >
121151 <div class =" prose prose-invert max-w-none" >
122152 <div class =" flex items-center gap-2 text-sm font-mono text-gray-400 mb-4" >
@@ -126,16 +156,16 @@ const machine = createMachine({
126156 <span >GETTING_STARTED</span >
127157 </div >
128158
129- <h1 class =" font-mono text-4xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-cyan-400 to-pink-500 mb-8" >
159+ <h1 class =" font-mono text-3xl lg:text- 4xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-cyan-400 to-pink-500 mb-8" >
130160 Robot Documentation
131161 </h1 >
132162
133- <p class =" text-xl text-gray-300 mb-8" >
163+ <p class =" text-lg lg:text- xl text-gray-300 mb-8" >
134164 Build <strong class =" text-cyan-400" >finite state machines</strong > in a simple and flexible way.
135165 At just <strong class =" text-cyan-400" >1KB</strong >, Robot brings declarative state management to your applications.
136166 </p >
137167
138- <div class =" grid md:grid-cols-3 gap-6 mb-12" >
168+ <div class =" grid grid-cols-1 md:grid-cols-3 gap-4 lg: gap-6 mb-12" >
139169 <FeatureCard
140170 title =" TINY_SIZE"
141171 description =" Just 1KB of pure robotic efficiency. No bloat, all bot!"
@@ -156,7 +186,7 @@ const machine = createMachine({
156186 </FeatureCard >
157187 </div >
158188
159- <h2 class =" font-mono text-3xl font-bold text-cyan-400 mb-6" >Getting Started</h2 >
189+ <h2 class =" font-mono text-2xl lg:text- 3xl font-bold text-cyan-400 mb-6" >Getting Started</h2 >
160190
161191 <p class =" text-gray-300 mb-6" >
162192 Install Robot via npm or yarn:
@@ -175,7 +205,7 @@ const machine = createMachine({
175205 </div >
176206 </div >
177207
178- <h3 class =" font-mono text-2xl font-bold text-cyan-400 mb-4" >Basic Example</h3 >
208+ <h3 class =" font-mono text-xl lg:text- 2xl font-bold text-cyan-400 mb-4" >Basic Example</h3 >
179209
180210 <p class =" text-gray-300 mb-6" >
181211 Create your first state machine:
@@ -186,7 +216,7 @@ const machine = createMachine({
186216 code ={ basicExample }
187217 />
188218
189- <h3 class =" font-mono text-2xl font-bold text-cyan-400 mb-4 mt-8" >Use with React/Preact</h3 >
219+ <h3 class =" font-mono text-xl lg:text- 2xl font-bold text-cyan-400 mb-4 mt-8" >Use with React/Preact</h3 >
190220
191221 <p class =" text-gray-300 mb-6" >
192222 Robot has integrations for all major frameworks:
@@ -197,7 +227,7 @@ const machine = createMachine({
197227 code ={ integrationExample }
198228 />
199229
200- <h3 class =" font-mono text-2xl font-bold text-cyan-400 mb-4 mt-8" >Advanced Features</h3 >
230+ <h3 class =" font-mono text-xl lg:text- 2xl font-bold text-cyan-400 mb-4 mt-8" >Advanced Features</h3 >
201231
202232 <p class =" text-gray-300 mb-6" >
203233 Handle async operations, context, and complex state logic:
@@ -209,7 +239,7 @@ const machine = createMachine({
209239 />
210240
211241 <div class =" bg-gray-900/50 rounded-xl p-8 border border-cyan-500/30 mt-12" >
212- <h3 class =" font-mono text-2xl font-bold text-cyan-400 mb-4" >Why Finite State Machines?</h3 >
242+ <h3 class =" font-mono text-xl lg:text- 2xl font-bold text-cyan-400 mb-4" >Why Finite State Machines?</h3 >
213243 <p class =" text-gray-300 mb-4" >
214244 Robot brings the declarative revolution to application state. Instead of managing multiple booleans
215245 and imperative state updates, define your states declaratively and eliminate invalid states entirely.
@@ -218,7 +248,7 @@ const machine = createMachine({
218248 With Robot, your states and transitions are validated when the machine is created, preventing an
219249 entire category of bugs before they happen.
220250 </p >
221- <div class =" grid md:grid-cols-2 gap-8" >
251+ <div class =" grid grid-cols-1 md:grid-cols-2 gap-6 lg: gap-8" >
222252 <div >
223253 <h4 class =" font-mono text-lg font-bold text-pink-400 mb-3" >✅ With Robot</h4 >
224254 <ul class =" text-gray-300 space-y-2 text-sm" >
@@ -241,11 +271,11 @@ const machine = createMachine({
241271 </div >
242272
243273 <div class =" mt-12 text-center" >
244- <h3 class =" font-mono text-2xl font-bold text-cyan-400 mb-4" >Ready to Build?</h3 >
274+ <h3 class =" font-mono text-xl lg:text- 2xl font-bold text-cyan-400 mb-4" >Ready to Build?</h3 >
245275 <p class =" text-gray-300 mb-6" >
246276 Explore the documentation to learn about Robot's powerful features and integrations.
247277 </p >
248- <div class =" flex justify-center gap-4" >
278+ <div class =" flex flex-col sm:flex-row justify-center gap-4" >
249279 <a href =" /docs/createMachine/" class =" bg-cyan-500 hover:bg-cyan-400 text-black font-mono px-6 py-3 rounded-lg transition-colors" >
250280 API Reference
251281 </a >
0 commit comments