`}
-css={``}
+css={`
+.container {
+ position: relative;
+}
+.item {
+ /* Position */
+ position: absolute;
+ top: 0;
+
+ /*
+ 80px is the distance from the item to the trigger element.
+ Replace 0deg with 60deg, 180deg, 240deg, 300deg for another item
+ in case you want to have a total of 6 menu items.
+ The formulation is 360 / numberOfItems * indexOfItem
+ */
+ transform: rotate(0deg) translateX(-80px);
+
+ /* Must have the same size as the trigger element */
+ height: 32px;
+ width: 32px;
+}
+.inner {
+ /*
+ Rotate it to make it displayed vertically
+ Replace -0deg with -60deg, -180deg, -240deg, -300deg for another item
+ in case you want to have a total of 6 menu items.
+ The formulation is -(360 / numberOfItems * indexOfItem)
+ */
+ transform: rotate(-0deg);
+
+ /* Center the content */
+ align-items: center;
+ display: flex;
+ justify-content: center;
+
+ /* Take full size */
+ height: 100%;
+ width: 100%;
+}
+`}
>
+`}
+css={`
+.dropdown {
+ position: relative;
+}
+
/* Hide the dropdown's content by default -->
.dropdown-content {
display: none;
+
+ /* Position it right below the trigger element */
+ left: 0;
+ paddingTop: 4px;
+ position: absolute;
+ top: 100%;
+
+ /* It should be on the top of other elements */
+ background-color: #FFF;
+ zIndex: 9999;
+
+ /* Size */
+ height: 200px;
+ width: 200px;
}
/* Show the content when hover on the container -->
.dropdown:hover .dropdown-content {
display: block;
}
-
-
-
+.close {
+ /* Shown at top right corner */
+ position: absolute;
+ right: 16px;
+ top: 16px;
+}
`}
-css={``}
>
= () => {
-.p-mega-menu-container {
+
+
+ ...
+
+
+
+
+
...
+
+
+
+ ...
+
+
+
+`}
+css={`
+.container {
/* Used to position the mega menu */
position: relative;
}
-.p-mega-menu-content {
+.trigger:hover .content {
+ /* Show the mega menu when hovering the trigger item */
+ display: block;
+}
+
+.content {
/* Border */
border: 1px solid rgba(0, 0, 0, 0.3);
margin-top: -1px;
@@ -55,30 +76,7 @@ html={`
background: #fff;
z-index: 9999;
}
-
-.p-mega-menu-trigger:hover .p-mega-menu-content {
- /* Show the mega menu when hovering the trigger item */
- display: block;
-}
-
-
-