menu widget: add layout modes and tweak

This commit is contained in:
bordun 2020-01-25 15:10:21 +01:00
parent 7ad571e8fd
commit 9e74387ede
2 changed files with 199 additions and 45 deletions

View file

@ -9,28 +9,72 @@
border-radius: 0!important; // border radius breaks it somehow
z-index: initial!important;
--size:300rem;
--size: 300rem;
--grid-columns: 2;
.menu {
display:none;
&.show {
display:block;
animation: menu-widget-fade .1s forwards;
}
animation: menu-widget-fade .1s forwards;
width:var(--size);
height:var(--size);
position: fixed;
z-index: 999999999;
margin-left: calc(var(--x) - var(--size) / 2);
margin-top: calc(var(--y) - var(--size) / 2);
background: var(--color-fg);
border-radius: 100%;
overflow: hidden;
box-shadow: 0 0 0 1rem var(--color-light) inset, 0 0 5rem 0 var(--color-bg) ;
.item {
z-index: 1;
overflow: hidden;
&.on:before {
content:"";
position: absolute;
top:0;
left:0;
right:0;
bottom:0;
pointer-events: none;
background: var(--color-custom);
opacity: 0.3;
}
&.active:after {
content:"";
position: absolute;
top:0;
left:0;
right:0;
bottom:0;
pointer-events: none;
background: var(--color-light);
}
div {
text-align: center;
pointer-events: none;
}
}
}
&.circular .menu {
border-radius: 100%;
width:var(--size);
height:var(--size);
margin-left: calc(var(--x) - var(--size) / 2);
margin-top: calc(var(--y) - var(--size) / 2);
&:after {
content:"";
position: absolute;
@ -46,17 +90,13 @@
z-index: 10;
}
.item {
position: absolute;
z-index: 1;
top: calc(-1 * var(--size) / 2);
left: calc(-1 * var(--size) / 2);
width: 100%;
height: 100%;
transform-origin: 100% 100%;
overflow: hidden;
position: absolute;
box-shadow: 0 0 0 2.5rem var(--color-light) inset, 0 0 0 1.5rem var(--color-bg) inset;
&.on div:before {
@ -71,35 +111,10 @@
box-shadow: 0 0 0 4rem var(--color-custom);
}
&.on:before {
content:"";
position: absolute;
top:0;
left:0;
right:0;
bottom:0;
pointer-events: none;
background: var(--color-custom);
opacity: 0.3;
}
&.active:after {
content:"";
position: absolute;
top:0;
left:0;
right:0;
bottom:0;
pointer-events: none;
background: var(--color-light);
}
div {
position: absolute;
bottom: 0;
right: 0;
text-align: center;
pointer-events: none;
}
span {
@ -111,7 +126,66 @@
}
}
&.box .menu {
width:var(--size-box-w);
height:var(--size-box-h);
margin-left: calc(var(--x) - var(--size-box-w) / 2);
margin-top: calc(var(--y) - var(--size-box-h) / 2);
background: var(--color-bg);
&.show {
display: flex;
}
flex-direction: row;
.item {
position: relative;
margin:.5rem;
background: var(--color-fg);
box-shadow: 0 0 0 1rem var(--color-light) inset;
&.on div:before {
content:"";
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
pointer-events: none;
box-shadow: 0 0 0 1rem var(--color-custom) inset;
opacity: 0.3;
}
div {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
}
}
}
&.grid .menu {
&.show {
display: grid;
grid-template-columns: repeat(var(--grid-columns), 1fr);
}
}
&.vertical .menu {
flex-direction: column;
}
}
.widget.menu-container > .label:after {