riffusion-app/components/Info.tsx

88 lines
3.1 KiB
TypeScript
Raw Normal View History

2022-11-23 22:46:32 -07:00
import { Dialog, Transition } from "@headlessui/react";
import { Fragment, useState } from "react";
2022-11-24 17:54:00 -07:00
import { FiInfo } from "react-icons/fi";
2022-11-24 17:54:00 -07:00
const Info = () => {
2022-11-23 22:46:32 -07:00
const [open, setOpen] = useState(false);
return (
<>
<button
2022-11-24 17:54:00 -07:00
title="Info"
2022-11-23 22:46:32 -07:00
className="fixed z-90 top-8 right-8 bg-slate-100 w-14 h-14 rounded-full drop-shadow-lg
flex justify-center items-center text-black text-2xl hover:bg-sky-500 hover:drop-shadow-2xl"
2022-11-23 22:46:32 -07:00
onClick={() => setOpen(true)}
>
2022-11-24 17:54:00 -07:00
<FiInfo />
2022-11-23 22:46:32 -07:00
</button>
<Transition appear show={open} as={Fragment}>
<Dialog
as="div"
className="fixed inset-0 z-10 overflow-y-auto"
onClose={() => setOpen(false)}
>
<div className="min-h-screen px-4 text-center">
<Transition.Child
as={Fragment}
enter="ease-out duration-300"
enterFrom="opacity-0"
enterTo="opacity-100"
leave="ease-in duration-200"
leaveFrom="opacity-100"
leaveTo="opacity-0"
>
<Dialog.Overlay className="fixed inset-0" />
</Transition.Child>
<span
className="inline-block h-screen align-middle"
aria-hidden="true"
>
&#8203;
</span>
<Transition.Child
as={Fragment}
enter="ease-out duration-300"
enterFrom="opacity-0 scale-95"
enterTo="opacity-100 scale-100"
leave="ease-in duration-200"
leaveFrom="opacity-100 scale-100"
leaveTo="opacity-0 scale-95"
>
<div className="my-8 inline-block w-full max-w-md transform overflow-hidden rounded-2xl bg-white p-6 text-left align-middle shadow-xl transition-all">
<Dialog.Title
2022-11-24 17:54:00 -07:00
as="h1"
2022-11-24 20:26:39 -07:00
className="text-3xl font-medium leading-6 text-gray-900 pb-2"
>
2022-11-24 17:54:00 -07:00
Welcome to Riffusion
</Dialog.Title>
<div className="mt-2">
<p className="text-sm text-gray-500">
2022-11-24 18:22:59 -07:00
Riffusion is a fine-tuned Stable Diffusion model that
generates spectrogram images from any text prompt. <br></br>
2022-11-24 17:54:00 -07:00
<br></br>
These images are then converted into music. <br></br>
</p>
</div>
<div className="mt-4">
<button
type="button"
className="inline-flex justify-center rounded-md border border-transparent bg-sky-100 px-4 py-2 text-sm font-medium text-sky-800 hover:bg-sky-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-sky-500 focus-visible:ring-offset-2"
onClick={() => setOpen(false)}
>
2022-11-24 18:22:59 -07:00
Let&apos;s Riff 🎸
</button>
</div>
</div>
</Transition.Child>
</div>
</Dialog>
</Transition>
</>
2022-11-23 22:46:32 -07:00
);
};
2022-11-24 17:54:00 -07:00
export default Info;