JSFiddle - React, Tailwind, and code Playground
by velo_ninja
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dynamic Round Menu with Tooltip and Submenus</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
background-color: #f0f0f0;
}
.menu-container {
position: relative;
width: 400px;
height: 400px;
}
.menu {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
transform-origin: center;
transition: transform 0.3s;
}
.menu-item {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
width: 100px;
height: 100px;
border-radius: 50%;
background: rgba(33, 150, 243, 0.6);
color: #ffffff;
cursor: pointer;
transition: transform 0.3s, background 0.3s;
font-size: 16px;
text-align: center;
transform-origin: center center;
backdrop-filter: blur(5px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.menu-item:hover {
background-color: rgba(33, 150, 43, 0.6);
color: #ffffff;
}
.menu-item.selected {
background-color: rgba(0, 128, 43, 0.6);
z-index: 888;
box-shadow: 0 0 20px 5px rgba(0, 255, 0, 0.8);
}
.menu-item.selected .menu-text {
transform: rotate(0deg);
transition: transform 0.3s;
}
.menu-text {
display: inline-block;
transition: transform 0.3s;
}
.submenu {
position: absolute;
display: none;
flex-direction: column;
align-items: center;
background: rgba(255, 255, 255, 0.9);
border: 1px solid rgba(204, 204, 204, 0.5);
border-radius: 5px;
box-shadow: 0 0...