Merge pull request #86 from jmorganca/welcome-screen-improve
welcome screen improvements
This commit is contained in:
commit
c05219aa0d
|
@ -11,6 +11,10 @@ body {
|
||||||
-webkit-app-region: drag;
|
-webkit-app-region: drag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.no-drag {
|
||||||
|
-webkit-app-region: no-drag;
|
||||||
|
}
|
||||||
|
|
||||||
.blink {
|
.blink {
|
||||||
-webkit-animation: 1s blink step-end infinite;
|
-webkit-animation: 1s blink step-end infinite;
|
||||||
-moz-animation: 1s blink step-end infinite;
|
-moz-animation: 1s blink step-end infinite;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import copy from 'copy-to-clipboard'
|
import copy from 'copy-to-clipboard'
|
||||||
import { DocumentDuplicateIcon } from '@heroicons/react/24/outline'
|
import { CheckIcon, DocumentDuplicateIcon } from '@heroicons/react/24/outline'
|
||||||
import Store from 'electron-store'
|
import Store from 'electron-store'
|
||||||
import { getCurrentWindow } from '@electron/remote'
|
import { getCurrentWindow } from '@electron/remote'
|
||||||
|
|
||||||
|
@ -17,10 +17,12 @@ enum Step {
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
const [step, setStep] = useState<Step>(Step.WELCOME)
|
const [step, setStep] = useState<Step>(Step.WELCOME)
|
||||||
|
const [commandCopied, setCommandCopied] = useState<boolean>(false)
|
||||||
|
|
||||||
const command = 'ollama run orca'
|
const command = 'ollama run orca'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<div className='drag'>
|
||||||
<div className='mx-auto flex min-h-screen w-full flex-col justify-between bg-white px-4 pt-16'>
|
<div className='mx-auto flex min-h-screen w-full flex-col justify-between bg-white px-4 pt-16'>
|
||||||
{step === Step.WELCOME && (
|
{step === Step.WELCOME && (
|
||||||
<>
|
<>
|
||||||
|
@ -31,7 +33,7 @@ export default function () {
|
||||||
</p>
|
</p>
|
||||||
<button
|
<button
|
||||||
onClick={() => setStep(Step.CLI)}
|
onClick={() => setStep(Step.CLI)}
|
||||||
className='rounded-dm mx-auto my-8 w-[40%] rounded-md bg-black px-4 py-2 text-sm text-white hover:brightness-110'
|
className='no-drag rounded-dm mx-auto my-8 w-[40%] rounded-md bg-black px-4 py-2 text-sm text-white hover:brightness-110'
|
||||||
>
|
>
|
||||||
Next
|
Next
|
||||||
</button>
|
</button>
|
||||||
|
@ -54,7 +56,7 @@ export default function () {
|
||||||
getCurrentWindow().focus()
|
getCurrentWindow().focus()
|
||||||
setStep(Step.FINISH)
|
setStep(Step.FINISH)
|
||||||
}}
|
}}
|
||||||
className='rounded-dm mx-auto w-[60%] rounded-md bg-black px-4 py-2 text-sm text-white hover:brightness-110'
|
className='no-drag rounded-dm mx-auto w-[60%] rounded-md bg-black px-4 py-2 text-sm text-white hover:brightness-110'
|
||||||
>
|
>
|
||||||
Install
|
Install
|
||||||
</button>
|
</button>
|
||||||
|
@ -75,12 +77,18 @@ export default function () {
|
||||||
{command}
|
{command}
|
||||||
</pre>
|
</pre>
|
||||||
<button
|
<button
|
||||||
className='absolute right-[5px] rounded-md border bg-white/90 px-2 py-2 text-gray-400 opacity-0 backdrop-blur-xl hover:text-gray-600 group-hover:opacity-100'
|
className={`no-drag absolute right-[5px] px-2 py-2 ${commandCopied ? 'text-gray-900 opacity-100 hover:cursor-auto' : 'text-gray-200 opacity-50 hover:cursor-pointer'} hover:text-gray-900 hover:font-bold group-hover:opacity-100`}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
copy(command)
|
copy(command)
|
||||||
|
setCommandCopied(true)
|
||||||
|
setTimeout(() => setCommandCopied(false), 3000)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
{commandCopied ? (
|
||||||
|
<CheckIcon className='h-4 w-4 text-gray-500 font-bold' />
|
||||||
|
) : (
|
||||||
<DocumentDuplicateIcon className='h-4 w-4 text-gray-500' />
|
<DocumentDuplicateIcon className='h-4 w-4 text-gray-500' />
|
||||||
|
)}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<p className='mx-auto my-4 w-[70%] text-xs text-gray-400'>Run this command in your favorite terminal.</p>
|
<p className='mx-auto my-4 w-[70%] text-xs text-gray-400'>Run this command in your favorite terminal.</p>
|
||||||
|
@ -90,7 +98,7 @@ export default function () {
|
||||||
store.set('first-time-run', true)
|
store.set('first-time-run', true)
|
||||||
window.close()
|
window.close()
|
||||||
}}
|
}}
|
||||||
className='rounded-dm mx-auto w-[60%] rounded-md bg-black px-4 py-2 text-sm text-white hover:brightness-110'
|
className='no-drag rounded-dm mx-auto w-[60%] rounded-md bg-black px-4 py-2 text-sm text-white hover:brightness-110'
|
||||||
>
|
>
|
||||||
Finish
|
Finish
|
||||||
</button>
|
</button>
|
||||||
|
@ -98,5 +106,6 @@ export default function () {
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue