earthnut 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BackgroundRipple/index.cjs +1 -0
- package/BackgroundRipple/index.mjs +1 -0
- package/LICENSE +25 -0
- package/Layout/index.cjs +1 -0
- package/Layout/index.mjs +1 -0
- package/README.md +9 -5
- package/components/button/button.d.ts +5 -0
- package/components/button/index.d.ts +3 -0
- package/components/button/style/index.d.ts +1 -0
- package/components/index.d.ts +3 -0
- package/components/layout/content.d.ts +11 -0
- package/components/layout/footer.d.ts +16 -0
- package/components/layout/header.d.ts +18 -0
- package/components/layout/index.d.ts +2 -0
- package/components/layout/layout.d.ts +50 -0
- package/components/layout/sideBar.d.ts +24 -0
- package/components/layout/types.d.ts +71 -0
- package/components/menu/index.d.ts +0 -0
- package/components/menu/menu.d.ts +0 -0
- package/components/menu/style/index.d.ts +0 -0
- package/components/ripples/RipplesEle.d.ts +36 -0
- package/components/ripples/index.d.ts +4 -0
- package/components/ripples/style/index.d.ts +0 -0
- package/components/ripples/types.d.ts +11 -0
- package/components/ripples/useOptionUpdate.d.ts +5 -0
- package/customHooks/index.d.ts +5 -0
- package/customHooks/useAnimationFrame.d.ts +42 -0
- package/customHooks/useInputIsComposing.d.ts +46 -0
- package/customHooks/useRipples/buildBackground/default-background/_createImageData.d.ts +7 -0
- package/customHooks/useRipples/buildBackground/default-background/circleDataList.d.ts +18 -0
- package/customHooks/useRipples/buildBackground/default-background/createCanvasElementBySize.d.ts +2 -0
- package/customHooks/useRipples/buildBackground/default-background/createDefault.d.ts +2 -0
- package/customHooks/useRipples/buildBackground/default-background/index.d.ts +10 -0
- package/customHooks/useRipples/buildBackground/loadImage.d.ts +13 -0
- package/customHooks/useRipples/buildBackground/runSide.d.ts +9 -0
- package/customHooks/useRipples/buildBackground/type.d.ts +27 -0
- package/customHooks/useRipples/buildBackground/utils/bindImage.d.ts +3 -0
- package/customHooks/useRipples/buildBackground/utils/createCanvasElement.d.ts +3 -0
- package/customHooks/useRipples/buildBackground/utils/createImageBySrc.d.ts +2 -0
- package/customHooks/useRipples/buildBackground/utils/getBackgroundStyle.d.ts +3 -0
- package/customHooks/useRipples/buildBackground/utils/hideCssBackground.d.ts +10 -0
- package/customHooks/useRipples/buildBackground/utils/restore-css-background.d.ts +7 -0
- package/customHooks/useRipples/callback/destroy.d.ts +3 -0
- package/customHooks/useRipples/callback/drop.d.ts +3 -0
- package/customHooks/useRipples/callback/fade.d.ts +3 -0
- package/customHooks/useRipples/callback/reload-background.d.ts +6 -0
- package/customHooks/useRipples/callback/scale.d.ts +2 -0
- package/customHooks/useRipples/index.d.ts +40 -0
- package/customHooks/useRipples/init/index.d.ts +5 -0
- package/customHooks/useRipples/init/initEvent.d.ts +5 -0
- package/customHooks/useRipples/init/initShaders.d.ts +7 -0
- package/customHooks/useRipples/init/initTexture.d.ts +7 -0
- package/customHooks/useRipples/render/computeTextureBoundaries.d.ts +3 -0
- package/customHooks/useRipples/render/draw.d.ts +7 -0
- package/customHooks/useRipples/render/drawQuad.d.ts +7 -0
- package/customHooks/useRipples/render/dropAtPointer.d.ts +7 -0
- package/customHooks/useRipples/render/index.d.ts +6 -0
- package/customHooks/useRipples/render/swapBufferIndices.d.ts +5 -0
- package/customHooks/useRipples/render/update.d.ts +5 -0
- package/customHooks/useRipples/rippersData/defaultData.d.ts +5 -0
- package/customHooks/useRipples/rippersData/fadeData.d.ts +29 -0
- package/customHooks/useRipples/rippersData/index.d.ts +40 -0
- package/customHooks/useRipples/rippersData/loadConfig.d.ts +19 -0
- package/customHooks/useRipples/rippersData/renderData.d.ts +72 -0
- package/customHooks/useRipples/rippersData/useOptions.d.ts +81 -0
- package/customHooks/useRipples/rippersData/vertexSource.d.ts +28 -0
- package/customHooks/useRipples/ripple.html.d.ts +6 -0
- package/customHooks/useRipples/ripplesClass.d.ts +51 -0
- package/customHooks/useRipples/tools.d.ts +31 -0
- package/customHooks/useRipples/types.d.ts +192 -0
- package/customHooks/useTimeId.d.ts +55 -0
- package/dog.d.ts +3 -0
- package/index.cjs +1 -0
- package/index.d.ts +5 -0
- package/index.js.LICENSE.txt +79 -0
- package/index.mjs +1 -0
- package/package.json +87 -14
- package/styles/common.css +360 -0
- package/styles/common.scss +444 -0
- package/useAnimationFrame/index.cjs +1 -0
- package/useAnimationFrame/index.mjs +1 -0
- package/useInputIsComposing/index.cjs +1 -0
- package/useInputIsComposing/index.mjs +1 -0
- package/useRipples/index.cjs +1 -0
- package/useRipples/index.mjs +1 -0
- package/useTimeId/index.cjs +1 -0
- package/useTimeId/index.mjs +1 -0
- package/index.js +0 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BackgroundRipplesProps } from 'customHooks/useRipples/types';
|
|
3
|
+
import { RippleEle } from './types';
|
|
4
|
+
import './style/index.scss';
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* ### 一个 ripple 背景组件
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* *需要为该组件或父组件设置背景,否则即便的渲染了,效果不明显*
|
|
11
|
+
*
|
|
12
|
+
* 参数 props 属性:
|
|
13
|
+
* - children 内嵌的 ReactNode
|
|
14
|
+
* - style 更改显示的样式
|
|
15
|
+
* - option 初始化 ripples 的原始数据
|
|
16
|
+
* @param props 使用参数
|
|
17
|
+
* @version 0.0.1
|
|
18
|
+
* @see https://earthnut.dev/earthnut/background-ripple
|
|
19
|
+
* @example
|
|
20
|
+
* 使用:
|
|
21
|
+
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { BackgroundRipple } from 'earthnut/BackgroundRipple';
|
|
24
|
+
* // 也可以全量导入
|
|
25
|
+
* // import { BackgroundRipple } from 'earthnut';
|
|
26
|
+
* ...
|
|
27
|
+
* const animationFrameId = useAnimationFrame();
|
|
28
|
+
*
|
|
29
|
+
* return <BackgroundRipple>
|
|
30
|
+
* ...
|
|
31
|
+
* </BackgroundRipple>
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
35
|
+
declare const BackgroundRipple: React.ForwardRefExoticComponent<BackgroundRipplesProps & React.RefAttributes<RippleEle>>;
|
|
36
|
+
export { BackgroundRipple };
|
|
File without changes
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { useInputIsComposing } from './useInputIsComposing';
|
|
2
|
+
export { useTimeId } from './useTimeId';
|
|
3
|
+
export { useAnimationFrameId } from './useAnimationFrame';
|
|
4
|
+
export { useRipples } from './useRipples/index';
|
|
5
|
+
export type { Ripples, BackgroundRipplesProps, RipplesOptions } from './useRipples/index';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/****************************************************************************
|
|
2
|
+
* @Author earthnut
|
|
3
|
+
* @Email earthnut.dev@outlook.com
|
|
4
|
+
* @ProjectName earthnut
|
|
5
|
+
* @FilePath /src/customHooks/useAnimationFrame.ts
|
|
6
|
+
* @FileName useAnimationFrame.ts
|
|
7
|
+
* @CreateDate 周二 01/07/2025
|
|
8
|
+
* @Description 使用 animationFrame
|
|
9
|
+
****************************************************************************/
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* ### 导出一个使用 `useRef` 创建的 `number`
|
|
13
|
+
*
|
|
14
|
+
* 该数值在组件卸载时会自动调用 `window.cancelAnimationFrame` 清理
|
|
15
|
+
* @description 一个接收 `window.requestAnimationFrame` 的返回值的 `ref`
|
|
16
|
+
* @returns <React.RefObject: number>
|
|
17
|
+
* @version 0.0.3
|
|
18
|
+
* @see https://earthnut.dev/use-animation-frame
|
|
19
|
+
* @example
|
|
20
|
+
* 使用:
|
|
21
|
+
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { useAnimationFrame } from 'earthnut/useAnimationFrame';
|
|
24
|
+
* // 也可以全量导入
|
|
25
|
+
* // import { useAnimationFrame } from 'earthnut';
|
|
26
|
+
* ...
|
|
27
|
+
* const animationFrameId = useAnimationFrame();
|
|
28
|
+
*
|
|
29
|
+
* function performAction(time?: number){
|
|
30
|
+
* useAnimationFrame.current = window.requestAnimationFrame(performAction);
|
|
31
|
+
* ...
|
|
32
|
+
* }
|
|
33
|
+
*
|
|
34
|
+
* useEffect(()=>{
|
|
35
|
+
* animationFrameId.current = window.requestAnimationFrame(performAction);
|
|
36
|
+
* });
|
|
37
|
+
* ...
|
|
38
|
+
*
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
export declare function useAnimationFrameId(): React.RefObject<number>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/****************************************************************************
|
|
2
|
+
* @Author earthnut
|
|
3
|
+
* @Email earthnut.dev@outlook.com
|
|
4
|
+
* @ProjectName earthnut
|
|
5
|
+
* @FilePath /src/customHooks/useAnimationFrame.ts
|
|
6
|
+
* @FileName useInputIsComposing.ts
|
|
7
|
+
* @CreateDate 周二 01/07/2025
|
|
8
|
+
* @Description 使用输入框是否完成输入状态
|
|
9
|
+
****************************************************************************/
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* ### 导出一个使用 `useRef` 创建的 `boolean`
|
|
13
|
+
*
|
|
14
|
+
* *由于是包裹在 React.RefObject 之中,判断时务必使用 `isComposing.current` 进行判断*
|
|
15
|
+
* @description 用于判断当前的输入状态是否结束
|
|
16
|
+
* @param inputRef [React.RefObject<HTMLInputElement | HTMLTextAreaElement>] 输入框的 ref
|
|
17
|
+
* @returns React.RefObject<boolean>
|
|
18
|
+
* @version 0.0.4
|
|
19
|
+
* @see https://earthnut.dev/use-input-is-composing
|
|
20
|
+
* @example
|
|
21
|
+
*
|
|
22
|
+
* 使用:
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { useInputIsComposing } from 'earthnut/useInputIsComposing';
|
|
26
|
+
* // 也可以全量导入
|
|
27
|
+
* // import { useInputIsComposing } from 'earthnut';
|
|
28
|
+
* ...
|
|
29
|
+
* const inputRef = useRef<HTMLInputElement>(null);
|
|
30
|
+
*
|
|
31
|
+
* const inputIsComposing = useInputIsComposing(inputRef);
|
|
32
|
+
* ...
|
|
33
|
+
* function enterDown()(e: React.KeyboardEvent<HTMLInputElement>) {
|
|
34
|
+
* if (e.key === 'Enter') {
|
|
35
|
+
* if (isComposing.current) {
|
|
36
|
+
* console.log("此时此景,按回车键说明为了从候选词中挑选");
|
|
37
|
+
* } else
|
|
38
|
+
* console.log("输入完毕,敲回车是为了看一些开发者是否绑定了其他事件");
|
|
39
|
+
* }
|
|
40
|
+
* }
|
|
41
|
+
* ...
|
|
42
|
+
* <input type="text" onKeyDown={enterDown} />
|
|
43
|
+
* ...
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare function useInputIsComposing(inputRef: React.RefObject<HTMLInputElement | HTMLTextAreaElement | null>): React.RefObject<boolean>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** 圆数据 */
|
|
2
|
+
export declare const circleDataList: {
|
|
3
|
+
/** 计数器 */
|
|
4
|
+
"__#1@#cum": number;
|
|
5
|
+
/** 构建新的数据依据 */
|
|
6
|
+
build(): void;
|
|
7
|
+
/** 数据依据 */
|
|
8
|
+
data: {
|
|
9
|
+
/** 数据 */
|
|
10
|
+
list: [number, number, number, number][][];
|
|
11
|
+
/** 直径 */
|
|
12
|
+
diameter: number;
|
|
13
|
+
/** 半径 */
|
|
14
|
+
radius: number;
|
|
15
|
+
/** 晶格数 */
|
|
16
|
+
cells: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Ripples } from '../ripplesClass';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* 加载图像
|
|
5
|
+
*
|
|
6
|
+
* - 初始化的时候首先触发加载背景图像
|
|
7
|
+
* - 通过 Ripple 的 set 方法设置属性 imageUrl 值时将触发
|
|
8
|
+
* - 尺寸发生变化时亦将触发更改
|
|
9
|
+
* - 父元素的样式属性发生变更时也会触发
|
|
10
|
+
*
|
|
11
|
+
* 在加载过程中如果渲染的图片为非法的(加载错误)那么将查找当前的背景色或是背景图作为依据,再就是都没有的情况下将会渲染一个类似于旧地板的色
|
|
12
|
+
*/
|
|
13
|
+
export declare function loadImage(this: Ripples): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** 原使用的样式 */
|
|
2
|
+
export type OriginStyle = {
|
|
3
|
+
/** 原始使用行内背景样式 */
|
|
4
|
+
inlineBackground: string;
|
|
5
|
+
/** 原始使用的行内背景色 */
|
|
6
|
+
inlineBackgroundColor: string;
|
|
7
|
+
/** 原始使用的背景图的样式 */
|
|
8
|
+
inlineBackgroundImage: string;
|
|
9
|
+
/** 元素的位置 */
|
|
10
|
+
position: string;
|
|
11
|
+
/** 元素的背景色 */
|
|
12
|
+
backgroundColor: string;
|
|
13
|
+
/** 元素的背景图 */
|
|
14
|
+
backgroundImage: string;
|
|
15
|
+
/** 元素的背景图的尺寸(多背景下) */
|
|
16
|
+
backgroundSize: string;
|
|
17
|
+
/** 元素的背景图的位置 */
|
|
18
|
+
backgroundPosition: string;
|
|
19
|
+
/** 元素的背景图的重复方式 */
|
|
20
|
+
backgroundRepeat: string;
|
|
21
|
+
/** 元素的背景图的剪切方式 */
|
|
22
|
+
backgroundClip: string;
|
|
23
|
+
/** 元素的背景图的起点 */
|
|
24
|
+
backgroundOrigin: string;
|
|
25
|
+
/** 元素的背景图相对视口的滚动方式 */
|
|
26
|
+
backgroundAttachment: string;
|
|
27
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { BackgroundRipplesProps, RipplesOptions } from './types';
|
|
2
|
+
import { Ripples } from './ripplesClass';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* ## 使用绘制 ripples 上一层
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* @param canvas `usrRef` 包裹的 `HTMLCanvasElement`,用于绘制图像
|
|
9
|
+
* @param props 初始化的
|
|
10
|
+
* @version 0.0.3
|
|
11
|
+
* @see https://earthnut.dev/use-ripples
|
|
12
|
+
* @see JQuery https://github.com/sirxemic/jquery.ripples
|
|
13
|
+
* @example
|
|
14
|
+
*
|
|
15
|
+
* 下面是在 <BackgroundRipple> 中使用
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { useRipples } from 'earthnut/useRipples';
|
|
19
|
+
* // 也可以使用包全量导入
|
|
20
|
+
* // import { useRipples } from 'earthnut';
|
|
21
|
+
*
|
|
22
|
+
* export function BackgroundRipple(props: BackgroundRipplesProps) {
|
|
23
|
+
*
|
|
24
|
+
* // canvas 元素
|
|
25
|
+
* const canvas = useRef<HTMLCanvasElement>(null);
|
|
26
|
+
*
|
|
27
|
+
* // 使用 ripples
|
|
28
|
+
* const ripplesRef = useRipples(canvas, props);
|
|
29
|
+
*
|
|
30
|
+
* return (<>
|
|
31
|
+
* <canvas ref={canvas}></canvas>
|
|
32
|
+
* {props.children}
|
|
33
|
+
* </>);
|
|
34
|
+
* }
|
|
35
|
+
*
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
export declare function useRipples(canvas: React.RefObject<HTMLCanvasElement | null>, props?: BackgroundRipplesProps): React.RefObject<Ripples | null>;
|
|
40
|
+
export type { Ripples, BackgroundRipplesProps, RipplesOptions };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Ripples } from '../ripplesClass';
|
|
2
|
+
/** 背景渐变的数据 */
|
|
3
|
+
export declare class FadeData {
|
|
4
|
+
/** 背景页面的数据 */
|
|
5
|
+
backgroundInfo: {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
};
|
|
9
|
+
/** 缺省背景图时的 id */
|
|
10
|
+
transparentId: NodeJS.Timeout;
|
|
11
|
+
/** 最后使用
|
|
12
|
+
*
|
|
13
|
+
* 如果没有 toBeList 为空值,则当前渲染的为此纹理)绘制的图像
|
|
14
|
+
*/
|
|
15
|
+
lastDrawImage: HTMLCanvasElement | HTMLImageElement;
|
|
16
|
+
/** 当前绘制的图像
|
|
17
|
+
*
|
|
18
|
+
* 该值仅出现在需要渐变过程中,一旦渐变完成,实际渲染的值就成了最后渲染的值
|
|
19
|
+
*/
|
|
20
|
+
toBeList: (HTMLCanvasElement | HTMLImageElement)[];
|
|
21
|
+
/** 绘制进度 */
|
|
22
|
+
drawProgress: number;
|
|
23
|
+
/** 是否处于绘制过渡状态 */
|
|
24
|
+
isTransitioning: boolean;
|
|
25
|
+
/** 执行渐变 */
|
|
26
|
+
run(): void;
|
|
27
|
+
/** 创建背景渐变的数据 */
|
|
28
|
+
constructor(_Ripples: Ripples);
|
|
29
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/****************************************************************************
|
|
2
|
+
* @Author earthnut
|
|
3
|
+
* @Email earthnut.dev@outlook.com
|
|
4
|
+
* @ProjectName website
|
|
5
|
+
* @FileName dataStore.ts
|
|
6
|
+
* @CreateDate 周六 12/07/2024
|
|
7
|
+
* @Description 数据库
|
|
8
|
+
****************************************************************************/
|
|
9
|
+
/**
|
|
10
|
+
* Ripple 使用的数据,Ripple 继承该类
|
|
11
|
+
*/
|
|
12
|
+
export declare class RipplesData {
|
|
13
|
+
/**
|
|
14
|
+
* canvas 元素
|
|
15
|
+
*/
|
|
16
|
+
canvas: HTMLCanvasElement;
|
|
17
|
+
/**
|
|
18
|
+
* WebGL 绘图上下文
|
|
19
|
+
*/
|
|
20
|
+
gl: WebGLRenderingContext;
|
|
21
|
+
/**
|
|
22
|
+
* 配置
|
|
23
|
+
*/
|
|
24
|
+
config: {
|
|
25
|
+
type: number;
|
|
26
|
+
linearSupport: boolean;
|
|
27
|
+
extensions: string[];
|
|
28
|
+
arrayType: Float32ArrayConstructor | null;
|
|
29
|
+
} | null;
|
|
30
|
+
/**
|
|
31
|
+
* 初始化情况
|
|
32
|
+
*/
|
|
33
|
+
initState: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 构造方法
|
|
36
|
+
*
|
|
37
|
+
* @param canvas 传入 canvas 元素来初始化必要的数据
|
|
38
|
+
*/
|
|
39
|
+
constructor(canvas: HTMLCanvasElement);
|
|
40
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/****************************************************************************
|
|
2
|
+
* @Author earthnut
|
|
3
|
+
* @Email earthnut.dev@outlook.com
|
|
4
|
+
* @ProjectName website
|
|
5
|
+
* @FileName loadConfig.ts
|
|
6
|
+
* @CreateDate 周五 12/13/2024
|
|
7
|
+
* @Description 加载 config
|
|
8
|
+
****************************************************************************/
|
|
9
|
+
import { RipplesData } from './index';
|
|
10
|
+
/**
|
|
11
|
+
* 执行的配置数据
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export declare function loadConfig(this: RipplesData): {
|
|
15
|
+
type: number;
|
|
16
|
+
linearSupport: boolean;
|
|
17
|
+
arrayType: Float32ArrayConstructor | null;
|
|
18
|
+
extensions: string[];
|
|
19
|
+
} | null;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { OriginStyle } from '../buildBackground/type';
|
|
2
|
+
import { Ripples } from '../ripplesClass';
|
|
3
|
+
import { Program, Textures } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* 原始数据类
|
|
7
|
+
*
|
|
8
|
+
* 记录了除参数数据外的运行数据
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export declare class RipplesRenderData {
|
|
12
|
+
/** 渲染数据流
|
|
13
|
+
*
|
|
14
|
+
* 该值在 init 中进行初始化
|
|
15
|
+
*/
|
|
16
|
+
quad: WebGLBuffer;
|
|
17
|
+
/**
|
|
18
|
+
* 上一次雨滴滴落的时间
|
|
19
|
+
*
|
|
20
|
+
* 该时间更新触发时机:
|
|
21
|
+
* - 2.2s 内没有事件触发
|
|
22
|
+
* - 鼠标交互更新
|
|
23
|
+
*/
|
|
24
|
+
lastRaindropsFallTime: number;
|
|
25
|
+
/** canvas 父级元素 该值在主 class 中初始化 */
|
|
26
|
+
parentElement: HTMLElement;
|
|
27
|
+
/** 父级元素的属性变化监听者 */
|
|
28
|
+
mutationObserver: null | MutationObserver;
|
|
29
|
+
/** 父级尺寸变化监听者 */
|
|
30
|
+
resizeObserver: null | ResizeObserver;
|
|
31
|
+
/** 渲染程序 */
|
|
32
|
+
renderProgram: Program;
|
|
33
|
+
/** 图像资源的配置 */
|
|
34
|
+
imageSource: string;
|
|
35
|
+
/** 该值于初始化着色器时初始化 */
|
|
36
|
+
dropProgram: Program;
|
|
37
|
+
/** 更新流 */
|
|
38
|
+
updateProgram: Program;
|
|
39
|
+
/** 纹理 */
|
|
40
|
+
textures: Textures;
|
|
41
|
+
/** 背景纹理 */
|
|
42
|
+
backgroundTexture: WebGLTexture;
|
|
43
|
+
/** 纹理数据 */
|
|
44
|
+
textureDelta: Float32Array<ArrayBuffer>;
|
|
45
|
+
/** */
|
|
46
|
+
framebuffers: WebGLFramebuffer[];
|
|
47
|
+
/** */
|
|
48
|
+
bufferWriteIndex: number;
|
|
49
|
+
/** */
|
|
50
|
+
bufferReadIndex: number;
|
|
51
|
+
/** 最原始的样式 */
|
|
52
|
+
originStyle: OriginStyle;
|
|
53
|
+
/** 上一次使用的样式 */
|
|
54
|
+
lastUseStyle: OriginStyle;
|
|
55
|
+
/** 事件 */
|
|
56
|
+
events: {
|
|
57
|
+
mousemove: (e: MouseEvent) => void;
|
|
58
|
+
mousedown: (e: MouseEvent) => void;
|
|
59
|
+
touchmove: (e: TouchEvent) => void;
|
|
60
|
+
touchstart: (e: TouchEvent) => void;
|
|
61
|
+
};
|
|
62
|
+
/** 渲染 id */
|
|
63
|
+
animationFrameId: number;
|
|
64
|
+
/**
|
|
65
|
+
* 构建 Ripple 的渲染数据
|
|
66
|
+
*
|
|
67
|
+
* @param canvas 使用初始化的 Canvas 元素
|
|
68
|
+
* @param callback 执行的回调,这里要对页面背景进行更新
|
|
69
|
+
* @param _Ripples 上一个回调在使用中的 this
|
|
70
|
+
*/
|
|
71
|
+
constructor(canvas: HTMLCanvasElement, callback: () => void, _Ripples: Ripples);
|
|
72
|
+
}
|