2022-08-15 10:23:14 +05:30
|
|
|
import { useState, useEffect, useRef } from "react";
|
|
|
|
|
|
|
|
const Home = () => {
|
2022-08-16 07:47:27 +05:30
|
|
|
const [imagePath, SetImagePath] = useState();
|
|
|
|
|
2022-08-15 10:23:14 +05:30
|
|
|
useEffect(() => {
|
2022-08-15 12:36:31 +05:30
|
|
|
// send(command, payload)
|
|
|
|
window.electron.send("sendMessage", { message: "Hello!" });
|
2022-08-15 10:23:14 +05:30
|
|
|
}, []);
|
2022-08-16 07:47:27 +05:30
|
|
|
|
2022-08-15 15:42:48 +05:30
|
|
|
const imageHandler = async () => {
|
2022-08-16 07:47:27 +05:30
|
|
|
var path = await window.electron.invoke("open");
|
|
|
|
SetImagePath(path);
|
|
|
|
console.log(imagePath);
|
|
|
|
};
|
|
|
|
|
2022-08-15 10:23:14 +05:30
|
|
|
return (
|
2022-08-15 12:51:12 +05:30
|
|
|
<div className="flex h-screen w-screen flex-row bg-neutral-900">
|
|
|
|
<div className="flex h-screen w-96 flex-col bg-neutral-800 p-5">
|
|
|
|
<h1 className="text-3xl font-bold text-neutral-50">Upscayl</h1>
|
|
|
|
<div className="mt-10">
|
|
|
|
<p className="mb-2 font-medium text-neutral-100">Step 1</p>
|
2022-08-16 07:47:27 +05:30
|
|
|
<button className="rounded-lg bg-sky-400 p-3" onClick={imageHandler}>
|
|
|
|
Select Image
|
|
|
|
</button>
|
2022-08-15 12:51:12 +05:30
|
|
|
</div>
|
|
|
|
<div className="mt-10">
|
|
|
|
<p className="mb-2 font-medium text-neutral-100">Step 2</p>
|
|
|
|
<p className="mb-1 text-neutral-300">Select Scale Factor:</p>
|
|
|
|
<div className="flex flex-row gap-2">
|
|
|
|
<button className="rounded-lg bg-red-400 p-3">2x</button>
|
|
|
|
<button className="rounded-lg bg-red-400 p-3">4x</button>
|
|
|
|
<button className="rounded-lg bg-red-400 p-3">6x</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="mt-10">
|
|
|
|
<p className="mb-2 font-medium text-neutral-100">Step 3</p>
|
|
|
|
<button className="rounded-lg bg-violet-400 p-3">
|
|
|
|
Set Output Folder
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<div className="mt-10">
|
|
|
|
<p className="mb-2 font-medium text-neutral-100">Step 4</p>
|
|
|
|
<button className="rounded-lg bg-green-400 p-3">Upscayl</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="flex h-screen w-full flex-col items-center justify-center p-5">
|
|
|
|
<p className="text-lg font-medium text-neutral-400">
|
|
|
|
Select an Image to Upscale
|
|
|
|
</p>
|
2022-08-15 10:23:14 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Home;
|