preview-animation
Advanced tools
Comparing version 0.1.11 to 0.1.12
import React from 'react'; | ||
import { Lang } from '../../types'; | ||
declare type ProcessBarType = { | ||
@@ -6,2 +7,3 @@ currentFrame: number; | ||
endFrame: number; | ||
lang?: Lang; | ||
handleProcessClick: (processBarTipFrame: number) => void; | ||
@@ -8,0 +10,0 @@ }; |
/// <reference types="react" /> | ||
import { ControllerType } from '../utils/preLoadImg'; | ||
import { LabelType, PreviewAnimationType } from '../types'; | ||
export declare const useGlobalState: () => { | ||
import { LabelType, Lang, PreviewAnimationType } from '../types'; | ||
export declare const useGlobalState: (lang?: Lang) => { | ||
bottomPreviewAnimationGroup: PreviewAnimationType[]; | ||
@@ -6,0 +6,0 @@ currentTaskIndex: number | undefined; |
import * as React from 'react'; | ||
import './index.less'; | ||
import { Lang } from './types'; | ||
export declare const PreviewAnimation: React.FC<{ | ||
@@ -7,2 +8,3 @@ data: any[]; | ||
renderFrame?: string; | ||
lang?: Lang; | ||
}>; |
{ | ||
"version": "0.1.11", | ||
"version": "0.1.12", | ||
"license": "MIT", | ||
@@ -4,0 +4,0 @@ "main": "dist/index.js", |
@@ -1,11 +0,37 @@ | ||
### 启动 | ||
```bash | ||
npm start # or yarn start | ||
### Usage | ||
- install package | ||
`yarn add preview-animation` | ||
- create | ||
```shell | ||
import { PreviewAnimation } from "preview-animation"; | ||
``` | ||
### 启动example | ||
```bash | ||
cd example | ||
npm i # or yarn to install dependencies | ||
npm start # or yarn start | ||
``` | ||
## Component | ||
### parameter | ||
```shell | ||
data:{ | ||
'fileName': { | ||
taskThumbnails:string[], | ||
pre:string, | ||
fps:number, | ||
frameIndexList:string[] | ||
}[]; | ||
blockNum?: number; | ||
renderFrame?: string; | ||
lang?:'zh' | 'en'; | ||
} | ||
``` | ||
## More info | ||
check the example | ||
import { useCallback, useRef, useState } from 'react'; | ||
import { useTranslate } from './useTranslate'; | ||
import { ControllerType } from '../utils/preLoadImg'; | ||
import { LabelType, PreviewAnimationType } from '../types'; | ||
import { LabelType, Lang, PreviewAnimationType } from '../types'; | ||
const GAP = 1000; | ||
export const useGlobalState = () => { | ||
export const useGlobalState = (lang = Lang.ZH) => { | ||
// 记录左侧预览的动画 | ||
@@ -39,3 +39,3 @@ const [leftPreviewAnimationGroup, setLeftPreviewAnimationGroup] = useState< | ||
const currentFrameIndexRef = useRef(0); | ||
const { t } = useTranslate(); | ||
const { t } = useTranslate(lang); | ||
const [preloadController, setPreloadController] = useState<ControllerType>(); | ||
@@ -42,0 +42,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
727547
3652
38