主页 Open-Source YZ3DMenu Navigation Menu
Post
Cancel

Open-Source YZ3DMenu Navigation Menu

Preface

This article is highly personal in tone. If you find it uncomfortable to read, please close it as soon as possible. This article is only a personal learning record. Reposts and sharing are welcome within the scope of the license agreement. Please respect the copyright and keep the original link. Thank you for your understanding and cooperation. If you find this site helpful, you can subscribe via RSS. Thanks for your support!

Check out the effect in the images above.

Open-source project Practical implementation

This menu is a 3D menu; it appeared in an app called cosmos. I’d been looking for time to build this feature and open-source it. Later, an open-source project similar to Weibo appeared: Cosmos. I had some time recently, so I rewrote this component.

Implementation Principle

  • Trigger via the tabbar button (with an internal pan gesture wrapper) at the right time — during dragging, on end or cancel…
  • Add a new window and overlay a Blur blur and container on it, along with the encapsulated dashboard menu view.
  • During the swipe, modify the m34 animation property of the menu view (dashboard menu) to achieve the tilted sliding effect.

Internal variables

Below is the code structure design of the framework.

There’s a lot of code, so I won’t list it all in detail here. I put the code on github — those interested can click and take a look.

Summary

I’d been wanting to rewrite this for a while but never found the time. Later on, I plan to rewrite a new wheel in Swift. I hope this open-source component can help you. If you have any questions, leave a comment below. It’s been a long time since I wrote a blog post. In 2022, I should keep writing some hardcore technical content.

Demo for this post

– Excerpt from
Reference: Cosmos
[zh] zhnnnnn
This material is protected by copyright.

该博客文章由作者通过 CC BY 4.0 进行授权。