Establish a rotational mechanism based on the position of the cursor.
Throughout this tutorial:
- Establish the correct perspective
- Create the triggering element
- Animate the rotational movement
- Set the default state
- Add a special effect for emphasis
Establish the correct perspective
- Ensure that the ancestor element of the target element for animation is selected
- Within the Style panel under Transitions & transforms, modify the Children perspective to 1000 pixels
Create the triggering element
- Select the specific element to be used as the trigger (like a Card)
- In the Interactions panel, click the addition symbol near On Selected Element and choose Mouse movement over the element from the dropdown menu
Animate the rotational movement
- Access the Interactions panel > On mouse movement > Action > Initiate mouse animation
- Click the plus symbol next to Mouse animations
- Name it (for example, Hover Rotation)
- Click the plus symbol under the timeline of Mouse X actions at 0% and pick Rotate
- In the Rotate section, adjust the y-axis to -5 degrees
- Select the Card element at 100% and in the Rotate field, change its y-axis to 5 degrees
- Add a Rotate action under Mouse Y actions
- At 0% in Rotate, set the x-axis to 5 degrees
- At 100% in Rotate, set the x-axis to -5 degrees
- Complete the animation adjustments to refine the Smoothing
Set the default state
- In the Interactions panel under On mouse movement, define the Mouse X position as 50%
- Establish the Mouse Y position as 50%
Add a special effect for emphasis
- Place a new Div block onto the canvas within the corresponding element (Card)
- Create a Class and assign a name (such as Card-highlight)
- Set its dimensions (e.g., to 400 pixels) and position to absolute
- Position it from the top left corner
- Choose a suitable Background color (e.g., white)
- Modify the Radius under Border to 50%
- Adjust the Opacity to 10% under Effects
- Apply a Blur filter and change the Radius to 50 pixels
- In the Interactions panel, pick Hover Rotation
- In the Mouse X timeline at 0%, include a Move animation and set its x-axis to 100%
- In the Mouse X timeline at 100%, incorporate a Move animation with its x-axis set to -50%
- For the Mouse Y timeline at 0%, integrate a Move animation and adjust its y-axis to 50%
- At 100% in the Mouse Y timeline, apply a Move animation and modify its y-axis to -50%
Review your progress in preview mode.
Latest posts by Ewan Mak (see all)
- Include or eliminate Workspace spots and members - April 15, 2024
- Centering box summary - April 15, 2024
- Store a site for future reference - April 15, 2024