Add expand and fade-in animations to conditional form sections
Add smooth animations to form sections that appear when toggles are enabled, improving user experience with visual feedback. Changes: - Add expandFadeIn keyframe animation to Tailwind config - Apply expand-fade-in animation to UserSettingsForm payment sections - Apply expand-fade-in animation to LocationEditForm conditional fields - Update account page HomeIcon color from green to white for consistency 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,7 @@ const Page: FC = async () => {
|
||||
<div className="card card-compact card-bordered min-w-[20em] max-w-[90em] bg-base-100 shadow-s my-1">
|
||||
<div className="card-body">
|
||||
<h2 className="card-title"><AccountCircle /> {t('title')}</h2>
|
||||
<Link href={`/${locale}/home`} className='btn btn-neutral'><HomeIcon className='text-green-300' /> {t('goto-home-button-label')}</Link>
|
||||
<Link href={`/${locale}/home`} className='btn btn-neutral'><HomeIcon className='text-white'/> {t('goto-home-button-label')}</Link>
|
||||
<Link href={`/${locale}/home/account/settings`} className='btn btn-neutral'><SettingsIcon className='text-blue-400' /> {t('goto-settings-button-label')}</Link>
|
||||
<LogoutButton />
|
||||
</div>
|
||||
|
||||
@@ -119,7 +119,7 @@ export const LocationEditForm: FC<LocationEditFormProps> = ({ location, yearMont
|
||||
</fieldset>
|
||||
|
||||
{formValues.tenantPaymentMethod === "iban" && userSettings?.enableIbanPayment ? (
|
||||
<>
|
||||
<div className="animate-expand-fade-in origin-top">
|
||||
<div className="divider mt-4 mb-2 font-bold uppercase">{t("iban-payment--form-title")}</div>
|
||||
<div className="form-control w-full">
|
||||
<label className="label">
|
||||
@@ -192,7 +192,7 @@ export const LocationEditForm: FC<LocationEditFormProps> = ({ location, yearMont
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</div>
|
||||
) : // ELSE include hidden inputs to preserve existing values
|
||||
<>
|
||||
<input
|
||||
@@ -266,7 +266,7 @@ export const LocationEditForm: FC<LocationEditFormProps> = ({ location, yearMont
|
||||
</fieldset>
|
||||
|
||||
{formValues.rentDueNotification && (
|
||||
<>
|
||||
<div className="animate-expand-fade-in origin-top">
|
||||
<fieldset className="fieldset mt-2 p-2">
|
||||
<legend className="fieldset-legend">{t("rent-due-day-label")}</legend>
|
||||
<select defaultValue={formValues.rentDueDay}
|
||||
@@ -301,7 +301,7 @@ export const LocationEditForm: FC<LocationEditFormProps> = ({ location, yearMont
|
||||
))}
|
||||
</div>
|
||||
</fieldset>
|
||||
</>
|
||||
</div>
|
||||
)}
|
||||
</fieldset>
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ const FormFields: FC<FormFieldsProps> = ({ userSettings, errors, message }) => {
|
||||
</fieldset>
|
||||
|
||||
{ formValues.enableIbanPayment ? (
|
||||
<>
|
||||
<div className="animate-expand-fade-in origin-top">
|
||||
<div className="divider mt-2 mb-2 font-bold uppercase">{t("iban-form-title")}</div>
|
||||
<div className="form-control w-full">
|
||||
<label className="label">
|
||||
@@ -231,7 +231,7 @@ const FormFields: FC<FormFieldsProps> = ({ userSettings, errors, message }) => {
|
||||
</div>
|
||||
|
||||
<NoteBox>{t("payment-additional-notes")}</NoteBox>
|
||||
</>
|
||||
</div>
|
||||
) : // ELSE include hidden inputs to preserve existing values
|
||||
<>
|
||||
<input
|
||||
@@ -281,7 +281,7 @@ const FormFields: FC<FormFieldsProps> = ({ userSettings, errors, message }) => {
|
||||
</fieldset>
|
||||
|
||||
{ formValues.enableRevolutPayment ? (
|
||||
<>
|
||||
<div className="animate-expand-fade-in origin-top">
|
||||
<div className="divider mt-2 mb-2 font-bold uppercase">{t("revolut-form-title")}</div>
|
||||
<div className="form-control w-full">
|
||||
<label className="label">
|
||||
@@ -326,7 +326,7 @@ const FormFields: FC<FormFieldsProps> = ({ userSettings, errors, message }) => {
|
||||
}
|
||||
</div>
|
||||
<NoteBox>{t("payment-additional-notes")}</NoteBox>
|
||||
</>
|
||||
</div>
|
||||
)
|
||||
: // ELSE include hidden input to preserve existing value
|
||||
<>
|
||||
|
||||
@@ -18,6 +18,9 @@ const config: Config = {
|
||||
600: '#2F6FEB',
|
||||
},
|
||||
},
|
||||
animation: {
|
||||
'expand-fade-in': 'expandFadeIn 0.3s ease-in-out forwards',
|
||||
},
|
||||
},
|
||||
keyframes: {
|
||||
shimmer: {
|
||||
@@ -37,6 +40,16 @@ const config: Config = {
|
||||
maxHeight: '200px',
|
||||
},
|
||||
},
|
||||
expandFadeIn: {
|
||||
'0%': {
|
||||
opacity: '0',
|
||||
transform: 'scaleY(0.95)',
|
||||
},
|
||||
'100%': {
|
||||
opacity: '1',
|
||||
transform: 'scaleY(1)',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
|
||||
Reference in New Issue
Block a user