diff --git a/packages/app/constants/defaultTheme.json b/packages/app/constants/defaultTheme.json index 15d0a6e7..5ad356a4 100755 --- a/packages/app/constants/defaultTheme.json +++ b/packages/app/constants/defaultTheme.json @@ -9,7 +9,8 @@ "layoutMargin": "unset", "layoutPadding": "10px", "text-color-white": "#d2d2d2", - "text-color-black": "#000000" + "text-color-black": "#000000", + "page-transition-duration": "150ms" }, "defaultVariant": "light", "variants": { diff --git a/packages/app/constants/settings/apparence/index.jsx b/packages/app/constants/settings/apparence/index.jsx index 23b0036b..7eee041c 100755 --- a/packages/app/constants/settings/apparence/index.jsx +++ b/packages/app/constants/settings/apparence/index.jsx @@ -1,5 +1,4 @@ import React from "react" -import * as antd from "antd" import loadable from "@loadable/component" import "./index.less" @@ -28,12 +27,35 @@ export default [ { "id": "reduceAnimations", "storaged": true, - "group": "aspect", + "group": "animations", "component": "Switch", - "icon": "MdOutlineAnimation", + "icon": "MdOutlineSlowMotionVideo", "title": "Reduce animation", "experimental": true }, + { + "id": "pageTransitionDuration", + "storaged": true, + "group": "animations", + "component": "Slider", + "icon": "MdOutlineSpeed", + "title": "Page transition duration", + "description": "Change the duration of the page transition animation.", + "props": { + min: 0, + max: 1000, + step: 50, + tooltip: { + formatter: (value) => `${value / 1000}s` + } + }, + "emitEvent": "modifyTheme", + "emissionValueUpdate": (value) => { + return { + "page-transition-duration": `${value}ms` + } + }, + }, { "id": "auto_darkMode", "experimental": true, diff --git a/packages/app/constants/settingsGroupsDecorator.json b/packages/app/constants/settingsGroupsDecorator.json index 5754da72..d61727c3 100755 --- a/packages/app/constants/settingsGroupsDecorator.json +++ b/packages/app/constants/settingsGroupsDecorator.json @@ -15,6 +15,10 @@ "title": "Aspect", "icon": "Eye" }, + "animations": { + "title": "Animations", + "icon": "MdOutlineAnimation" + }, "security.account": { "title": "Account Security", "icon": "Lock" diff --git a/packages/app/src/theme/animations.less b/packages/app/src/theme/animations.less index 90c46cbc..0902c5ae 100755 --- a/packages/app/src/theme/animations.less +++ b/packages/app/src/theme/animations.less @@ -1,5 +1,5 @@ .fade-transverse-active { - transition: all 250ms; + transition: all var(--page-transition-duration); height: fit-content; width: 100%; }