UI work
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>de.srsoftware</groupId>
|
||||
<artifactId>web4rail</artifactId>
|
||||
<version>0.10.10</version>
|
||||
<version>0.10.11</version>
|
||||
<name>Web4Rail</name>
|
||||
<packaging>jar</packaging>
|
||||
<description>Java Model Railway Control</description>
|
||||
|
||||
@@ -113,10 +113,11 @@ svg circle{
|
||||
|
||||
.menu > div > .list{
|
||||
position: fixed;
|
||||
height: 30px;
|
||||
left: 5%;
|
||||
bottom: 50px;
|
||||
width: 100%;
|
||||
width: 90%;
|
||||
z-index: 10;
|
||||
padding-top: 50px;
|
||||
}
|
||||
|
||||
.menu > div > .list > *{
|
||||
@@ -152,6 +153,17 @@ h2{
|
||||
font-size: 30px;
|
||||
background: red;
|
||||
color: white;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.actions .list > div,
|
||||
.hardware .list > div,
|
||||
.help .list > div,
|
||||
.trains .list > div{
|
||||
padding: 5px;
|
||||
height: unset;
|
||||
}
|
||||
|
||||
.closebtn{
|
||||
|
||||
3
resources/svg/Contact.svg
Normal file
3
resources/svg/Contact.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg width="100" height="100" viewbox="0 0 %width% 100">
|
||||
<circle cx="50" cy="50" r="25" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 98 B |
@@ -160,21 +160,6 @@ public class Plan extends BaseClass{
|
||||
return t("Unknown action: {}",params.get(ACTION));
|
||||
}
|
||||
|
||||
/**
|
||||
* generates the action menu that is appended to the plan
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
private Tag actionMenu() throws IOException {
|
||||
Tag actionMenu = new Tag("div").clazz("actions").content(t("Actions"));
|
||||
Tag actions = new Tag("div").clazz("list").content("");
|
||||
new Div(ACTION_POWER).clazz(REALM_CU).content(t("Toggle power")).addTo(actions);
|
||||
new Div(ACTION_SAVE).clazz(REALM_PLAN).content(t("Save plan")).addTo(actions);
|
||||
new Div(ACTION_ANALYZE).clazz(REALM_PLAN).content(t("Analyze plan")).addTo(actions);
|
||||
new Div(ACTION_QR).clazz(REALM_PLAN).content(t("QR-Code")).addTo(actions);
|
||||
return actions.addTo(actionMenu);
|
||||
}
|
||||
|
||||
/**
|
||||
* attaches a new client to the event stream of the plan
|
||||
* @param client
|
||||
@@ -335,6 +320,7 @@ public class Plan extends BaseClass{
|
||||
private Tag hardwareMenu() throws IOException {
|
||||
Tag tileMenu = new Tag("div").clazz("hardware").content(t("Hardware"));
|
||||
Tag list = new Tag("div").clazz("list").content("");
|
||||
new Div(ACTION_POWER).clazz(REALM_CU).content(t("Toggle power")).addTo(list);
|
||||
new Div(ACTION_PROPS).clazz(REALM_CU).content(t("Control unit")).addTo(list);
|
||||
return list.addTo(tileMenu);
|
||||
}
|
||||
@@ -435,11 +421,11 @@ public class Plan extends BaseClass{
|
||||
private Tag menu() throws IOException {
|
||||
Tag menu = new Tag("div").clazz("menu");
|
||||
new Tag("div").clazz("emergency").content(t("Emergency")).attr("onclick","return request({realm:'"+REALM_CU+"',action:'"+ACTION_EMERGENCY+"'});").addTo(menu);
|
||||
actionMenu().addTo(menu);
|
||||
moveMenu().addTo(menu);
|
||||
planMenu().addTo(menu);
|
||||
hardwareMenu().addTo(menu);
|
||||
tileMenu().addTo(menu);
|
||||
trainMenu().addTo(menu);
|
||||
hardwareMenu().addTo(menu);
|
||||
help().addTo(menu);
|
||||
return menu;
|
||||
}
|
||||
@@ -558,6 +544,20 @@ public class Plan extends BaseClass{
|
||||
}
|
||||
return tile;
|
||||
}
|
||||
|
||||
/**
|
||||
* generates the action menu that is appended to the plan
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
private Tag planMenu() throws IOException {
|
||||
Tag actionMenu = new Tag("div").clazz("actions").content(t("Plan"));
|
||||
Tag actions = new Tag("div").clazz("list").content("");
|
||||
new Div(ACTION_SAVE).clazz(REALM_PLAN).content(t("Save")).addTo(actions);
|
||||
new Div(ACTION_ANALYZE).clazz(REALM_PLAN).content(t("Analyze")).addTo(actions);
|
||||
new Div(ACTION_QR).clazz(REALM_PLAN).content(t("QR-Code")).addTo(actions);
|
||||
return actions.addTo(actionMenu);
|
||||
}
|
||||
|
||||
/**
|
||||
* adds a command to the control unit's command queue
|
||||
@@ -754,6 +754,8 @@ public class Plan extends BaseClass{
|
||||
Tag tileMenu = new Tag("div").clazz("addtile").title(t("Add tile")).content("╦");
|
||||
|
||||
Tag tiles = new Tag("div").clazz("list").content("");
|
||||
new CrossV().tag(null).addTo(tiles);
|
||||
new CrossH().tag(null).addTo(tiles);
|
||||
new StraightH().tag(null).addTo(tiles);
|
||||
new StraightV().tag(null).addTo(tiles);
|
||||
new ContactH().tag(null).addTo(tiles);
|
||||
@@ -781,8 +783,6 @@ public class Plan extends BaseClass{
|
||||
new TurnoutLW().tag(null).addTo(tiles);
|
||||
new TurnoutLE().tag(null).addTo(tiles);
|
||||
new Turnout3E().tag(null).addTo(tiles);
|
||||
new CrossH().tag(null).addTo(tiles);
|
||||
new CrossV().tag(null).addTo(tiles);
|
||||
new Relay().setLabel(true,"RL").tag(null).addTo(tiles);
|
||||
new Eraser().tag(null).addTo(tiles);
|
||||
return tiles.addTo(tileMenu);
|
||||
|
||||
Reference in New Issue
Block a user