1
0
mirror of https://github.com/upscayl/upscayl.git synced 2025-02-17 11:18:36 +01:00

Add new model selection

This commit is contained in:
Nayam Amarshe 2024-10-06 13:01:25 +05:30
parent a6f344f3b8
commit ddd286574b
14 changed files with 20 additions and 19 deletions

View File

@ -51,17 +51,16 @@ export default function SelectModel() {
const modelId = modelData[0] as ModelId; const modelId = modelData[0] as ModelId;
const model = modelData[1]; const model = modelData[1];
return ( return (
<Button <button
key={modelId} key={modelId}
variant="outline" className="btn h-auto w-full flex-col items-start p-4"
className="h-auto w-full flex-col items-start p-4"
onClick={() => handleModelSelect(modelId)} onClick={() => handleModelSelect(modelId)}
> >
<div className="mb-2 font-semibold">{model.name}</div> <div className="mb-2 font-semibold">{model.name}</div>
<div className="relative h-52 w-full overflow-hidden rounded-md"> <div className="relative h-52 w-full overflow-hidden rounded-md">
<div className="flex h-full w-full"> <div className="flex h-full w-full">
<img <img
src={`/model-comparison/${model.name}/before.webp`} src={`/model-comparison/${model.id}/before.webp`}
alt={`${model.name} Before`} alt={`${model.name} Before`}
className="h-full w-1/2 object-cover" className="h-full w-1/2 object-cover"
/> />
@ -90,19 +89,21 @@ export default function SelectModel() {
<span className="sr-only">Zoom</span> <span className="sr-only">Zoom</span>
</Button> </Button>
</div> </div>
</Button> </button>
); );
})} })}
<p className="font-semibold text-base-content">
Imported Custom Models
</p>
{customModelIds.map((customModel) => { {customModelIds.map((customModel) => {
return ( return (
<Button <button
key={customModel} key={customModel}
variant="outline" className="btn h-auto w-full flex-col items-start p-4"
className="h-auto w-full flex-col items-start p-4"
onClick={() => handleModelSelect(customModel)} onClick={() => handleModelSelect(customModel)}
> >
{customModel} {customModel}
</Button> </button>
); );
})} })}
</div> </div>
@ -141,15 +142,13 @@ export default function SelectModel() {
</div> </div>
</div> </div>
</div> </div>
<Button <button
variant="secondary" className="btn btn-circle btn-secondary absolute right-4 top-4"
size="icon"
className="absolute right-4 top-4"
onClick={() => setZoomedModel(null)} onClick={() => setZoomedModel(null)}
> >
<X className="h-4 w-4" /> <X className="h-4 w-4" />
<span className="sr-only">Close</span> <span className="sr-only">Close</span>
</Button> </button>
</div> </div>
</DialogContent> </DialogContent>
</Dialog> </Dialog>

View File

@ -34,7 +34,7 @@ const DialogContent = React.forwardRef<
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & { React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {
hideCloseButton?: boolean; hideCloseButton?: boolean;
} }
>(({ className, children, ...props }, ref) => { >(({ className, children, hideCloseButton, ...props }, ref) => {
const t = useTranslation(); const t = useTranslation();
return ( return (
@ -49,10 +49,12 @@ const DialogContent = React.forwardRef<
{...props} {...props}
> >
{children} {children}
{!hideCloseButton && (
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none"> <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none">
<X className="h-4 w-4" /> <X className="h-4 w-4" />
<span className="sr-only">{t("APP.DIALOG_BOX.CLOSE")}</span> <span className="sr-only">{t("APP.DIALOG_BOX.CLOSE")}</span>
</DialogPrimitive.Close> </DialogPrimitive.Close>
)}
</DialogPrimitive.Content> </DialogPrimitive.Content>
</DialogPortal> </DialogPortal>
); );

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB