Skip to content

Commit 12554e9

Browse files
committed
main menu transformed to icons
1 parent ce69cdd commit 12554e9

File tree

9 files changed

+36
-38
lines changed

9 files changed

+36
-38
lines changed

css/ui.css

+29-29
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
button:not(:disabled) {
2+
cursor: pointer;
3+
}
4+
15
.ui {
26
position: fixed;
37
right: 0;
@@ -24,7 +28,7 @@
2428
text-align: center;
2529
}
2630

27-
.ui button, .ui select, .ui input {
31+
.ui select, .ui input {
2832
color: #000;
2933
border: none;
3034
font-size: 13px;
@@ -35,47 +39,42 @@
3539
transition: all 250ms linear;
3640
}
3741

38-
.ui p button:hover, .ui p select:hover, .ui p input:hover, .ui p :focus {
42+
.ui select:hover, .ui input:hover {
3943
opacity: 0.8;
4044
}
4145

42-
.ui:not([id]) p button {
43-
color: #fff;
44-
}
45-
46-
.ui:not([id]) p:nth-of-type(1) button {
47-
background-color: #1abc9c;
48-
}
49-
50-
.ui:not([id]) p:nth-of-type(2) button {
51-
background-color: #3498db;
46+
.ui select, .ui input, .ui #color {
47+
width: 168px;
5248
}
5349

54-
.ui:not([id]) p:nth-of-type(3) button {
55-
background-color: #2ecc71;
50+
.ui .go {
51+
font-weight: bold;
5652
}
5753

58-
59-
.ui button {
60-
cursor: pointer;
61-
text-align: center;
62-
width: 82px;
54+
.ui p {
55+
margin: 8px 16px;
6356
}
6457

65-
.ui select, .ui input, .ui #color {
66-
width: 168px;
58+
.ui:not([id]) button {
59+
border: none;
60+
padding: 0;
61+
margin: 0 4px;
62+
background-color: transparent;
63+
width: 32px;
6764
}
6865

6966
.ui button:first-child {
70-
margin-right: 4px;
67+
margin-left: 0;
7168
}
7269

73-
.ui button.go {
74-
font-weight: bold;
70+
.ui button:last-child {
71+
margin-right: 0;
7572
}
7673

77-
.ui p {
78-
margin: 8px 16px;
74+
.ui button[data-command=Help] {
75+
position: absolute;
76+
left: -50px;
77+
top: 5px;
7978
}
8079

8180
.ui table {
@@ -134,13 +133,14 @@
134133
.ui #toggle {
135134
z-index: 999;
136135
position: absolute;
137-
left: -22px;
136+
left: -23px;
138137
top: 48%;
139-
width: 36px;
140-
height: 36px;
138+
width: 35px;
139+
height: 35px;
141140
padding: 0 0 0 2px;
142141
text-align: left;
143142

143+
border: none;
144144
background-color: #fff;
145145
box-shadow: -3px 0 2px 0px #666;
146146

icons/help.png

2 KB
Loading

icons/new.png

1.35 KB
Loading

icons/open.png

1.76 KB
Loading

icons/save-as.png

2.1 KB
Loading

icons/save.png

1.23 KB
Loading

index.html

+5-7
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@
2121
<div class="ui">
2222
<h3>Map</h3>
2323
<p>
24-
<button data-command="New">New</button><button data-command="Load">Load</button>
25-
</p>
26-
<p>
27-
<button data-command="Save">Save</button><button data-command="SaveAs">Save As</button>
28-
</p>
29-
<p>
30-
<button data-command="Center">Center</button><button data-command="Help">Help</button>
24+
<button data-command="New" title="New"><img src="icons/new.png" alt="New" /></button>
25+
<button data-command="Load" title="Open"><img src="icons/open.png" alt="Open" /></button>
26+
<button data-command="Save" title="Save"><img src="icons/save.png" alt="Save" /></button>
27+
<button data-command="SaveAs" title="Save as"><img src="icons/save-as.png" alt="Save as" /></button>
3128
</p>
3229

3330
<h3>Item</h3>
@@ -83,6 +80,7 @@ <h3>Item</h3>
8380

8481
<a id="github" target="_blank" href="https://github.com/ondras/my-mind" title="GitHub project page"><img src="github.png" alt="GitHub project page" /></a>
8582
<button id="toggle" title="Toggle UI"></button>
83+
<button data-command="Help" title="Help"><img src="icons/help.png" alt="Help" /></button>
8684
</div>
8785

8886

my-mind.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,7 @@ MM.Command.Pan._step = function() {
15421542
offset[1] += dirs[ch][1];
15431543
});
15441544

1545-
MM.App.map.moveBy(10*offset[0], 10*offset[1]);
1545+
MM.App.map.moveBy(15*offset[0], 15*offset[1]);
15461546
}
15471547

15481548
MM.Command.Pan.handleEvent = function(e) {

src/command.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ MM.Command.Pan._step = function() {
227227
offset[1] += dirs[ch][1];
228228
});
229229

230-
MM.App.map.moveBy(10*offset[0], 10*offset[1]);
230+
MM.App.map.moveBy(15*offset[0], 15*offset[1]);
231231
}
232232

233233
MM.Command.Pan.handleEvent = function(e) {

0 commit comments

Comments
 (0)