1
- import { useState } from 'react' ;
1
+ import { useState , Fragment } from 'react' ;
2
2
import Head from 'next/head' ;
3
3
import Image from 'next/image' ;
4
- import Script from 'next/script' ;
5
4
import Link from 'next/link' ;
6
- import { Disclosure } from '@headlessui/react' ;
5
+ import { Menu , Transition , Disclosure } from '@headlessui/react' ;
6
+ import { ChevronDownIcon } from '@heroicons/react/solid' ;
7
7
import {
8
- MailIcon ,
8
+ MailIcon , PencilAltIcon ,
9
9
} from '@heroicons/react/outline' ;
10
10
import CodeEditor from '../components/CodeEditor' ;
11
11
import Output from '../components/Output' ;
@@ -124,11 +124,9 @@ export default function Example() {
124
124
'absolute inset-x-0 left-1/2 transform -translate-x-1/2 w-full overflow-hidden lg:inset-y-0' ,
125
125
) }
126
126
>
127
- < div className = "relative h-full" >
128
- < canvas id = "gradient-canvas" />
129
- </ div >
127
+ < div className = "relative h-full gradient" />
130
128
</ div >
131
- < header className = "relative py-8 " >
129
+ < header className = "relative py-6 " >
132
130
< div className = "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8" >
133
131
< h1 className = "text-2xl font-bold text-white" > Documentation Generator</ h1 >
134
132
< p className = "mt-1 text-gray-300" > Add some code to get started</ p >
@@ -149,17 +147,112 @@ export default function Example() {
149
147
language = { outputDisplay }
150
148
/>
151
149
</ div >
152
- < div className = "h-full sm:m-0" >
150
+ < div className = "h-full mt-4 sm:m-0" >
153
151
< Output
154
152
output = { outputDisplay }
155
153
isLoading = { false }
156
154
/>
157
155
</ div >
158
156
</ div >
159
157
</ div >
158
+ < div className = "mt-16 w-full" >
159
+ < div className = "grid gap-8 items-start justify-center" >
160
+ < span className = "relative px-7 py-4 rounded-lg leading-none flex items-center border border-gray-100 shadow-sm" >
161
+ < span className = "flex space-x-5" >
162
+ < div >
163
+ < p className = "text-sm text-gray-600 mb-1 font-medium" > Language</ p >
164
+ < Menu as = "div" className = "relative inline-block text-left" >
165
+ < div >
166
+ < Menu . Button className = "inline-flex justify-center w-full rounded-md border border-gray-200 shadow-sm px-2 py-1 bg-white text-sm text-gray-700 hover:bg-gray-50 hover:border-gray-300" >
167
+ Auto-detect
168
+ < ChevronDownIcon className = "-mr-1 ml-2 h-5 w-5" aria-hidden = "true" />
169
+ </ Menu . Button >
170
+ </ div >
171
+
172
+ < Transition
173
+ as = { Fragment }
174
+ enter = "transition ease-out duration-100"
175
+ enterFrom = "transform opacity-0 scale-95"
176
+ enterTo = "transform opacity-100 scale-100"
177
+ leave = "transition ease-in duration-75"
178
+ leaveFrom = "transform opacity-100 scale-100"
179
+ leaveTo = "transform opacity-0 scale-95"
180
+ >
181
+ < Menu . Items className = "origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none" >
182
+ < div className = "py-1" >
183
+ < Menu . Item >
184
+ { ( { active } ) => (
185
+ < span
186
+ className = { classNames (
187
+ active ? 'bg-gray-100 text-gray-900' : 'text-gray-700' ,
188
+ 'block px-4 py-2 text-sm' ,
189
+ ) }
190
+ >
191
+ Account settings
192
+ </ span >
193
+ ) }
194
+ </ Menu . Item >
195
+ </ div >
196
+ </ Menu . Items >
197
+ </ Transition >
198
+ </ Menu >
199
+ </ div >
200
+ < div >
201
+ < p className = "text-sm text-gray-600 mb-1 font-medium" > Format</ p >
202
+ < Menu as = "div" className = "relative inline-block text-left" >
203
+ < div >
204
+ < Menu . Button className = "inline-flex justify-center w-full rounded-md border border-gray-200 shadow-sm px-2 py-1 bg-white text-sm text-gray-700 hover:bg-gray-50 hover:border-gray-300" >
205
+ Auto-detect
206
+ < ChevronDownIcon className = "-mr-1 ml-2 h-5 w-5" aria-hidden = "true" />
207
+ </ Menu . Button >
208
+ </ div >
209
+
210
+ < Transition
211
+ as = { Fragment }
212
+ enter = "transition ease-out duration-100"
213
+ enterFrom = "transform opacity-0 scale-95"
214
+ enterTo = "transform opacity-100 scale-100"
215
+ leave = "transition ease-in duration-75"
216
+ leaveFrom = "transform opacity-100 scale-100"
217
+ leaveTo = "transform opacity-0 scale-95"
218
+ >
219
+ < Menu . Items className = "origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none" >
220
+ < div className = "py-1" >
221
+ < Menu . Item >
222
+ { ( { active } ) => (
223
+ < span
224
+ className = { classNames (
225
+ active ? 'bg-gray-100 text-gray-900' : 'text-gray-700' ,
226
+ 'block px-4 py-2 text-sm' ,
227
+ ) }
228
+ >
229
+ Account settings
230
+ </ span >
231
+ ) }
232
+ </ Menu . Item >
233
+ </ div >
234
+ </ Menu . Items >
235
+ </ Transition >
236
+ </ Menu >
237
+ </ div >
238
+ < button
239
+ type = "button"
240
+ className = "inline-flex space-x-1 items-center px-4 py-2 text-sm rounded-md text-green-600 bg-green-500 bg-opacity-25 hover:bg-opacity-40 duration-200"
241
+ >
242
+ < div >
243
+ Generate
244
+ </ div >
245
+ < div >
246
+ < PencilAltIcon className = "h-4 w-4" />
247
+ </ div >
248
+ </ button >
249
+ </ span >
250
+ </ span >
251
+ </ div >
252
+ </ div >
160
253
</ div >
161
254
</ main >
162
- < footer className = "fixed pb-8 z-10 bottom-0 w-full" >
255
+ < footer className = "relative pb-8 z-10 bottom-0 w-full" >
163
256
< div className = "max-w-7xl mx-auto px-4 overflow-hidden sm:px-6 lg:px-8" >
164
257
< div className = "mt-8 flex justify-center space-x-6" >
165
258
{ footer . social . map ( ( item ) => (
@@ -180,7 +273,6 @@ export default function Example() {
180
273
</ p >
181
274
</ div >
182
275
</ footer >
183
- < Script src = "gradient.js" />
184
276
</ div >
185
277
) ;
186
278
}
0 commit comments