Gathering detailed insights and metrics for hilo-parallax
Gathering detailed insights and metrics for hilo-parallax
Gathering detailed insights and metrics for hilo-parallax
Gathering detailed insights and metrics for hilo-parallax
npm install hilo-parallax
Typescript
Module System
Node Version
NPM Version
JavaScript (99.87%)
CSS (0.13%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
3 Stars
6 Commits
1 Forks
1 Watchers
2 Branches
1 Contributors
Updated on Dec 01, 2017
Latest Version
0.0.1
Package Id
hilo-parallax@0.0.1
Size
6.67 kB
NPM Version
3.10.10
Node Version
6.11.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Hilo Parallax Component
npm i hilo-parallax
1import Stage from 'hilojs/view/Stage';
2import Ticker from 'hilojs/util/Ticker';
3import Ease from 'hilojs/tween/Ease';
4import Parallax from 'hilo-parallax';
5
6// hilo stage
7var stage = new Stage({
8 renderType: 'canvas',
9 canvas,
10 width: 375,
11 height: 614,
12});
13canvas.width = 375;
14canvas.height = 614;
15this.ticker = new Ticker(30);
16this.ticker.addTick(stage);
17this.ticker.start();
18
19const bgWrapper = new Parallax({
20 childrens: [
21 {
22 depth: 0.5,
23 children: 'https://zos.alipayobjects.com/rmsportal/vQbYqyotOjnnTPfpjpzN.png',
24 imageData: {
25 cpPosition: -800,
26 y: 200,
27 },
28 },
29 {
30 depth: 1,
31 children: 'https://zos.alipayobjects.com/rmsportal/gVBfGmjSskHNvmScZMGm.png',
32 imageData: {
33 cpPosition: -800,
34 y: 250,
35 },
36 },
37 ],
38 type: 'x',
39 duration: 10000,
40 ease: Ease.Linear.EaseNone,
41 width: this.width,
42 height: this.height,
43 loop: true,
44 startPercent: 0.2,
45});
46stage.addChild(bgWrapper);
47bgWrapper.cameraAnimateTo(-800);
Parallax extends Container
name | type | default | description |
---|---|---|---|
childrens | Array | null | parallax 的子级 |
type | string | x | parallax 动画类型: x , y , xy ; 如果为 xy , cameraAnimateTo 里的 value 可以为 { x, y }; |
duration | number | 1000 | 初始时间设定 |
ease | hilo.Ease | Ease.Quad.EaseOut | 动画缓动 |
loop | boolean | false | 是否循环播放,注: 如果为 true, cameraAnimateTo 只能触发一次 |
invert | boolean | false | loop 时, 第二遍是否反向播放 |
cameraStart | number | 0 | 镜头位置 |
startPercent | number | 0 | 0 - 1 之间的百分比值; 开始显示镜头所在动画轴上的百分比 |
stack | string | reset | type: add , reset ; 两种方式;add : 为不结束前面一个动画,往动画队列里添加后面即将发生的动画, 为多轨动画, 比较耗性能; reset : 保持单个动画的运行,强制结束前面一个动画, 单轨动画。 |
name | type | default | description |
---|---|---|---|
children | <Hilo.View> or string | null | 子级元素, 如果是 string, 将自动创建 Bitmap; |
depth | number | null | 当前子级深度, 控制视差的 |
imageData | object | null | 只适用 children 为 string 时 { ...(所有 Bitmap 属性), cpPosition }: cpPosition 开启拷贝图片,并设置所在位置。 |
动画调用方法:
value: 动画参数;
animateProps: { duration, ease }; 替换初始设置的动画值;
npm install
npm start
http://localhost:8301/examples/
hilo-parallax is released under the MIT license.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/6 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More