Hey everyone,
I'm excited to announce that I've updated the HypeSceneMagic project! Originally developed in 2019, HypeSceneMagic has been revitalized to leverage the powerful GSAP animation library, providing even smoother and more enhanced animation experiences within Tumult Hype.
Inspiration:
The core concept and aesthetics draw inspiration from Apple Keynote's Magic Move transition. If you've ever been captivated by the seamless transitions and animations in Apple presentations, that's exactly the level of polish we're aiming to bring to your Hype projects.
What's New?
- GSAP Integration: The project now utilizes GSAP instead of the Web Animations API, offering more robust and feature-rich animation capabilities.
- Enhanced Transition Properties: Added several properties and functions to fine-tune animations and transitions, including support for runtime transition mapping.
- Case-Insensitive Identifiers: Transition identifiers are now case-insensitive and can be matched without the
magic
prefix, simplifying the process of matching elements across scenes. - Improved Performance: By leveraging GSAP's efficient animation engine, transitions are smoother and more performant.
- Simplified Transition Modes: Removed the indirect transition mode to streamline the user experience, focusing on intuitive and straightforward transitions.
- Updated Documentation: Enhanced code comments and documentation for better clarity, tailored specifically for Tumult Hype users.
Usage & Integration:
The integration remains straightforward:
-
Include Required Libraries:
Add the following scripts to your Head HTML in Tumult Hype:
<script src="https://cdn.jsdelivr.net/npm/gsap@latest/dist/gsap.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/worldoptimizer/HypeSceneMagic/HypeSceneMagic.min.js"></script>
Note: For production environments, it's recommended to download these scripts and include them locally in your project to ensure reliability and performance.
-
Apply Magic Transitions:
- Using Class Names: Assign class names starting with
magic
to elements you want to animate across scenes. For example,magicBox
,magicCircle
, or any unique identifier likemagicMyElement
. - Using Data Attributes: Alternatively, use the
data-transition-id
attribute to assign a unique identifier to elements.
Identifiers are case-insensitive and matched without the
magic
prefix. - Using Class Names: Assign class names starting with
-
Trigger Scene Transitions:
Use the provided functions to navigate between scenes with magic transitions:
// Navigate to a specific scene with magic transition hypeDocument.showSceneNamedMagic('SceneName', duration, easing, options);
duration
: (Optional) Transition duration in seconds. Default is0.5
.easing
: (Optional) Easing function name. Default ispower1.inOut
.options
: (Optional) An object containing additional settings likecrossFadeFactor
,beforeStart
, andafterEnd
.
Example Project:
For a comprehensive example that also includes Hype Data Magic and Hype Reactive Content, check out the project below:
HypeSceneMagic-with-Data-Magic.hype.zip (1.4 MB)
This example demonstrates how you can combine multiple extensions to create dynamic and interactive content.
Getting Started:
For simpler examples and a step-by-step guide on how to get started, please refer to the GitHub repository and read through the thread below.
With these updates, HypeSceneMagic is now more powerful and easier to use than ever. I can't wait to see the amazing transitions and animations you'll create with it!
Happy animating!
Note: The old version using the Web Animations API has been deprecated in favor of the new GSAP-powered version. Here is the static cover for safe keeping if I don't want to use the video anymore: