😍
Framer API 中文版
  • 写在前面
  • 从这里开始
    • 介绍
      • 快速开始
      • 基础
    • 教程
      • 准备 Setup
      • 引入 Slider 组件
      • Slider组件的元素
      • 拖动 & MotionValue
      • Hooks & 传递数据
      • 完成
      • 回顾
    • 简要案例
      • Frame
      • Stack
      • Animate
      • Gestures
      • Dragging 拖拽
      • Scrolling 滚动
      • Paging 翻页
      • Tranforms 变换
      • Variants 动画状态组
  • LIBRARY 库
    • Frame
      • Layout 布局
      • Visual 视觉
      • Transform 变换
      • Animation 动画
      • Transition 过渡
      • Variants 动画状态组
      • Tap 点击
      • Hover 悬浮
      • Pan
      • Drag
      • Types
    • Animation
      • Overview
      • Animation controls
      • Tween
      • Spring
      • Inertia 惯性
      • Orchestration
      • Types
    • Color
      • Create
      • Modify
      • Convert
      • Compare
      • Models
    • Page
      • Content
      • Padding
      • Events
      • Effects
      • PageEffectInfo
    • Scroll
      • Sizing
      • Content
      • Events
    • Stack
      • Content
      • Padding
    • Utilities
      • Transfrom
      • useTransform
      • useAnimation
      • useCycle
      • useMotionValue
      • useSpring
      • useViewportScroll
  • FRAMER X
    • Assets
      • Functions
    • Data & Overrides
    • CanvasComponents
      • Canvas.tsx
      • Layout
      • Colors
    • PropertyControls
      • Adding Controls
      • Hiding Controls
      • Array
      • Boolean
      • Color
      • ComponentInstance
      • Enum
      • File
      • FusedNumber
      • Image
      • Number
      • SegmentedEnum
      • String
    • Render Target
      • Properties
      • Functions
Powered by GitBook
On this page

Was this helpful?

  1. LIBRARY 库
  2. Page

Effects

Page组件定义了很多页面切换的动画效果,你可以选择其中一个或者自己再重新自定义一个。

None

默认的动画效果,没有什么特别的效果。

<Page defaultEffect={"none"} />

Cube

每个页面都成为一个3d盒子的一面,翻页时像一个3d盒子在翻转

<Page defaultEffect={"cube"} />

Cover Flow

每个页面过度时有一个3D的透视效果

<Page defaultEffect={"coverflow"} />

Wheel

页面切换时有很细微的透明度变化(我只看出这个变化)

<Page defaultEffect={"wheel"} />

Pile

每个页面切换时会堆叠到当前页面的上面

<Page defaultEffect={"pile"} />

Custom 自定义

effect: (info: PageEffectInfo) => PageEffectValues

你可以自定义每一页的动画过渡效果

这个函数会在每次页面进行切换时进行调用。它返回的是这个页面新的样式的设置。

function scaleEffect() {
    const { normalizedOffset } = info
    return {
        scale: Math.max(0, 1 + Math.min(0, normalizedOffset * -1))
    }
}

return <Page effect={scaleEffect} />

PreviousEventsNextPageEffectInfo

Last updated 5 years ago

Was this helpful?