enhance(frontend): 通常のRouterViewにTransitionを追加
This commit is contained in:
parent
a865a949b5
commit
abddd40c09
4 changed files with 84 additions and 5 deletions
15
packages/frontend/src/utility/random-id.ts
Normal file
15
packages/frontend/src/utility/random-id.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
const CHARS = 'abcdefghijklmnopqrstuvwxyz'; // CSSの<custom-ident>などで使われることもあるのでa-z以外使うな
|
||||
|
||||
export function randomId(length = 32, characters = CHARS) {
|
||||
let result = '';
|
||||
const charactersLength = characters.length;
|
||||
for ( let i = 0; i < length; i++ ) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue