mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
editor buttons fix on mobile
This commit is contained in:
parent
3d398f23ed
commit
b794a44c4f
3 changed files with 97 additions and 46 deletions
|
@ -20,11 +20,11 @@
|
||||||
@include tablet {
|
@include tablet {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.image_container {
|
.image_container {
|
||||||
border-radius: $panel_radius 0 0 $panel_radius;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
|
@ -45,6 +45,10 @@
|
||||||
border-radius: $radius;
|
border-radius: $radius;
|
||||||
box-shadow: transparentize($color: white, $amount: 0.95) 0 -1px,
|
box-shadow: transparentize($color: white, $amount: 0.95) 0 -1px,
|
||||||
transparentize($color: #000000, $amount: 0.6) 0 2px 5px;
|
transparentize($color: #000000, $amount: 0.6) 0 2px 5px;
|
||||||
|
|
||||||
|
@include tablet {
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.is_dragging {
|
&.is_dragging {
|
||||||
|
|
|
@ -60,6 +60,11 @@ const NodePanelInner: FC<IProps> = memo(
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{can_edit && (
|
{can_edit && (
|
||||||
|
<div className={styles.editor_menu}>
|
||||||
|
<div className={styles.editor_menu_button}>
|
||||||
|
<Icon icon="dots-vertical" size={24} onClick={onStar} />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className={styles.editor_buttons}>
|
<div className={styles.editor_buttons}>
|
||||||
{can_star && (
|
{can_star && (
|
||||||
<div className={classNames(styles.star, { is_heroic })}>
|
<div className={classNames(styles.star, { is_heroic })}>
|
||||||
|
@ -79,6 +84,7 @@ const NodePanelInner: FC<IProps> = memo(
|
||||||
<Icon icon="edit" size={24} onClick={onEdit} />
|
<Icon icon="edit" size={24} onClick={onEdit} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className={styles.buttons}>
|
<div className={styles.buttons}>
|
||||||
|
|
|
@ -1,3 +1,32 @@
|
||||||
|
@mixin button {
|
||||||
|
margin: 0 $gap;
|
||||||
|
cursor: pointer;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
svg {
|
||||||
|
fill: darken(white, 50%);
|
||||||
|
transition: fill 0.25s;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
svg {
|
||||||
|
fill: $red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: ' ';
|
||||||
|
flex: 0 0 6px;
|
||||||
|
height: $gap;
|
||||||
|
width: 6px;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: transparentize(black, 0.7);
|
||||||
|
margin-left: $gap * 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.wrap {
|
.wrap {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -96,36 +125,7 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
& > * {
|
& > * {
|
||||||
margin: 0 $gap;
|
@include button;
|
||||||
cursor: pointer;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
svg {
|
|
||||||
fill: darken(white, 50%);
|
|
||||||
transition: fill 0.25s;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
svg {
|
|
||||||
fill: $red;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: ' ';
|
|
||||||
flex: 0 0 6px;
|
|
||||||
height: $gap;
|
|
||||||
width: 6px;
|
|
||||||
border-radius: 4px;
|
|
||||||
background: transparentize(black, 0.7);
|
|
||||||
margin-left: $gap * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@include tablet {
|
@include tablet {
|
||||||
|
@ -148,6 +148,20 @@
|
||||||
.editor_buttons {
|
.editor_buttons {
|
||||||
@include tablet {
|
@include tablet {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
||||||
|
& > * {
|
||||||
|
&:last-child {
|
||||||
|
margin-right: 0;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,3 +241,30 @@
|
||||||
fill: $orange;
|
fill: $orange;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.editor_menu_button {
|
||||||
|
display: none !important;
|
||||||
|
|
||||||
|
@include button();
|
||||||
|
|
||||||
|
@include tablet {
|
||||||
|
display: flex !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor_menu {
|
||||||
|
// position: relative;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
.editor_buttons {
|
||||||
|
display: flex;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 100%;
|
||||||
|
background: darken($content_bg, 4%);
|
||||||
|
padding: $gap $gap * 2;
|
||||||
|
border-radius: $radius;
|
||||||
|
box-shadow: transparentize(black, 0.8) 5px 5px 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue