circle-menu
:octocat: ⭕️ CircleMenu is a simple, elegant UI menu with a circular layout and material design animations. Swift UI library made by @Ramotion
Top Related Projects
tsParticles - Easily create highly customizable JavaScript particles effects, confetti explosions and fireworks animations and use them as animated backgrounds for your website. Ready to use components available for React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Solid, Riot and Web Components.
A collection of CSS3 powered hover effects to be applied to links, buttons, logos, SVG, featured images and so on. Easily apply to your own elements, modify or just use for inspiration. Available in CSS, Sass, and LESS.
Some inspiration and modern ideas for subtle hover effects.
Pure CSS Image Hover Effect Library
Animate elements as they scroll into view.
JavaScript animation engine
Quick Overview
Circle Menu is an elegant and customizable circular menu UI component for iOS applications. It provides a visually appealing and interactive way to present menu options to users, with smooth animations and a variety of customization options.
Pros
- Visually attractive and engaging user interface
- Highly customizable appearance and behavior
- Smooth and fluid animations
- Easy to integrate into existing iOS projects
Cons
- Limited to circular layout, which may not fit all design requirements
- Potential learning curve for developers unfamiliar with custom UI components
- May require additional effort to make accessible for users with disabilities
- Not suitable for presenting a large number of menu items
Code Examples
- Creating a basic Circle Menu:
let items = [
CircleMenuItemModel(icon: UIImage(named: "home")!, color: .red),
CircleMenuItemModel(icon: UIImage(named: "search")!, color: .blue),
CircleMenuItemModel(icon: UIImage(named: "settings")!, color: .green)
]
let circleMenu = CircleMenu(
frame: CGRect(x: 0, y: 0, width: 64, height: 64),
items: items
)
view.addSubview(circleMenu)
- Customizing the Circle Menu appearance:
circleMenu.buttonsCount = 5
circleMenu.duration = 0.5
circleMenu.distance = 100
circleMenu.showDuration = 0.3
circleMenu.centerButtonSize = CGSize(width: 56, height: 56)
circleMenu.centerButtonIconSize = CGSize(width: 28, height: 28)
circleMenu.centerButtonColor = .purple
circleMenu.centerButtonIconColor = .white
- Handling menu item selection:
circleMenu.delegate = self
// In your delegate implementation:
func circleMenu(_ circleMenu: CircleMenu, buttonDidSelected button: UIButton, atIndex: Int) {
print("Button tapped at index: \(atIndex)")
// Handle the button tap
}
Getting Started
- Install Circle Menu using CocoaPods by adding the following to your Podfile:
pod 'CircleMenu'
- Import the module in your Swift file:
import CircleMenu
- Create a CircleMenu instance and add it to your view:
let items = [
CircleMenuItemModel(icon: UIImage(named: "icon1")!, color: .red),
CircleMenuItemModel(icon: UIImage(named: "icon2")!, color: .blue),
CircleMenuItemModel(icon: UIImage(named: "icon3")!, color: .green)
]
let circleMenu = CircleMenu(
frame: CGRect(x: 150, y: 150, width: 64, height: 64),
items: items
)
view.addSubview(circleMenu)
- Customize the appearance and behavior as needed, and implement the delegate methods to handle user interactions.
Competitor Comparisons
tsParticles - Easily create highly customizable JavaScript particles effects, confetti explosions and fireworks animations and use them as animated backgrounds for your website. Ready to use components available for React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Solid, Riot and Web Components.
Pros of tsparticles
- More versatile and feature-rich, offering a wide range of particle effects and animations
- Supports multiple rendering engines (Canvas, WebGL, SVG)
- Actively maintained with frequent updates and a large community
Cons of tsparticles
- Steeper learning curve due to its extensive configuration options
- Potentially higher performance impact for complex particle systems
Code Comparison
tsparticles:
tsParticles.load("tsparticles", {
particles: {
number: { value: 80 },
color: { value: "#ff0000" },
shape: { type: "circle" },
move: { enable: true, speed: 6 }
}
});
circle-menu:
let circleMenu = CircleMenu(
frame: view.bounds,
normalIcon:"icon-menu",
selectedIcon:"icon-close",
buttonsCount: 4,
duration: 4,
distance: 120)
view.addSubview(circleMenu)
Key Differences
- tsparticles focuses on creating particle systems and effects, while circle-menu is specifically designed for circular menu interfaces
- tsparticles is primarily used in web development (JavaScript), whereas circle-menu is for iOS development (Swift)
- tsparticles offers more customization options and flexibility, while circle-menu provides a simpler, more focused solution for its specific use case
A collection of CSS3 powered hover effects to be applied to links, buttons, logos, SVG, featured images and so on. Easily apply to your own elements, modify or just use for inspiration. Available in CSS, Sass, and LESS.
Pros of Hover
- Offers a wide variety of hover effects (over 40) for different UI elements
- Easy to implement with simple CSS classes
- Lightweight and doesn't require JavaScript
Cons of Hover
- Limited to hover effects only, not a full-fledged menu system
- May require additional customization for complex designs
- Some effects might not be suitable for all types of content
Code Comparison
Hover:
.hvr-grow {
display: inline-block;
vertical-align: middle;
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
transition-duration: 0.3s;
transition-property: transform;
}
Circle Menu:
import CircleMenu
let items = [
CircleMenuItem(icon: UIImage(named: "icon1")),
CircleMenuItem(icon: UIImage(named: "icon2")),
CircleMenuItem(icon: UIImage(named: "icon3"))
]
let menu = CircleMenu(
frame: view.bounds,
normalIcon:"icon_menu",
selectedIcon:"icon_close",
buttonsCount: 3,
duration: 2,
distance: 120)
Circle Menu is a more specialized solution for creating circular menus with animations, while Hover provides a broader set of hover effects for various UI elements. Circle Menu requires more setup but offers a complete menu system, whereas Hover is simpler to implement but limited to hover effects.
Some inspiration and modern ideas for subtle hover effects.
Pros of HoverEffectIdeas
- Offers a wide variety of hover effects for different UI elements
- Provides standalone examples that can be easily integrated into existing projects
- Includes modern, visually appealing designs suitable for contemporary web applications
Cons of HoverEffectIdeas
- Lacks a cohesive library structure, making it harder to implement as a complete solution
- May require more customization to fit specific project needs
- Does not offer a circular menu layout like circle-menu
Code Comparison
HoverEffectIdeas (HTML structure):
<figure class="effect-lily">
<img src="img/1.jpg" alt="img01"/>
<figcaption>
<h2>Nice <span>Lily</span></h2>
<p>Lily likes to play with crayons and pencils</p>
<a href="#">View more</a>
</figcaption>
</figure>
circle-menu (Swift implementation):
let menuButtonFrame = CGRect(x: 100, y: 100, width: 50, height: 50)
let circleMenu = CircleMenu(
frame: menuButtonFrame,
normalIcon:"icon_menu",
selectedIcon:"icon_close",
buttonsCount: 4,
duration: 4,
distance: 120)
view.addSubview(circleMenu)
Both repositories offer unique UI solutions, with HoverEffectIdeas focusing on diverse hover effects and circle-menu providing a specific circular menu implementation. The choice between them depends on the project's requirements and design preferences.
Pure CSS Image Hover Effect Library
Pros of imagehover.css
- Lightweight and easy to implement with pure CSS
- Offers a wide variety of hover effects for images
- No JavaScript dependencies, reducing potential conflicts
Cons of imagehover.css
- Limited to image hover effects, less versatile than circle-menu
- Lacks interactive functionality beyond hover effects
- May require additional customization for complex designs
Code Comparison
imagehover.css:
.imghvr-fade figcaption {
opacity: 0;
}
.imghvr-fade:hover figcaption {
opacity: 1;
}
circle-menu:
let circleMenu = CircleMenu(
frame: view.bounds,
normalIcon:"icon-menu",
selectedIcon:"icon-close",
buttonsCount: 4,
duration: 4,
distance: 120)
view.addSubview(circleMenu)
imagehover.css provides simple CSS classes for hover effects, while circle-menu requires Swift code for implementation and offers more complex interactive functionality. imagehover.css is more accessible for web developers familiar with CSS, whereas circle-menu is tailored for iOS app development using Swift.
Animate elements as they scroll into view.
Pros of ScrollReveal
- More versatile, can be applied to various elements for scroll-based animations
- Lightweight and easy to implement with minimal configuration
- Actively maintained with regular updates and bug fixes
Cons of ScrollReveal
- Limited to scroll-based animations, less interactive than Circle Menu
- May require more JavaScript knowledge for advanced customizations
- Performance can be affected when animating many elements simultaneously
Code Comparison
ScrollReveal:
ScrollReveal().reveal('.element', {
delay: 200,
distance: '50px',
origin: 'bottom',
duration: 1000
});
Circle Menu:
let circleMenu = CircleMenu(
frame: view.bounds,
normalIcon:"icon_menu",
selectedIcon:"icon_close",
buttonsCount: 4,
duration: 4,
distance: 120)
view.addSubview(circleMenu)
Key Differences
- ScrollReveal is a JavaScript library for web-based scroll animations, while Circle Menu is an iOS library for creating circular menus
- ScrollReveal focuses on revealing elements as the user scrolls, whereas Circle Menu provides an interactive radial menu interface
- Implementation differs significantly: ScrollReveal uses JavaScript and CSS, while Circle Menu uses Swift for iOS development
Use Cases
- ScrollReveal: Ideal for creating engaging scroll-based animations on websites and web applications
- Circle Menu: Best suited for iOS apps requiring a unique and visually appealing menu interface
JavaScript animation engine
Pros of anime
- More versatile animation library, capable of animating various properties beyond just menu items
- Lightweight (less than 6kb) and high-performance
- Extensive documentation and examples
Cons of anime
- Requires more setup and configuration for specific use cases like circular menus
- Steeper learning curve for beginners compared to purpose-built libraries
Code Comparison
circle-menu:
let circleMenu = CircleMenu(
frame: view.bounds,
normalIcon:"icon_menu",
selectedIcon:"icon_close",
buttonsCount: 4,
duration: 4,
distance: 120)
view.addSubview(circleMenu)
anime:
anime({
targets: '.menu-item',
translateX: function(el, i) {
return 100 * Math.cos(i * 2 * Math.PI / 4);
},
translateY: function(el, i) {
return 100 * Math.sin(i * 2 * Math.PI / 4);
},
scale: [0, 1],
duration: 1000,
delay: anime.stagger(200)
});
circle-menu is a specialized Swift library for creating circular menus with predefined animations and behaviors. anime is a more general-purpose JavaScript animation library that can be used to create similar effects but requires more custom code. circle-menu offers a simpler API for its specific use case, while anime provides greater flexibility for various animation needs.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
CIRCLE MENU
Simple, elegant UI menu with a circular layout and material design animations
We specialize in the designing and coding of custom UI for Mobile Apps and Websites.
Stay tuned for the latest updates:
Requirements
- iOS 9.0+
- Xcode 9.0.1
Installation
Just add CircleMenuLib folder to your project.
or use CocoaPods with Podfile:
pod 'CircleMenu'
or Carthage users can simply add to their Cartfile
:
github "Ramotion/circle-menu"
Usage
with storyboard
-
Create a new UIButton inheriting from
CircleMenu
-
Add images for Normal and Selected state
-
Use delegate method to configure buttons
func circleMenu(circleMenu: CircleMenu, willDisplay button: UIButton, atIndex: Int)
- Use properties to configure CircleMenu
@IBInspectable var buttonsCount: Int = 3
@IBInspectable var duration: Double = 2 // circle animation duration
@IBInspectable var distance: Float = 100 // distance between center button and buttons
programmatically
let button = CircleMenu(
frame: CGRect(x: 200, y: 200, width: 50, height: 50),
normalIcon:"icon_menu",
selectedIcon:"icon_close",
buttonsCount: 4,
duration: 4,
distance: 120)
button.delegate = self
button.layer.cornerRadius = button.frame.size.width / 2.0
view.addSubview(button)
delegate methods
// configure buttons
optional func circleMenu(circleMenu: CircleMenu, willDisplay button: UIButton, atIndex: Int)
// call before animation
optional func circleMenu(circleMenu: CircleMenu, buttonWillSelected button: UIButton, atIndex: Int)
// call after animation
optional func circleMenu(circleMenu: CircleMenu, buttonDidSelected button: UIButton, atIndex: Int)
// call upon cancel of the menu - fires immediately on button press
optional func menuCollapsed(circleMenu: CircleMenu)
// call upon opening of the menu - fires immediately on button press
optional func menuOpened(circleMenu: CircleMenu)
ð Check this library on other language:
ð License
Circle Menu is released under the MIT license. See LICENSE for details.
This library is a part of a selection of our best UI open-source projects.
If you use the open-source library in your project, please make sure to credit and backlink to www.ramotion.com
ð± Get the Showroom App for iOS to give it a try
Try this UI component and more like this in our iOS app. Contact us if interested.
Top Related Projects
tsParticles - Easily create highly customizable JavaScript particles effects, confetti explosions and fireworks animations and use them as animated backgrounds for your website. Ready to use components available for React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Solid, Riot and Web Components.
A collection of CSS3 powered hover effects to be applied to links, buttons, logos, SVG, featured images and so on. Easily apply to your own elements, modify or just use for inspiration. Available in CSS, Sass, and LESS.
Some inspiration and modern ideas for subtle hover effects.
Pure CSS Image Hover Effect Library
Animate elements as they scroll into view.
JavaScript animation engine
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot