@@ -10,6 +10,7 @@ import CommonHead from '../../components/CommonHead.astro';
10
10
import Code from ' ../../icons/Code.astro' ;
11
11
import Zap from ' ../../icons/Zap.astro' ;
12
12
import Terminal from ' ../../icons/Terminal.astro' ;
13
+ import Menu from ' ../../icons/Menu.astro' ;
13
14
import ' ../../styles/base.css' ;
14
15
15
16
const isSearchFocused = false ;
@@ -94,9 +95,12 @@ const machine = createMachine({
94
95
95
96
<header class =" border-b border-cyan-500/20 bg-gray-900/50 backdrop-blur-sm sticky top-0 z-50" >
96
97
<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' : ' ' } ` } >
100
104
<Search class =" absolute left-3 top-1/2 -translate-y-1/2 text-gray-500" size ={ 16 } />
101
105
<input
102
106
type =" text"
@@ -107,16 +111,42 @@ const machine = createMachine({
107
111
/>
108
112
</div >
109
113
</div >
110
- <nav class =" flex gap-6 text-sm font-mono" >
114
+ <nav class =" hidden lg: flex gap-6 text-sm font-mono" >
111
115
<a href =" /docs/" class =" text-cyan-400 hover:text-cyan-300" >DOCS</a >
112
116
<a href =" /docs/createMachine/" class =" text-gray-400 hover:text-gray-300" >API</a >
113
117
<a href =" https://github.com/matthewp/robot" class =" text-gray-400 hover:text-gray-300" >GITHUB</a >
114
118
</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 >
115
138
</div >
116
139
</header >
117
140
141
+ <script >
142
+ import { initMobileNav } from '../../scripts/mobile-nav.js';
143
+ initMobileNav();
144
+ </script >
145
+
118
146
<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 >
120
150
<main class =" flex-1 py-8 min-w-0" >
121
151
<div class =" prose prose-invert max-w-none" >
122
152
<div class =" flex items-center gap-2 text-sm font-mono text-gray-400 mb-4" >
@@ -126,16 +156,16 @@ const machine = createMachine({
126
156
<span >GETTING_STARTED</span >
127
157
</div >
128
158
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" >
130
160
Robot Documentation
131
161
</h1 >
132
162
133
- <p class =" text-xl text-gray-300 mb-8" >
163
+ <p class =" text-lg lg:text- xl text-gray-300 mb-8" >
134
164
Build <strong class =" text-cyan-400" >finite state machines</strong > in a simple and flexible way.
135
165
At just <strong class =" text-cyan-400" >1KB</strong >, Robot brings declarative state management to your applications.
136
166
</p >
137
167
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" >
139
169
<FeatureCard
140
170
title =" TINY_SIZE"
141
171
description =" Just 1KB of pure robotic efficiency. No bloat, all bot!"
@@ -156,7 +186,7 @@ const machine = createMachine({
156
186
</FeatureCard >
157
187
</div >
158
188
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 >
160
190
161
191
<p class =" text-gray-300 mb-6" >
162
192
Install Robot via npm or yarn:
@@ -175,7 +205,7 @@ const machine = createMachine({
175
205
</div >
176
206
</div >
177
207
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 >
179
209
180
210
<p class =" text-gray-300 mb-6" >
181
211
Create your first state machine:
@@ -186,7 +216,7 @@ const machine = createMachine({
186
216
code ={ basicExample }
187
217
/>
188
218
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 >
190
220
191
221
<p class =" text-gray-300 mb-6" >
192
222
Robot has integrations for all major frameworks:
@@ -197,7 +227,7 @@ const machine = createMachine({
197
227
code ={ integrationExample }
198
228
/>
199
229
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 >
201
231
202
232
<p class =" text-gray-300 mb-6" >
203
233
Handle async operations, context, and complex state logic:
@@ -209,7 +239,7 @@ const machine = createMachine({
209
239
/>
210
240
211
241
<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 >
213
243
<p class =" text-gray-300 mb-4" >
214
244
Robot brings the declarative revolution to application state. Instead of managing multiple booleans
215
245
and imperative state updates, define your states declaratively and eliminate invalid states entirely.
@@ -218,7 +248,7 @@ const machine = createMachine({
218
248
With Robot, your states and transitions are validated when the machine is created, preventing an
219
249
entire category of bugs before they happen.
220
250
</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" >
222
252
<div >
223
253
<h4 class =" font-mono text-lg font-bold text-pink-400 mb-3" >✅ With Robot</h4 >
224
254
<ul class =" text-gray-300 space-y-2 text-sm" >
@@ -241,11 +271,11 @@ const machine = createMachine({
241
271
</div >
242
272
243
273
<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 >
245
275
<p class =" text-gray-300 mb-6" >
246
276
Explore the documentation to learn about Robot's powerful features and integrations.
247
277
</p >
248
- <div class =" flex justify-center gap-4" >
278
+ <div class =" flex flex-col sm:flex-row justify-center gap-4" >
249
279
<a href =" /docs/createMachine/" class =" bg-cyan-500 hover:bg-cyan-400 text-black font-mono px-6 py-3 rounded-lg transition-colors" >
250
280
API Reference
251
281
</a >
0 commit comments