Skip to content

Commit 25b176e

Browse files
committed
Style changes to UI settings page
1 parent fd2483a commit 25b176e

2 files changed

Lines changed: 49 additions & 3 deletions

File tree

application/static/style.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,3 +678,31 @@ footer a:hover {
678678
text-decoration: none;
679679
color: var(--main-color);
680680
}
681+
682+
input[type=color] {
683+
width: 5ch;
684+
height: 2em;
685+
background-color: transparent;
686+
border-radius: 1ch;
687+
}
688+
689+
.filepreview img {
690+
height: 64px;
691+
border-radius: 8px;
692+
padding: 10px;
693+
}
694+
695+
.filepreview p {
696+
line-height: 24px;
697+
margin-block-start: 0px;
698+
margin-block-end: 0px;
699+
margin-top: 20px;
700+
padding-right: 10px;
701+
}
702+
703+
.filepreview {
704+
border: 2px solid black;
705+
border-radius: 10px;
706+
display: inline-flex;
707+
cursor: pointer;
708+
}

application/templates/uisettings.html

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
{% extends "utils/layout.html" %}
2+
3+
{% block scripts %}
4+
<script>
5+
function updateImagePreview(input) {
6+
file = input.files[0];
7+
console.log(file);
8+
if (file.type == "image/png") {
9+
document.getElementById("filename").innerText = file.name;
10+
document.getElementById("imagepreview").src = URL.createObjectURL(file);
11+
}
12+
}
13+
</script>
14+
{% endblock %}
15+
216
{% block body %}
317
<div class="contentw admindiv">
418
<h1>Edit UI Settings</h1>
@@ -8,16 +22,20 @@ <h1>Edit UI Settings</h1>
822
<form method="post" enctype="multipart/form-data">
923
<label for="colour">Colour:</label>
1024
<input id="colour" name="colour" type="color" value="{{colourString}}"><br />
11-
<label for="bigimage">Big image:</label>
12-
<input id="bigimage" name="bigimage" type="file" accept=".png"><br />
1325
<label for="appname">App name:</label>
1426
<input id="appname" name="appName" type="text" value="{{app_name()}}"><br />
1527
<input id="hidedayleaderboard" name="hideDayLeaderboard" type="checkbox" {% if ui_settings["hideDayLeaderboard"] %}checked{% endif %}>
16-
<label for="hidedayleaderboard">Hide day leaderboard</label><br />
28+
<label for="hidedayleaderboard">Hide daily leaderboard</label><br />
1729
<input id="enablestrava" name="enableStrava" type="checkbox" {% if ui_settings["enableStrava"] %}checked{% endif %}>
1830
<label for="enablestrava">Enable Strava</label><br />
1931
<input id="showwalksbyhour" name="showWalksByHour" type="checkbox" {% if ui_settings["showWalksByHour"] %}checked{% endif %}>
2032
<label for="showwalksbyhour">Show walks by hour</label><br />
33+
<hr>
34+
<label for="bigimage">Select Main Image<br>
35+
<div class="filepreview">
36+
<img id="imagepreview" src="/bigimage.png"><p id="filename"> Current Logo</p>
37+
</div></label>
38+
<input id="bigimage" name="bigimage" type="file" accept=".png" style="display:none;" onchange="updateImagePreview(this)"><br />
2139
<input type="submit" value="Apply">
2240
</form>
2341
</div>

0 commit comments

Comments
 (0)