MIT License

项目介绍

gijsroge/tilt.js 是一个托管在 GitHub 上的开源项目,主要使用 JavaScript 编写,采用 MIT License 许可证,目前获得 3.9k 个 Star、842 次 Fork。

仓库全名
gijsroge/tilt.js
开源许可证
MIT License
Star 数
3.9k
Fork 数
842
未关闭 Issue
47

README 摘要

Tilt.js A tiny requestAnimationFrame powered 60+fps lightweight parallax tilt effect for jQuery. Weights just ⚖1.71kb Gzipped Take a look at the landing page for demos. Tilt.js in the wild http://creativetheory.agency/who-we-are/ https://madewithlove.be/our-products/audits (react version) https://unisocks.exchange/ (react version) Usage Options Events Methods Install yarn: yarn add tilt.js npm: npm install --save…

完整内容见 GitHub 原始 README 或本页 。

常见问题

tilt.js 用什么语言开发?

主要使用 JavaScript 编写,采用 MIT License 许可证,目前有 3.9k 个 Star。

tilt.js 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 tilt.js 的源码?

可以直接克隆仓库:git clone https://github.com/gijsroge/tilt.js.git;安装与运行步骤见仓库 README。

tilt.js 最近还在维护吗?

仓库最近一次更新为 2022年9月15日,当前有 47 个未关闭 Issue;Star 数为 3.9k,可作为社区活跃度的参考。

简要分析

热度分
9412
价值分
2955
活跃状态
活跃

语言占比

HTML
JavaScript

Release

README

Build Status

Tilt.js

A tiny requestAnimationFrame powered 60+fps lightweight parallax tilt effect for jQuery.

Weights just ⚖1.71kb Gzipped Tilt.js demo gif

Take a look at the landing page for demos.

Tilt.js in the wild

Usage

<!DOCTYPE html>
<body>
    <div data-tilt></div> <!-- Tilt element -->
    <script src="jquery.js" ></script> <!-- Load jQuery first -->
    <script src="tilt.js"></script> <!-- Load Tilt.js library -->
</body>

Options

maxTilt:        20,
perspective:    1000,   // Transform perspective, the lower the more extreme the tilt gets.
easing:         "cubic-bezier(.03,.98,.52,.99)",    // Easing on enter/exit.
scale:          1,      // 2 = 200%, 1.5 = 150%, etc..
speed:          300,    // Speed of the enter/exit transition.
transition:     true,   // Set a transition on enter/exit.
disableAxis:    null,   // What axis should be disabled. Can be X or Y.
reset:          true,   // If the tilt effect has to be reset on exit.
glare:          false,  // Enables glare effect
maxGlare:       1       // From 0 - 1.

Events

const tilt = $('.js-tilt').tilt();
tilt.on('change', callback);  // parameters: event, transforms
tilt.on('tilt.mouseLeave', callback); // parameters: event
tilt.on('tilt.mouseEnter', callback); // parameters: event

Methods

const tilt = $('.js-tilt').tilt();

// Destroy instance
tilt.tilt.destroy.call(tilt);

// Get values of instance
tilt.tilt.getValues.call(tilt); // returns [{},{},etc..]

// Reset instance
tilt.tilt.reset.call(tilt);

Install

  • yarn: yarn add tilt.js
  • npm: npm install --save tilt.js

CDN

Alternatives

评论

暂无评论