@1papaya/gatsby-plugin-transition-link 中文文档教程

发布于 4年前 浏览 26 项目主页 更新于 3年前

alt text

Gatsby Plugin Transition Link

TransitionLink 提供了一个简单的 API,用于描述 Gatsbyjs 中页面之间的表现力转换。 页面链接用于确定应触发哪个转换,从而使页面转换灵活且易于使用。

TransitionLink 兼容声明式 React 动画库,例如 react-pose反应弹簧。 它还与 gsapanime.js 等命令式动画库兼容

Features

  • Per-Link transitions
  • Fine control of page mounting and unmounting timing
  • Function or state based transitions with <TransitionLink />
  • Transition state and status with <TransitionState /> and in your page & template props
  • Display animation content above your pages with <TransitionPortal />
  • Use default transitions with <AniLink />

Usage

有关使用 TransitionLink 的信息,请参阅文档。 文档站点的源代码可在此处找到。

Contributing

  1. Make sure you have yarn installed.
  2. Create a new folder to be used as your yarn workspace. mkdir transitionlink-workspace
  3. Inside your workspace folder, clone this repo.
  4. cd into this repo and run yarn && yarn watch. Leave this terminal window open.
  5. Beside this repo in your workspace folder, add a gatsby site that uses transition link for testing purposes (you can copy/paste the example site from this repo if needed).
  6. In your workspace folder create a package.json and add the following:
{
    "private": true,
    "workspaces": [
        "example", <-- the name of your test site folder
        "gatsby-plugin-transition-link/lib"
    ]
}
  1. In a new terminal window, cd to your workspace folder and run yarn && yarn workspace example run develop.

现在,当您对 TransitionLink src 文件夹进行更改时,它们将反映在您的项目中。

请为您的提交消息使用常规提交规范。

欢迎功能请求和 PR! 如果您遇到问题,请留下问题,我会尽快帮助您。

alt text

Gatsby Plugin Transition Link

TransitionLink provides a simple api for describing expressive transitions between pages in Gatsbyjs. Page links are used to determine which transition should fire, making page transitions flexible and easy to use.

TransitionLink is compatible with declarative react animation libraries like react-pose and react-spring. It's also compatible with imperative animation libraries like gsap and anime.js

Features

  • Per-Link transitions
  • Fine control of page mounting and unmounting timing
  • Function or state based transitions with <TransitionLink />
  • Transition state and status with <TransitionState /> and in your page & template props
  • Display animation content above your pages with <TransitionPortal />
  • Use default transitions with <AniLink />

Usage

For info on using TransitionLink refer to the docs. The source for the docs site is available here.

Contributing

  1. Make sure you have yarn installed.
  2. Create a new folder to be used as your yarn workspace. mkdir transitionlink-workspace
  3. Inside your workspace folder, clone this repo.
  4. cd into this repo and run yarn && yarn watch. Leave this terminal window open.
  5. Beside this repo in your workspace folder, add a gatsby site that uses transition link for testing purposes (you can copy/paste the example site from this repo if needed).
  6. In your workspace folder create a package.json and add the following:
{
    "private": true,
    "workspaces": [
        "example", <-- the name of your test site folder
        "gatsby-plugin-transition-link/lib"
    ]
}
  1. In a new terminal window, cd to your workspace folder and run yarn && yarn workspace example run develop.

Now when you make changes to the TransitionLink src folder, they will reflect in your project.

Please use the Conventional Commits specification for your commit messages.

Feature requests and PR's are welcome! If you're having a problem please leave an issue and I'll help you out asap.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文