mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 19:16:41 +07:00
appearance: much more fixes
This commit is contained in:
parent
291280c52e
commit
b586663827
11 changed files with 64 additions and 23 deletions
|
@ -46,9 +46,19 @@ export const Component = (props: Props) => {
|
||||||
|| mode === MODES.CONFIRM_CANCEL
|
|| mode === MODES.CONFIRM_CANCEL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const dialogIsSmall = (
|
||||||
|
mode === MODES.LOGO
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
showDialog &&
|
showDialog &&
|
||||||
<div id="control-dialog" style={{ width }}>
|
<div
|
||||||
|
id="control-dialog"
|
||||||
|
style={{
|
||||||
|
width: dialogIsSmall ? 201 : width,
|
||||||
|
right: dialogIsSmall ? 217 : 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
{ mode === MODES.ROUTER && <RouterDialog {...props} /> }
|
{ mode === MODES.ROUTER && <RouterDialog {...props} /> }
|
||||||
{ mode === MODES.STICKERS && <StickersDialog {...props} /> }
|
{ mode === MODES.STICKERS && <StickersDialog {...props} /> }
|
||||||
{ mode === MODES.TRASH && <TrashDialog {...props} /> }
|
{ mode === MODES.TRASH && <TrashDialog {...props} /> }
|
||||||
|
|
|
@ -150,10 +150,10 @@ class Component extends React.PureComponent<Props, void> {
|
||||||
<div className={classnames('panel right', { active: !editing })}>
|
<div className={classnames('panel right', { active: !editing })}>
|
||||||
<div className="control-bar">
|
<div className="control-bar">
|
||||||
<button
|
<button
|
||||||
className={classnames({ active: mode === MODES.SHOTTER })}
|
className={classnames('disabled', { active: mode === MODES.SHOTTER })}
|
||||||
onClick={this.startShotterMode}
|
onClick={this.startShotterMode}
|
||||||
>
|
>
|
||||||
<Icon icon="icon-shot-2" />
|
<Icon icon="icon-shot-3" />
|
||||||
<span>
|
<span>
|
||||||
СНИМОК
|
СНИМОК
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -87,6 +87,18 @@ export class Component extends React.PureComponent<Props, void> {
|
||||||
<UserMenu user={user} userLogout={this.props.userLogout} />
|
<UserMenu user={user} userLogout={this.props.userLogout} />
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="control-sep" />
|
||||||
|
|
||||||
|
<div className="control-bar">
|
||||||
|
<button
|
||||||
|
className="disabled"
|
||||||
|
// className={classnames({ active: mode === MODES.SHOTTER })}
|
||||||
|
// onClick={this.startShotterMode}
|
||||||
|
>
|
||||||
|
<Icon icon="icon-shot-3" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -2,6 +2,7 @@ import React from 'react';
|
||||||
|
|
||||||
import { MODES } from '$constants/modes';
|
import { MODES } from '$constants/modes';
|
||||||
import { editor } from '$modules/Editor';
|
import { editor } from '$modules/Editor';
|
||||||
|
import { Icon } from '$components/panels/Icon';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
stopEditing: Function,
|
stopEditing: Function,
|
||||||
|
@ -24,12 +25,12 @@ export class CancelDialog extends React.Component<Props, void> {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="helper cancel-helper">
|
<div className="helper cancel-helper">
|
||||||
<div className="helper__text">
|
<div className="helper__text danger">
|
||||||
<div className="big white">Изменения не сохранены!</div>
|
<Icon icon="icon-cancel-1" />
|
||||||
<div className="small gray">Закрыть редактор?</div>
|
<div className="big upper">Закрыть редактор?</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="helper__buttons">
|
<div className="helper__buttons">
|
||||||
<div className="button danger router-helper__button" onClick={this.cancel}>
|
<div className="button router-helper__button" onClick={this.cancel}>
|
||||||
Удалить измения
|
Удалить измения
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ export const TrashDialog = ({
|
||||||
<div className="helper trash-helper">
|
<div className="helper trash-helper">
|
||||||
<div className="helper__text danger">
|
<div className="helper__text danger">
|
||||||
<Icon icon="icon-trash-4" />
|
<Icon icon="icon-trash-4" />
|
||||||
<div className="big upper">Уверены?</div>
|
<div className="big upper">Удалить:</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="helper__buttons">
|
<div className="helper__buttons">
|
||||||
<div className="button-group">
|
<div className="button-group">
|
||||||
|
|
|
@ -44,10 +44,12 @@ export class Editor {
|
||||||
|
|
||||||
this.switches = {
|
this.switches = {
|
||||||
[MODES.POLY]: {
|
[MODES.POLY]: {
|
||||||
start: this.poly.continue,
|
start: this.startPoly,
|
||||||
stop: this.poly.stop,
|
stop: this.poly.stop,
|
||||||
|
toggle: this.clearMode,
|
||||||
},
|
},
|
||||||
[MODES.ROUTER]: {
|
[MODES.ROUTER]: {
|
||||||
|
toggle: this.clearMode,
|
||||||
start: this.routerSetStart,
|
start: this.routerSetStart,
|
||||||
},
|
},
|
||||||
[MODES.SHOTTER]: {
|
[MODES.SHOTTER]: {
|
||||||
|
@ -57,10 +59,14 @@ export class Editor {
|
||||||
toggle: this.clearSticker,
|
toggle: this.clearSticker,
|
||||||
},
|
},
|
||||||
[MODES.TRASH]: {
|
[MODES.TRASH]: {
|
||||||
toggle: this.clearAll,
|
// toggle: this.clearAll,
|
||||||
|
toggle: this.clearMode,
|
||||||
},
|
},
|
||||||
[MODES.CONFIRM_CANCEL]: {
|
[MODES.CONFIRM_CANCEL]: {
|
||||||
toggle: this.cancelEditing,
|
toggle: this.cancelEditing,
|
||||||
|
},
|
||||||
|
[MODES.LOGO]: {
|
||||||
|
toggle: this.clearMode,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -88,18 +94,26 @@ export class Editor {
|
||||||
getTitle = () => store.getState().user.title;
|
getTitle = () => store.getState().user.title;
|
||||||
getEditing = () => store.getState().user.editing;
|
getEditing = () => store.getState().user.editing;
|
||||||
getChanged = () => store.getState().user.changed;
|
getChanged = () => store.getState().user.changed;
|
||||||
|
getRouterPoints = () => store.getState().user.routerPoints;
|
||||||
|
|
||||||
setMode = value => store.dispatch(setMode(value));
|
setMode = value => store.dispatch(setMode(value));
|
||||||
setDistance = value => store.dispatch(setDistance(value));
|
setDistance = value => store.dispatch(setDistance(value));
|
||||||
setChanged = value => store.dispatch(setChanged(value));
|
setChanged = value => store.dispatch(setChanged(value));
|
||||||
setRouterPoints = value => store.dispatch(setRouterPoints(value));
|
setRouterPoints = value => store.dispatch(setRouterPoints(value));
|
||||||
setActiveSticker = value => store.dispatch(setActiveSticker(value));
|
setActiveSticker = value => store.dispatch(setActiveSticker(value));
|
||||||
setLogo = value => store.dispatch(setLogo(value));
|
|
||||||
setTitle = value => store.dispatch(setTitle(value));
|
setTitle = value => store.dispatch(setTitle(value));
|
||||||
setAddress = value => store.dispatch(setAddress(value));
|
setAddress = value => store.dispatch(setAddress(value));
|
||||||
|
|
||||||
|
clearMode = () => this.setMode(MODES.NONE);
|
||||||
clearChanged = () => store.dispatch(setChanged(false));
|
clearChanged = () => store.dispatch(setChanged(false));
|
||||||
|
|
||||||
|
startPoly = () => {
|
||||||
|
console.log(this.getRouterPoints());
|
||||||
|
if (this.getRouterPoints()) this.router.clearAll();
|
||||||
|
|
||||||
|
this.poly.continue();
|
||||||
|
};
|
||||||
|
|
||||||
triggerOnChange = () => {
|
triggerOnChange = () => {
|
||||||
if (!this.getEditing() || this.getChanged()) return;
|
if (!this.getEditing() || this.getChanged()) return;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
padding: 4px 16px;
|
padding: 4px 16px;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
line-height: 1em;
|
line-height: 1em;
|
||||||
border-radius: 2px;
|
border-radius: @button_radius;
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
|
@ -38,11 +38,11 @@
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
border-radius: 4px 0 0 4px;
|
border-radius: @button_radius 0 0 @button_radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
border-radius: 0 4px 4px 0;
|
border-radius: 0 @button_radius @button_radius 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
@red_secondary: #ff3344;
|
@red_secondary: #ff3344;
|
||||||
|
|
||||||
@panel_radius: 0;
|
@panel_radius: 0;
|
||||||
|
@button_radius: 0;
|
||||||
|
|
||||||
@color_primary: #4597d0;
|
@color_primary: #4597d0;
|
||||||
@color_success: #7cd766;
|
@color_success: #7cd766;
|
||||||
|
|
|
@ -9,6 +9,10 @@
|
||||||
cursor: crosshair;
|
cursor: crosshair;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.leaflet-touch .leaflet-bar a {
|
||||||
|
border-radius: @panel_radius !important;
|
||||||
|
}
|
||||||
|
|
||||||
.leaflet-vertex-icon, .leaflet-middle-icon {
|
.leaflet-vertex-icon, .leaflet-middle-icon {
|
||||||
outline: none !important;
|
outline: none !important;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
@ -66,7 +70,7 @@
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 10px;
|
top: 10px;
|
||||||
left: 10px;
|
left: 10px;
|
||||||
border-radius: 2px 0 0 2px;
|
border-radius: @panel_radius 0 0 @panel_radius;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
box-shadow: @bar_shadow;
|
box-shadow: @bar_shadow;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
|
@ -149,7 +149,7 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 10px;
|
right: 10px;
|
||||||
bottom: 68px;
|
bottom: 68px;
|
||||||
border-radius: 3px;
|
border-radius: @panel_radius;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
color: white;
|
color: white;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
@ -215,7 +215,7 @@
|
||||||
.logo-helper {
|
.logo-helper {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 16px 0 0 0;
|
padding: 16px 0 16px 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
padding-top: 2px;
|
padding-top: 2px;
|
||||||
font-weight: 200;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,12 +66,12 @@
|
||||||
|
|
||||||
.user-panel-menu {
|
.user-panel-menu {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 45px;
|
bottom: 58px;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 219px;
|
||||||
background: @dialog_background;
|
background: @dialog_background;
|
||||||
border-radius: 3px;
|
border-radius: @panel_radius;
|
||||||
padding: 0 0 3px 0;
|
padding: 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
z-index: -1
|
z-index: -1
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,6 @@
|
||||||
display: block;
|
display: block;
|
||||||
border-bottom: 1px solid rgba(255,255,255,0.1);
|
border-bottom: 1px solid rgba(255,255,255,0.1);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-weight: 200;
|
|
||||||
|
|
||||||
&:first-child::after {
|
&:first-child::after {
|
||||||
border-radius: 3px 3px 0 0;
|
border-radius: 3px 3px 0 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue