mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-11-16 01:21:16 +01:00
feat(ui): update CompressSettings and OAuth buttons for improved usability
- Replaced `Slider` with `SliderWithInput` in `CompressSettings` for enhanced functionality - Translated compression level tooltips and descriptions using i18n for better localization - Switched custom `Button` in `OAuthButtons` to semantic `button` for accessibility - Adjusted styles and interactions in `auth.css` for hover and focus states Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
This commit is contained in:
parent
d38c01ca1f
commit
dd45b0ba2d
@ -1,4 +1,5 @@
|
|||||||
import { Stack, Text, NumberInput, Select, Divider, Checkbox } from "@mantine/core";
|
import { Stack, Text, NumberInput, Select, Divider, Checkbox } from "@mantine/core";
|
||||||
|
import SliderWithInput from '@app/components/shared/sliderWithInput/SliderWithInput';
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { CompressParameters } from "@app/hooks/tools/compress/useCompressParameters";
|
import { CompressParameters } from "@app/hooks/tools/compress/useCompressParameters";
|
||||||
import ButtonSelector from "@app/components/shared/ButtonSelector";
|
import ButtonSelector from "@app/components/shared/ButtonSelector";
|
||||||
@ -32,24 +33,19 @@ const CompressSettings = ({ parameters, onParameterChange, disabled = false }: C
|
|||||||
{parameters.compressionMethod === 'quality' && (
|
{parameters.compressionMethod === 'quality' && (
|
||||||
<Stack gap="sm">
|
<Stack gap="sm">
|
||||||
<Divider />
|
<Divider />
|
||||||
<Text size="sm" fw={500}>Compression Level</Text>
|
<SliderWithInput
|
||||||
<Slider
|
label={t('compress.tooltip.qualityAdjustment.title', 'Compression Level')}
|
||||||
min={1}
|
|
||||||
max={9}
|
|
||||||
step={1}
|
|
||||||
value={parameters.compressionLevel}
|
value={parameters.compressionLevel}
|
||||||
onChange={(value) => onParameterChange('compressionLevel', value)}
|
onChange={(value) => onParameterChange('compressionLevel', value)}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
marks={[
|
min={1}
|
||||||
{ value: 1, label: 'Min 1' },
|
max={9}
|
||||||
{ value: 9, label: 'Max 9' },
|
step={1}
|
||||||
]}
|
|
||||||
label={(value) => `${value}`}
|
|
||||||
/>
|
/>
|
||||||
<Text size="xs" c="dimmed" style={{ marginTop: '8px' }}>
|
<Text size="xs" c="dimmed" style={{ marginTop: '8px' }}>
|
||||||
{parameters.compressionLevel <= 3 && "1-3 PDF compression"}
|
{parameters.compressionLevel <= 3 && t('compress.tooltip.qualityAdjustment.bullet1', '1-3 PDF compression')}
|
||||||
{parameters.compressionLevel >= 4 && parameters.compressionLevel <= 6 && "4-6 lite image compression"}
|
{parameters.compressionLevel >= 4 && parameters.compressionLevel <= 6 && t('compress.tooltip.qualityAdjustment.text', '4-6 lite image compression')}
|
||||||
{parameters.compressionLevel >= 7 && "7-9 intense image compression Will dramatically reduce image quality"}
|
{parameters.compressionLevel >= 7 && t('compress.tooltip.qualityAdjustment.bullet2', '7-9 intense image compression Will dramatically reduce image quality')}
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -185,8 +185,8 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: flex-start;
|
||||||
padding: 1rem 1rem; /* 16px 16px */
|
padding: 0.75rem 1rem; /* 12px 16px */
|
||||||
border: 1px solid #d1d5db;
|
border: 1px solid #d1d5db;
|
||||||
border-radius: 0.75rem; /* 12px */
|
border-radius: 0.75rem; /* 12px */
|
||||||
background-color: var(--auth-card-bg-light-only);
|
background-color: var(--auth-card-bg-light-only);
|
||||||
@ -195,6 +195,12 @@
|
|||||||
color: var(--auth-text-primary-light-only);
|
color: var(--auth-text-primary-light-only);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
gap: 0.75rem; /* 12px */
|
gap: 0.75rem; /* 12px */
|
||||||
|
font-family: inherit;
|
||||||
|
transition: background-color 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oauth-button-vertical:hover:not(:disabled) {
|
||||||
|
background-color: #f3f4f6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.oauth-button-vertical:disabled {
|
.oauth-button-vertical:disabled {
|
||||||
@ -202,6 +208,11 @@
|
|||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.oauth-button-vertical:focus-visible {
|
||||||
|
outline: 2px solid var(--auth-border-focus-light-only);
|
||||||
|
outline-offset: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
.oauth-icon-small {
|
.oauth-icon-small {
|
||||||
width: 1.75rem; /* 28px */
|
width: 1.75rem; /* 28px */
|
||||||
height: 1.75rem; /* 28px */
|
height: 1.75rem; /* 28px */
|
||||||
@ -217,6 +228,8 @@
|
|||||||
.oauth-icon-tiny {
|
.oauth-icon-tiny {
|
||||||
width: 1.25rem; /* 20px */
|
width: 1.25rem; /* 20px */
|
||||||
height: 1.25rem; /* 20px */
|
height: 1.25rem; /* 20px */
|
||||||
|
display: block;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Login Header Styles */
|
/* Login Header Styles */
|
||||||
|
|||||||
@ -65,17 +65,17 @@ export default function OAuthButtons({ onProviderClick, isSubmitting, layout = '
|
|||||||
return (
|
return (
|
||||||
<div className="oauth-container-vertical">
|
<div className="oauth-container-vertical">
|
||||||
{enabledProviders.map((p) => (
|
{enabledProviders.map((p) => (
|
||||||
<Button
|
<button
|
||||||
key={p.id}
|
key={p.id}
|
||||||
|
type="button"
|
||||||
onClick={() => onProviderClick(p.id as any)}
|
onClick={() => onProviderClick(p.id as any)}
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
className="oauth-button-vertical"
|
className="oauth-button-vertical"
|
||||||
title={p.label}
|
title={p.label}
|
||||||
variant="default"
|
|
||||||
leftSection={<img src={`${BASE_PATH}/Login/${p.file}`} alt={p.label} className="oauth-icon-tiny" />}
|
|
||||||
>
|
>
|
||||||
{p.label}
|
<img src={`${BASE_PATH}/Login/${p.file}`} alt={p.label} className="oauth-icon-tiny" />
|
||||||
</Button>
|
<span>{p.label}</span>
|
||||||
|
</button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user