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 21:16:45 -07:00
|
|
|
import styled, { css } from "styled-components";
|
2022-11-23 15:48:40 -07:00
|
|
|
|
2022-11-24 21:16:45 -07:00
|
|
|
const ModalContainer = styled.div`
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100vw;
|
|
|
|
height: 100vh;
|
|
|
|
background: rgba(0, 0, 0, 0.5);
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
`;
|
|
|
|
|
|
|
|
export default function Info(){
|
2022-11-23 22:46:32 -07:00
|
|
|
const [open, setOpen] = useState(false);
|
2022-11-23 15:48:40 -07:00
|
|
|
|
|
|
|
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
|
2022-11-23 15:48:40 -07:00
|
|
|
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>
|
2022-11-23 15:48:40 -07:00
|
|
|
|
|
|
|
<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"
|
|
|
|
>
|
|
|
|
​
|
|
|
|
</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"
|
|
|
|
>
|
2022-11-24 21:16:45 -07:00
|
|
|
<ModalContainer>
|
|
|
|
<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
|
|
|
|
as="h1"
|
|
|
|
className="text-3xl font-medium leading-6 text-gray-900 pb-2"
|
2022-11-23 15:48:40 -07:00
|
|
|
>
|
2022-11-24 21:16:45 -07:00
|
|
|
Welcome to Riffusion
|
|
|
|
</Dialog.Title>
|
|
|
|
<div className="mt-2">
|
|
|
|
<p className="text-sm text-gray-500">
|
|
|
|
Riffusion is a fine-tuned Stable Diffusion model that
|
|
|
|
generates spectrogram images from any text prompt. <br></br>
|
|
|
|
<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)}
|
|
|
|
>
|
|
|
|
Let's Riff 🎸
|
|
|
|
</button>
|
|
|
|
</div>
|
2022-11-23 15:48:40 -07:00
|
|
|
</div>
|
2022-11-24 21:16:45 -07:00
|
|
|
</ModalContainer>
|
2022-11-23 15:48:40 -07:00
|
|
|
</Transition.Child>
|
|
|
|
</div>
|
2022-11-24 21:16:45 -07:00
|
|
|
</Dialog>
|
|
|
|
</Transition>
|
2022-11-23 15:48:40 -07:00
|
|
|
</>
|
2022-11-23 22:46:32 -07:00
|
|
|
);
|
2022-11-24 21:16:45 -07:00
|
|
|
};
|