Skip to content

Commit

Permalink
refactor(admin): 匹配 prefers-reduced-motion: reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Jan 15, 2025
1 parent 49b8c71 commit 5080e5e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
12 changes: 11 additions & 1 deletion admin/src/animation.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2024 caixw
* SPDX-FileCopyrightText: 2024-2025 caixw
*
* SPDX-License-Identifier: MIT
*/
Expand All @@ -23,3 +23,13 @@
transition: opacity var(--transition-duration) linear;
}
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
transition-property: none !important;
animation: none !important;
}
}
5 changes: 3 additions & 2 deletions admin/src/core/api/api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2024 caixw
// SPDX-FileCopyrightText: 2024-2025 caixw
//
// SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -209,7 +209,8 @@ export class API {
/**
* 设置登录状态
*
* @returns 如果返回 true,表示操作成功,否则表示错误信息。
* @param ret 表示执行登录操作之后返回的对象;
* @returns 如果返回 true,表示操作成功,否则表示错误信息;
*/
async login(ret: Return<Token, never>): Promise<Problem<never>|undefined|true> {
if (!ret.ok) {
Expand Down
4 changes: 2 additions & 2 deletions admin/src/core/config/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2024 caixw
// SPDX-FileCopyrightText: 2024-2025 caixw
//
// SPDX-License-Identifier: MIT

Expand All @@ -10,7 +10,7 @@ export class Config {

/**
* 构造函数
* @param id 表示引配置对象的唯一 ID
* @param id 表示此配置对象的唯一 ID
*/
constructor(id: string | number) {
this.#id = ((typeof id === 'number') ? id.toString() : id) + '--';
Expand Down

0 comments on commit 5080e5e

Please sign in to comment.