Improve service settings design

This commit is contained in:
Alice Gaudon 2020-01-07 13:09:02 +01:00
parent 00a9720fbc
commit ab30f0a0a0
3 changed files with 194 additions and 147 deletions

View File

@ -16,6 +16,29 @@ body {
font-family: sans-serif; font-family: sans-serif;
} }
textarea {
resize: vertical;
min-height: 32px;
}
input, select, textarea, button {
border: 0;
color: #fff;
background-color: #ffffff12;
border-radius: 3px;
}
button {
padding: 8px 16px;
text-transform: uppercase;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #ffffff20;
}
.loader { .loader {
--border-width: 6px; --border-width: 6px;

View File

@ -0,0 +1,124 @@
.form-group.hidden,
#icon-select.hidden {
display: none;
}
#icon-select {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}
.choice {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
width: 128px;
height: 128px;
margin: 8px;
border: 1px solid black;
cursor: pointer;
}
.choice img {
margin: 16px;
max-width: 112px;
max-height: 48px;
filter: invert(1);
}
.choice span {
display: block;
width: 100%;
margin: 8px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.choice input {
display: none;
}
.choice.hidden {
display: none;
}
.choice.selected {
background-color: #ffffff26;
}
form {
display: flex;
flex-direction: column;
height: 100%;
}
.form-body {
flex: 1;
overflow: hidden auto;
}
.form-header,
.form-footer,
.form-group-header {
background-color: #ffffff14;
}
.form-group {
display: grid;
margin: 8px;
grid-template-columns: 0fr auto;
}
.form-group > * {
margin: 8px;
padding: 8px;
white-space: nowrap;
align-self: center;
}
.form-group > :nth-child(1) {
justify-self: end;
}
.form-group > :nth-child(2) {
margin-left: 8px;
}
#buttons {
grid-template-columns: repeat(2, 1fr);
}
#buttons > button {
max-width: 120px;
}
#buttons > :nth-child(1) {
width: 100%;
justify-self: auto;
}
#buttons > :nth-child(2) {
width: 100%;
justify-self: end;
}
#icon-choice {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
max-height: 570px;
}
#icon-select {
overflow: auto;
}
#custom-css {
min-height: 96px;
}

View File

@ -8,122 +8,16 @@
integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous"> integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">
<link rel="stylesheet" href="layout.css"> <link rel="stylesheet" href="layout.css">
<link rel="stylesheet" href="service-settings.css">
<style>
.form-group.hidden,
#icon-select.hidden {
display: none;
}
#icon-select {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}
.choice {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
width: 128px;
height: 128px;
margin: 8px;
border: 1px solid black;
cursor: pointer;
}
.choice img {
margin: 16px;
max-width: 112px;
max-height: 48px;
filter: invert(1);
}
.choice span {
display: block;
width: 100%;
margin: 8px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.choice input {
display: none;
}
.choice.hidden {
display: none;
}
.choice.selected {
background-color: #ffffff26;
}
form {
display: flex;
flex-direction: column;
height: 100%;
}
#icon-choice {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
#icon-select {
overflow: auto;
}
.form-group {
display: grid;
margin: 8px;
grid-template-columns: 0fr auto;
}
.form-group > * {
margin: 8px;
padding: 8px;
white-space: nowrap;
align-self: center;
}
.form-group > :nth-child(1) {
justify-self: end;
}
.form-group > :nth-child(2) {
margin-left: 8px;
}
#buttons {
grid-template-columns: repeat(2, 1fr);
}
#buttons > button {
max-width: 120px;
}
#buttons > :nth-child(1) {
width: 100%;
justify-self: auto;
}
#buttons > :nth-child(2) {
width: 100%;
justify-self: end;
}
</style>
</head> </head>
<body> <body>
<form action="javascript: save();"> <form action="javascript: save();">
<div class="form-header">
<h1>Loading...</h1> <h1>Loading...</h1>
</div>
<div class="form-body">
<div class="form-group"> <div class="form-group">
<label for="name">Service name</label> <label for="name">Service name</label>
<input type="text" name="name" id="name" required> <input type="text" name="name" id="name" required>
@ -145,7 +39,10 @@
</div> </div>
<div id="icon-choice"> <div id="icon-choice">
<div class="form-group-header">
<h2>Service icon</h2> <h2>Service icon</h2>
</div>
<div class="form-group"> <div class="form-group">
<label for="use-favicon">Use favicon</label> <label for="use-favicon">Use favicon</label>
<input type="checkbox" name="useFavicon" id="use-favicon"> <input type="checkbox" name="useFavicon" id="use-favicon">
@ -167,11 +64,14 @@
<input type="text" name="icon" id="icon-url"> <input type="text" name="icon" id="icon-url">
</div> </div>
</div> </div>
</div>
<div class="form-footer">
<div class="form-group" id="buttons"> <div class="form-group" id="buttons">
<button id="cancel-button">Cancel</button> <button id="cancel-button">Cancel</button>
<button type="submit">Save</button> <button type="submit">Save</button>
</div> </div>
</div>
</form> </form>
<script> <script>